summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorShawn Wilsher <656602+sdwilsh@users.noreply.github.com>2021-04-29 14:59:04 -0700
committerGitHub <noreply@github.com>2021-04-29 21:59:04 +0000
commitbbfba5ce18f50e3c5284b75df99ba2d8b069c46f (patch)
tree45de27e7cff4e695f2418152c6b9522b4065bf56 /tests/unit
parent27481cb586042ef4ff1c15f8df46493bb84b3980 (diff)
downloadvyos.vyos-bbfba5ce18f50e3c5284b75df99ba2d8b069c46f.tar.gz
vyos.vyos-bbfba5ce18f50e3c5284b75df99ba2d8b069c46f.zip
[firewall_global] port-groups are not added (#143)
[firewall_global] port-groups are not added Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/modules/network/vyos/fixtures/vyos_firewall_global_config.cfg2
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_firewall_global.py33
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/unit/modules/network/vyos/fixtures/vyos_firewall_global_config.cfg b/tests/unit/modules/network/vyos/fixtures/vyos_firewall_global_config.cfg
index 2a2a8e8..6c275a3 100644
--- a/tests/unit/modules/network/vyos/fixtures/vyos_firewall_global_config.cfg
+++ b/tests/unit/modules/network/vyos/fixtures/vyos_firewall_global_config.cfg
@@ -4,3 +4,5 @@ set firewall group address-group RND-HOSTS address 192.0.2.5
set firewall group address-group RND-HOSTS description 'This group has the Management hosts address lists'
set firewall group network-group RND network 192.0.2.0/24
set firewall group network-group RND description 'This group has the Management network addresses'
+set firewall group port-group SSH port 22
+set firewall group port-group SSH description 'This group has the ssh ports'
diff --git a/tests/unit/modules/network/vyos/test_vyos_firewall_global.py b/tests/unit/modules/network/vyos/test_vyos_firewall_global.py
index 0697f6e..fa40d7c 100644
--- a/tests/unit/modules/network/vyos/test_vyos_firewall_global.py
+++ b/tests/unit/modules/network/vyos/test_vyos_firewall_global.py
@@ -122,6 +122,13 @@ class TestVyosFirewallRulesModule(TestVyosModule):
members=[dict(address="192.0.1.0/24")],
)
],
+ port_group=[
+ dict(
+ name="TELNET",
+ description="This group has the telnet ports",
+ members=[dict(port="23")],
+ )
+ ],
),
),
state="merged",
@@ -136,6 +143,9 @@ class TestVyosFirewallRulesModule(TestVyosModule):
"set firewall group network-group MGMT network 192.0.1.0/24",
"set firewall group network-group MGMT description 'This group has the Management network addresses'",
"set firewall group network-group MGMT",
+ "set firewall group port-group TELNET port 23",
+ "set firewall group port-group TELNET description 'This group has the telnet ports'",
+ "set firewall group port-group TELNET",
"set firewall ip-src-route 'enable'",
"set firewall receive-redirects 'disable'",
"set firewall send-redirects 'enable'",
@@ -175,6 +185,13 @@ class TestVyosFirewallRulesModule(TestVyosModule):
members=[dict(address="192.0.2.0/24")],
)
],
+ port_group=[
+ dict(
+ name="SSH",
+ description="This group has the ssh ports",
+ members=[dict(port="22")],
+ )
+ ],
)
),
state="merged",
@@ -205,6 +222,13 @@ class TestVyosFirewallRulesModule(TestVyosModule):
members=[dict(address="192.0.2.0/24")],
)
],
+ port_group=[
+ dict(
+ name="SSH",
+ description="This group has the ssh ports",
+ members=[dict(port="2222")],
+ )
+ ],
)
),
state="replaced",
@@ -215,6 +239,8 @@ class TestVyosFirewallRulesModule(TestVyosModule):
"delete firewall group address-group RND-HOSTS address 192.0.2.5",
"set firewall group address-group RND-HOSTS address 192.0.2.7",
"set firewall group address-group RND-HOSTS address 192.0.2.9",
+ "delete firewall group port-group SSH port 22",
+ "set firewall group port-group SSH port 2222",
]
self.execute_module(changed=True, commands=commands)
@@ -241,6 +267,13 @@ class TestVyosFirewallRulesModule(TestVyosModule):
members=[dict(address="192.0.2.0/24")],
)
],
+ port_group=[
+ dict(
+ name="SSH",
+ description="This group has the ssh ports",
+ members=[dict(port="22")],
+ )
+ ],
)
),
state="replaced",