mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
adding changelog. updating tests to reflect changes.
This commit is contained in:
parent
5c77b2beaa
commit
5961eb9435
2 changed files with 9 additions and 6 deletions
1
changelog/60467.fixed
Normal file
1
changelog/60467.fixed
Normal file
|
@ -0,0 +1 @@
|
|||
Use return code in iptables --check to verify rule exists.
|
|
@ -473,7 +473,8 @@ def test_check():
|
|||
|
||||
with patch.object(iptables, "_has_option", mock_has):
|
||||
with patch.dict(iptables.__salt__, {"cmd.run_stderr": mock_cmd}):
|
||||
assert iptables.check(
|
||||
with patch.dict(iptables.__context__, {"retcode": 1}):
|
||||
assert not iptables.check(
|
||||
table="filter", chain="INPUT", rule=mock_rule, family="ipv4"
|
||||
)
|
||||
|
||||
|
@ -483,6 +484,7 @@ def test_check():
|
|||
with patch.object(iptables, "_has_option", mock_has):
|
||||
with patch.object(uuid, "getnode", mock_uuid):
|
||||
with patch.dict(iptables.__salt__, {"cmd.run_stderr": mock_cmd}):
|
||||
with patch.dict(iptables.__context__, {"retcode": 0}):
|
||||
assert iptables.check(
|
||||
table="filter", chain="0x4d2", rule=mock_rule, family="ipv4"
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue