diff options
author | GomathiselviS <gomathiselvi@gmail.com> | 2021-03-30 18:50:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-30 22:50:09 +0000 |
commit | 210c758d5cfcf762d2d1801bc5e4bc68207d9ff0 (patch) | |
tree | 1ca69337a5998a8ef26efc5dc9655978baff632d /tests | |
parent | 6d2b78246f258ca31f6e01007b9a4376138455a6 (diff) | |
download | vyos.vyos-210c758d5cfcf762d2d1801bc5e4bc68207d9ff0.tar.gz vyos.vyos-210c758d5cfcf762d2d1801bc5e4bc68207d9ff0.zip |
Add support for wireguard interface (#135)
Add support for wireguard interface
Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config.cfg | 1 | ||||
-rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_interfaces.py | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config.cfg b/tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config.cfg index 90f120c..bed0b01 100644 --- a/tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config.cfg +++ b/tests/unit/modules/network/vyos/fixtures/vyos_interfaces_config.cfg @@ -4,4 +4,5 @@ set interfaces ethernet eth1 description 'test-interface' set interfaces ethernet eth2 hw-id '08:00:27:04:85:99' set interfaces ethernet eth3 hw-id '08:00:27:1c:82:d1' set interfaces ethernet eth3 description 'Ethernet 3' +set interfaces wireguard wg02 description 'wire guard int 2' set interfaces loopback 'lo' diff --git a/tests/unit/modules/network/vyos/test_vyos_interfaces.py b/tests/unit/modules/network/vyos/test_vyos_interfaces.py index 40770df..a0f5174 100644 --- a/tests/unit/modules/network/vyos/test_vyos_interfaces.py +++ b/tests/unit/modules/network/vyos/test_vyos_interfaces.py @@ -86,6 +86,7 @@ class TestVyosFirewallInterfacesModule(TestVyosModule): config=[ dict(name="bond1", description="Bond - 1", enabled=True), dict(name="vtun1", description="vtun - 1", enabled=True), + dict(name="wg01", description="wg - 1", enabled=True), ], state="merged", ) @@ -94,9 +95,26 @@ class TestVyosFirewallInterfacesModule(TestVyosModule): commands = [ "set interfaces bonding bond1 description 'Bond - 1'", "set interfaces openvpn vtun1 description 'vtun - 1'", + "set interfaces wireguard wg01 description 'wg - 1'", ] self.execute_module(changed=True, commands=commands) + def test_vyos_interfaces_merged_idempotent(self): + set_module_args( + dict( + config=[ + dict( + name="wg02", + description="wire guard int 2", + enabled=True, + ), + ], + state="merged", + ) + ) + + self.execute_module(changed=False, commands=[]) + def test_vyos_interfaces_merged_newinterface(self): set_module_args( dict( @@ -169,6 +187,7 @@ class TestVyosFirewallInterfacesModule(TestVyosModule): "set interfaces ethernet eth4 description 'Ethernet 4'", "set interfaces ethernet eth4 duplex 'auto'", "set interfaces ethernet eth4 speed 'auto'", + "delete interfaces wireguard wg02 description", "delete interfaces ethernet eth3 description", ] self.execute_module(changed=True, commands=commands) |