mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Fix failing tests
This commit is contained in:
parent
fb658a369b
commit
91dc936543
1 changed files with 26 additions and 7 deletions
|
@ -286,11 +286,29 @@ def test_set_firewall_settings(store, setting, value):
|
|||
assert ret is True
|
||||
|
||||
|
||||
@pytest.mark.destructive_test
|
||||
@pytest.mark.parametrize("store", ["local", "lgpo"])
|
||||
@pytest.mark.parametrize("state", ["on", "off", "notconfigured"])
|
||||
def test_set_firewall_state(store, state):
|
||||
current_state = win_lgpo_netsh.get_settings(
|
||||
profile="domain", section="state", store=store
|
||||
)["State"]
|
||||
try:
|
||||
ret = win_lgpo_netsh.set_state(profile="domain", state=state, store=store)
|
||||
assert ret is True
|
||||
new = win_lgpo_netsh.get_settings(
|
||||
profile="domain", section="state", store=store
|
||||
)["State"]
|
||||
assert new.lower() == state.lower()
|
||||
finally:
|
||||
win_lgpo_netsh.set_state(profile="domain", state=current_state, store=store)
|
||||
|
||||
|
||||
@pytest.mark.destructive_test
|
||||
@pytest.mark.parametrize("store", ["local", "lgpo"])
|
||||
@pytest.mark.parametrize("allow_inbound", ["enable", "disable"])
|
||||
@pytest.mark.parametrize("state", ["on", "off", "notconfigured"])
|
||||
def test_set_firewall_state(store, allow_inbound, state):
|
||||
def test_set_firewall_state_allow_inbound(store, allow_inbound, state):
|
||||
current_state = win_lgpo_netsh.get_settings(
|
||||
profile="domain", section="state", store=store
|
||||
)["State"]
|
||||
|
@ -316,10 +334,11 @@ def test_set_firewall_state(store, allow_inbound, state):
|
|||
)["State"]
|
||||
assert new.lower() == state.lower()
|
||||
finally:
|
||||
win_lgpo_netsh.set_settings(
|
||||
profile="domain",
|
||||
setting="localfirewallrules",
|
||||
value=current_local_fw_rules,
|
||||
store=store,
|
||||
)
|
||||
if current_local_fw_rules.lower() != "notconfigured":
|
||||
win_lgpo_netsh.set_settings(
|
||||
profile="domain",
|
||||
setting="localfirewallrules",
|
||||
value=current_local_fw_rules,
|
||||
store=store,
|
||||
)
|
||||
win_lgpo_netsh.set_state(profile="domain", state=current_state, store=store)
|
||||
|
|
Loading…
Add table
Reference in a new issue