Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta committed May 10, 2024
1 parent 7eb6e4e commit 6d7e8e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/common/osutil/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,13 @@ def test_enable_firewall_should_not_use_wait_when_iptables_does_not_support_it(s
success, _ = osutil.DefaultOSUtil().enable_firewall(dst_ip=mock_iptables.destination, uid=mock_iptables.uid)

self.assertTrue(success, "Enabling the firewall was not successful")
# Exactly 8 calls have to be made.
# First check rule, delete 4 rules,
# Exactly 10 calls have to be made.
# First check 3 rules, delete 4 rules,
# and Append the IPTable 3 rules.
self.assertEqual(len(mock_iptables.command_calls), 8,
self.assertEqual(len(mock_iptables.command_calls), 10,
"Incorrect number of calls to iptables: [{0}]".format(mock_iptables.command_calls))
for command in mock_iptables.command_calls:
self.assertNotIn("-w", command, "The -w option should have been used in {0}".format(command))
self.assertNotIn("-w", command, "The -w option sh ould have been used in {0}".format(command))

self.assertTrue(osutil._enable_firewall, "The firewall should not have been disabled")

Expand Down

0 comments on commit 6d7e8e2

Please sign in to comment.