summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_firewall_rules.py55
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_interface.py77
2 files changed, 111 insertions, 21 deletions
diff --git a/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py b/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py
index 8d59e19..7219443 100644
--- a/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py
+++ b/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py
@@ -824,8 +824,14 @@ class TestVyosFirewallRulesModule(TestVyosModule):
dict(
afi="ipv6",
rule_sets=[
- dict(name="V6-INGRESS", default_action="accept",),
- dict(name="V6-EGRESS", default_action="reject",),
+ dict(
+ name="V6-INGRESS",
+ default_action="accept",
+ ),
+ dict(
+ name="V6-EGRESS",
+ default_action="reject",
+ ),
],
),
],
@@ -862,14 +868,23 @@ class TestVyosFirewallRulesModule(TestVyosModule):
)
],
),
- dict(name="V4-EGRESS", default_action="reject",),
+ dict(
+ name="V4-EGRESS",
+ default_action="reject",
+ ),
],
),
dict(
afi="ipv6",
rule_sets=[
- dict(name="V6-INGRESS", default_action="accept",),
- dict(name="V6-EGRESS", default_action="reject",),
+ dict(
+ name="V6-INGRESS",
+ default_action="accept",
+ ),
+ dict(
+ name="V6-EGRESS",
+ default_action="reject",
+ ),
],
),
],
@@ -902,14 +917,23 @@ class TestVyosFirewallRulesModule(TestVyosModule):
)
],
),
- dict(name="V4-EGRESS", default_action="reject",),
+ dict(
+ name="V4-EGRESS",
+ default_action="reject",
+ ),
],
),
dict(
afi="ipv6",
rule_sets=[
- dict(name="V6-INGRESS", default_action="accept",),
- dict(name="V6-EGRESS", default_action="reject",),
+ dict(
+ name="V6-INGRESS",
+ default_action="accept",
+ ),
+ dict(
+ name="V6-EGRESS",
+ default_action="reject",
+ ),
],
),
],
@@ -1020,14 +1044,23 @@ class TestVyosFirewallRulesModule(TestVyosModule):
)
],
),
- dict(name="V4-EGRESS", default_action="reject",),
+ dict(
+ name="V4-EGRESS",
+ default_action="reject",
+ ),
],
),
dict(
afi="ipv6",
rule_sets=[
- dict(name="V6-INGRESS", default_action="accept",),
- dict(name="V6-EGRESS", default_action="reject",),
+ dict(
+ name="V6-INGRESS",
+ default_action="accept",
+ ),
+ dict(
+ name="V6-EGRESS",
+ default_action="reject",
+ ),
],
),
],
diff --git a/tests/unit/modules/network/vyos/test_vyos_interface.py b/tests/unit/modules/network/vyos/test_vyos_interface.py
index 96bc9f6..1194e3b 100644
--- a/tests/unit/modules/network/vyos/test_vyos_interface.py
+++ b/tests/unit/modules/network/vyos/test_vyos_interface.py
@@ -120,7 +120,12 @@ class TestVyosInterfaceModule(TestVyosModule):
def test_vyos_setup_required_params(self):
set_module_args(
- dict(name="eth1", enabled=True, state="present", speed="100",)
+ dict(
+ name="eth1",
+ enabled=True,
+ state="present",
+ speed="100",
+ )
)
result = self.execute_module(failed=True)
self.assertIn(
@@ -128,11 +133,22 @@ class TestVyosInterfaceModule(TestVyosModule):
)
def test_vyos_setup_int_idempotent(self):
- set_module_args(dict(name="eth1", enabled=True, state="present",))
+ set_module_args(
+ dict(
+ name="eth1",
+ enabled=True,
+ state="present",
+ )
+ )
self.execute_module(changed=False, commands=[])
def test_vyos_disable_int(self):
- set_module_args(dict(name="eth1", state="absent",))
+ set_module_args(
+ dict(
+ name="eth1",
+ state="absent",
+ )
+ )
commands = ["delete interfaces ethernet eth1"]
self.execute_module(changed=True, commands=commands)
@@ -173,8 +189,14 @@ class TestVyosInterfaceModule(TestVyosModule):
set_module_args(
dict(
aggregate=[
- dict(name="eth1", state="absent",),
- dict(name="eth2", state="absent",),
+ dict(
+ name="eth1",
+ state="absent",
+ ),
+ dict(
+ name="eth2",
+ state="absent",
+ ),
]
)
)
@@ -188,8 +210,14 @@ class TestVyosInterfaceModule(TestVyosModule):
set_module_args(
dict(
aggregate=[
- dict(name="eth1", enabled=False,),
- dict(name="eth2", enabled=False,),
+ dict(
+ name="eth1",
+ enabled=False,
+ ),
+ dict(
+ name="eth2",
+ enabled=False,
+ ),
]
)
)
@@ -213,7 +241,16 @@ class TestVyosInterfaceModule(TestVyosModule):
)
def test_vyos_intent_neighbor_fail(self):
- set_module_args(dict(name="eth0", neighbors=[dict(port="eth0",)]))
+ set_module_args(
+ dict(
+ name="eth0",
+ neighbors=[
+ dict(
+ port="eth0",
+ )
+ ],
+ )
+ )
result = self.execute_module(failed=True)
self.assertIn(
"One or more conditional statements have not been satisfied",
@@ -221,11 +258,31 @@ class TestVyosInterfaceModule(TestVyosModule):
)
def test_vyos_intent_neighbor(self):
- set_module_args(dict(name="eth1", neighbors=[dict(port="eth0",)]))
+ set_module_args(
+ dict(
+ name="eth1",
+ neighbors=[
+ dict(
+ port="eth0",
+ )
+ ],
+ )
+ )
self.execute_module(failed=False)
def test_vyos_intent_neighbor_aggregate(self):
set_module_args(
- dict(aggregate=[dict(name="eth1", neighbors=[dict(port="eth0",)])])
+ dict(
+ aggregate=[
+ dict(
+ name="eth1",
+ neighbors=[
+ dict(
+ port="eth0",
+ )
+ ],
+ )
+ ]
+ )
)
self.execute_module(failed=False)