diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-25 08:09:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 08:09:40 +0200 |
commit | 714c43c43bad2aeca0e902d924664780c8e433f2 (patch) | |
tree | 6c2c7e00b6defb791aeaef1a224a333bd40e0591 /smoketest/scripts/cli | |
parent | 3147c580cf9b9d965b62b27b5eee5f3e91df07f8 (diff) | |
parent | 69fe18810b8f8b78cc6f6e320f419334e5665691 (diff) | |
download | vyos-1x-714c43c43bad2aeca0e902d924664780c8e433f2.tar.gz vyos-1x-714c43c43bad2aeca0e902d924664780c8e433f2.zip |
Merge pull request #3869 from vyos/mergify/bp/sagitta/pr-3856
vrf: T6602: verify supplied VRF name on all interface types (backport #3856)
Diffstat (limited to 'smoketest/scripts/cli')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index 4072fd5c2..66b789e94 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -303,6 +303,24 @@ class BasicInterfaceTest: self.cli_delete(['vrf', 'name', vrf1_name]) self.cli_delete(['vrf', 'name', vrf2_name]) + def test_add_to_invalid_vrf(self): + if not self._test_vrf: + self.skipTest('not supported') + + # move interface into first VRF + for interface in self._interfaces: + for option in self._options.get(interface, []): + self.cli_set(self._base_path + [interface] + option.split()) + self.cli_set(self._base_path + [interface, 'vrf', 'invalid']) + + # check validate() - can not use a non-existing VRF + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + for interface in self._interfaces: + self.cli_delete(self._base_path + [interface, 'vrf', 'invalid']) + self.cli_set(self._base_path + [interface, 'description', 'test_add_to_invalid_vrf']) + def test_span_mirror(self): if not self._mirror_interfaces: self.skipTest('not supported') |