summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-18 20:54:21 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-18 19:57:17 +0000
commit2eaea1486b8a515b20f339a6771d7cef071195b7 (patch)
tree5de1bffd0a76a2359b28d25a67a7b841c7809597 /smoketest/scripts
parent2b23be0cdb09ec1a7331624f0eea736d5b55ed4c (diff)
downloadvyos-1x-2eaea1486b8a515b20f339a6771d7cef071195b7.tar.gz
vyos-1x-2eaea1486b8a515b20f339a6771d7cef071195b7.zip
smoketest: T6043: proper cleanup after testcase
This extends commit dbe8c613b ("bridge: T6043: do not call vxlan dependency if interface does not exist (yet)") with a proper cleanup of additional interfaces created during the testrun. (cherry picked from commit 4cb80868ab3ab35453d8609392ca470a02764fac)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bridge.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bridge.py b/smoketest/scripts/cli/test_interfaces_bridge.py
index 6cd2cf760..3500e97d6 100755
--- a/smoketest/scripts/cli/test_interfaces_bridge.py
+++ b/smoketest/scripts/cli/test_interfaces_bridge.py
@@ -23,6 +23,7 @@ from copy import deepcopy
from glob import glob
from vyos.ifconfig import Section
+from vyos.template import ip_from_cidr
from vyos.utils.process import cmd
from vyos.utils.file import read_file
from vyos.utils.network import get_interface_config
@@ -395,11 +396,12 @@ class BridgeInterfaceTest(BasicInterfaceTest.TestCase):
vxlan_if = 'vxlan0'
multicast_group = '239.0.0.241'
vni = '123'
+ eth0_addr = '192.0.2.2/30'
self.cli_set(['interfaces', 'bridge', br_if, 'member', 'interface', eth_if])
self.cli_set(['interfaces', 'bridge', br_if, 'member', 'interface', vxlan_if])
- self.cli_set(['interfaces', 'ethernet', 'eth0', 'address', '192.0.2.2/30'])
+ self.cli_set(['interfaces', 'ethernet', 'eth0', 'address', eth0_addr])
self.cli_set(['interfaces', 'tunnel', tunnel_if, 'address', '10.0.0.2/24'])
self.cli_set(['interfaces', 'tunnel', tunnel_if, 'enable-multicast'])
@@ -410,7 +412,7 @@ class BridgeInterfaceTest(BasicInterfaceTest.TestCase):
self.cli_set(['interfaces', 'tunnel', tunnel_if, 'parameters', 'ip', 'no-pmtu-discovery'])
self.cli_set(['interfaces', 'tunnel', tunnel_if, 'parameters', 'ip', 'ttl', '0'])
self.cli_set(['interfaces', 'tunnel', tunnel_if, 'remote', '203.0.113.2'])
- self.cli_set(['interfaces', 'tunnel', tunnel_if, 'source-address', '192.0.2.2'])
+ self.cli_set(['interfaces', 'tunnel', tunnel_if, 'source-address', ip_from_cidr(eth0_addr)])
self.cli_set(['interfaces', 'vxlan', vxlan_if, 'group', multicast_group])
self.cli_set(['interfaces', 'vxlan', vxlan_if, 'mtu', '1426'])
@@ -435,5 +437,10 @@ class BridgeInterfaceTest(BasicInterfaceTest.TestCase):
self.assertIn(eth_if, bridge_members)
self.assertIn(vxlan_if, bridge_members)
+ self.cli_delete(['interfaces', 'bridge', br_if])
+ self.cli_delete(['interfaces', 'vxlan', vxlan_if])
+ self.cli_delete(['interfaces', 'tunnel', tunnel_if])
+ self.cli_delete(['interfaces', 'ethernet', 'eth0', 'address', eth0_addr])
+
if __name__ == '__main__':
unittest.main(verbosity=2)