diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-06-13 16:58:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 16:58:08 +0200 |
commit | 64d67529c341832ed8683406760311aa76c480b3 (patch) | |
tree | 3c6129f98bc5d1d8c13e79d021c3c2ee2eab7854 /smoketest/scripts/cli | |
parent | 9cfa2ec772b60b6512815422e3e08cd331f2da33 (diff) | |
parent | aec27085df23bee339bf7ada68283b406a04c3be (diff) | |
download | vyos-1x-64d67529c341832ed8683406760311aa76c480b3.tar.gz vyos-1x-64d67529c341832ed8683406760311aa76c480b3.zip |
Merge pull request #3643 from HollyGurza/T5725-equuleus
T5725: Improve protocol IS-IS config validation
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_isis.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_isis.py b/smoketest/scripts/cli/test_protocols_isis.py index 167cd05f8..316443193 100755 --- a/smoketest/scripts/cli/test_protocols_isis.py +++ b/smoketest/scripts/cli/test_protocols_isis.py @@ -37,6 +37,8 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): def tearDown(self): self.cli_delete(base_path) + self.cli_delete(['interfaces', 'dummy']) + self.cli_delete(['interfaces', 'tunnel']) self.cli_commit() # Check for running process @@ -222,5 +224,38 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(f' ipv6 router isis {domain}', tmp) self.assertIn(f' isis network {network}', tmp) + def test_isis_06_tunnel_interface(self): + self.cli_set(['interfaces', 'dummy', 'dum0', 'address', '203.0.113.254/32']) + self.cli_set(['interfaces', 'dummy', 'dum0', 'description', 'dum0']) + self.cli_set(['interfaces', 'dummy', 'dum1', 'address', '192.0.2.5/24']) + self.cli_set(['interfaces', 'dummy', 'dum1', 'description', 'LAN']) + + self.cli_set(['interfaces', 'tunnel', 'tun0', 'address', '10.0.0.2/30']) + self.cli_set(['interfaces', 'tunnel', 'tun0', 'description', 'tun-to-192.0.2.1']) + self.cli_set(['interfaces', 'tunnel', 'tun0', 'encapsulation', 'gre']) + self.cli_set(['interfaces', 'tunnel', 'tun0', 'source-address', '192.0.2.5']) + + self.cli_set(base_path + ['interface', 'dum1']) + self.cli_set(base_path + ['interface', 'tun0']) + self.cli_set(base_path + ['lsp-mtu', '1460']) + self.cli_set(base_path + ['net', '49.0001.1920.0200.0011.00']) + self.cli_set(base_path + ['redistribute', 'ipv4', 'connected', 'level-2']) + + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + self.cli_set(['interfaces', 'tunnel', 'tun0', 'remote', '192.0.2.1']) + self.cli_commit() + + frr_config = self.getFRRconfig(f'router isis {domain}', daemon='isisd') + expected_config = "router isis VyOS\n"\ + " net 49.0001.1920.0200.0011.00\n"\ + " lsp-mtu 1460\n"\ + " redistribute ipv4 connected level-2\n"\ + "!" + + self.assertEqual(expected_config, frr_config) + + if __name__ == '__main__': unittest.main(verbosity=2) |