Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/host-iptables-chain-branches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ describe('host-iptables-chain branch coverage', () => {
// ENOENT / "not found" error. This path re-throws as a user-readable
// "iptables is required but was not found" message.
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// checkPermissionsAndSetupChain – iptables --version fails with a non-ENOENT
// error (e.g. unexpected system error). This path re-throws the original error.
// -------------------------------------------------------------------------
describe('checkPermissionsAndSetupChain – iptables --version fails with non-ENOENT error', () => {
it('rethrows the original error when iptables --version fails for a non-missing-command reason', async () => {
const originalError = new Error('Unexpected iptables failure');
mockedExeca
// iptables --version — fails with a non-ENOENT error
.mockRejectedValueOnce(originalError);

await expect(checkPermissionsAndSetupChain('FW_TEST')).rejects.toBe(originalError);
});
});

describe('checkPermissionsAndSetupChain – DOCKER-USER check fails with ENOENT', () => {
it('throws a user-readable message when DOCKER-USER list reports iptables not found', async () => {
mockedExeca
Expand Down
Loading