diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2025-03-03 15:41:27 +0200 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2025-03-12 13:54:38 +0200 |
| commit | 877166b8aef1132f5bad208aee00444819264501 (patch) | |
| tree | c4074aea2889cb1c543095b68b87cf36ca7f0030 /smoketest/scripts/cli/test_vpp.py | |
| parent | 7de0ab73af90d4d39519f3ba0dec80fb6b9badf5 (diff) | |
| download | vyos-1x-877166b8aef1132f5bad208aee00444819264501.tar.gz vyos-1x-877166b8aef1132f5bad208aee00444819264501.zip | |
T7189: VPP source of the tunnel interface should be checked and configured
Changed priority for VPP interfaces: all VPP interfaces must be configured after Ethernet interfaces
Diffstat (limited to 'smoketest/scripts/cli/test_vpp.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index 6c19fbba0..57f47067a 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -106,6 +106,10 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_delete(base_path) self.cli_commit() + # delete address for Ethernet interface + self.cli_delete(['interfaces', 'ethernet', interface, 'address']) + self.cli_commit() + self.assertFalse(os.path.exists(VPP_CONF)) self.assertFalse(process_named_running(PROCESS_NAME)) @@ -170,11 +174,21 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): base_path + ['interfaces', 'vxlan', interface_vxlan, 'source-address', source_address] ) + self.cli_set(base_path + ['interfaces', 'vxlan', interface_vxlan, 'vni', vni]) + + # remote and source address must not be the same + # expect raise ConfigError + self.cli_set( + base_path + + ['interfaces', 'vxlan', interface_vxlan, 'remote', source_address] + ) + with self.assertRaises(ConfigSessionError): + self.cli_commit() + self.cli_set( base_path + ['interfaces', 'vxlan', interface_vxlan, 'remote', remote_address] ) - self.cli_set(base_path + ['interfaces', 'vxlan', interface_vxlan, 'vni', vni]) self.cli_set( base_path + [ @@ -214,6 +228,23 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): new_source_address, ] ) + + # source address of the tunnel interface should be configured + # expect raise ConfigError + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set( + [ + 'interfaces', + 'ethernet', + interface, + 'vif', + vni, + 'address', + f'{new_source_address}/24', + ] + ) self.cli_commit() # check gre interface after update @@ -274,7 +305,11 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.assertFalse(os.path.isdir(f'/sys/class/net/{interface_kernel}')) # delete vxlan interface - self.cli_set(base_path + ['interfaces', 'vxlan', interface_vxlan]) + self.cli_delete(base_path + ['interfaces', 'vxlan', interface_vxlan]) + self.cli_commit() + + # delete vif Ethernet interface + self.cli_delete(['interfaces', 'ethernet', interface, 'vif']) self.cli_commit() def test_03_vpp_gre(self): @@ -302,6 +337,15 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): + ['kernel-interfaces', interface_kernel, 'address', f'{kernel_address}/31'] ) + # source address of the tunnel interface should be configured + # expect raise ConfigError + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set( + ['interfaces', 'ethernet', interface, 'address', f'{source_address}/24'] + ) + # commit changes self.cli_commit() @@ -319,6 +363,10 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): base_path + ['interfaces', 'gre', interface_gre, 'source-address', new_source_address] ) + + self.cli_set( + ['interfaces', 'ethernet', interface, 'address', f'{new_source_address}/24'] + ) self.cli_commit() # check gre interface after update @@ -364,7 +412,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.assertFalse(os.path.isdir(f'/sys/class/net/{interface_kernel}')) # delete gre interface - self.cli_set(base_path + ['interfaces', 'gre', interface_gre]) + self.cli_delete(base_path + ['interfaces', 'gre', interface_gre]) self.cli_commit() @unittest.skip('Skipping this test geneve index always is 0') @@ -566,7 +614,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.assertFalse(os.path.isdir(f'/sys/class/net/{interface_kernel}')) # delete loopback interface - self.cli_set(base_path + ['interfaces', 'loopback', interface_loopback]) + self.cli_delete(base_path + ['interfaces', 'loopback', interface_loopback]) self.cli_commit() @unittest.skip('Skipping temporary bonding, sometimes get recursion T7117') @@ -900,6 +948,15 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): new_source_address, ] ) + + # source address of the tunnel interface should be configured + # expect raise ConfigError + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set( + ['interfaces', 'ethernet', interface, 'address', f'{new_source_address}/24'] + ) self.cli_commit() # check ipip interface after update @@ -951,7 +1008,7 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.assertFalse(os.path.isdir(f'/sys/class/net/{interface_kernel}')) # delete ipip interface - self.cli_set(base_path + ['interfaces', 'ipip', interface_ipip]) + self.cli_delete(base_path + ['interfaces', 'ipip', interface_ipip]) self.cli_commit() def test_09_vpp_xconnect(self): |
