diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-01-21 12:35:44 +0000 |
|---|---|---|
| committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-01-21 12:52:57 +0000 |
| commit | f1316bbcf852dfc29bb29cb5c4203eb4b625bc15 (patch) | |
| tree | 6df2b80638726c0024347fb0c52802c24438f6e6 /smoketest/scripts | |
| parent | 53bfe24e62413af1ccc6d406bf55c8f51e64fbd7 (diff) | |
| download | vyos-1x-f1316bbcf852dfc29bb29cb5c4203eb4b625bc15.tar.gz vyos-1x-f1316bbcf852dfc29bb29cb5c4203eb4b625bc15.zip | |
smoketest: Add check bonding state without VLANs
Diffstat (limited to 'smoketest/scripts')
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index be2164c19..582c41c68 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2023-2024 VyOS Inc. +# Copyright (C) 2023-2025 VyOS Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -541,6 +541,21 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_set( base_path + ['interfaces', 'bonding', interface_bond, 'mode', mode] ) + + # commit changes + self.cli_commit() + + # Check for interface state "BondEthernet23 up" + _, out = rc_cmd('sudo vppctl show interface') + # Normalize the output for consistent whitespace + normalized_out = re.sub(r'\s+', ' ', out) + self.assertRegex( + normalized_out, + r'BondEthernet23\s+\d+\s+up', + "Interface BondEthernet23 is not in the expected state 'up'." + ) + + # set kernel interface self.cli_set( base_path + [ @@ -594,6 +609,17 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): for entry in required_enries: self.assertIn(entry, out) + # check interface state + _, out = rc_cmd('sudo vppctl show interface') + # Normalize the output for consistent whitespace + normalized_out = re.sub(r'\s+', ' ', out) + # Check for interface state "BondEthernet23 up" + self.assertRegex( + normalized_out, + r'BondEthernet23\s+\d+\s+up', + "Interface BondEthernet23 is not in the expected state 'up'." + ) + # delete vpp kernel-interface vlan self.cli_delete(base_path + ['kernel-interfaces', interface_kernel, 'vif']) self.cli_commit() @@ -614,6 +640,10 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_set(base_path + ['interfaces', 'bonding', interface_bond]) self.cli_commit() + # check deleting bonding interface + _, out = rc_cmd('sudo vppctl show interface') + self.assertNotIn('BondEthernet23', out) + def test_07_vpp_bridge(self): fake_member = 'eth2' members = [interface] |
