diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-29 17:02:51 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-29 17:02:51 +0100 |
commit | 17413578a56d3a151fe6527c2dd606d7c1f93580 (patch) | |
tree | 9fe3c9758d7eaaaf8082344d5c97237df937dfd0 /smoketest/scripts | |
parent | 4250ebbd1215fe6d8a2926c1c77e3e67f47ea2dc (diff) | |
download | vyos-1x-17413578a56d3a151fe6527c2dd606d7c1f93580.tar.gz vyos-1x-17413578a56d3a151fe6527c2dd606d7c1f93580.zip |
smoketest: ospf: T3267: test interface configuration
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_ospf.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index d93e87945..ce30f6a7d 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -30,6 +30,9 @@ route_map = 'foo-bar-baz10' def getFRROSPFconfig(): return cmd('vtysh -c "show run" | sed -n "/router ospf/,/^!/p"') +def getFRRInterfaceConfig(interface): + return cmd(f'vtysh -c "show run" | sed -n "/^interface {interface}$/,/^!/p"') + class TestProtocolsOSPF(unittest.TestCase): def setUp(self): self.session = ConfigSession(os.getpid()) @@ -261,5 +264,36 @@ class TestProtocolsOSPF(unittest.TestCase): for network in networks: self.assertIn(f' network {network} area {area}', frrconfig) + def test_ospf_10_interface_configureation(self): + interfaces = Section.interfaces('ethernet') + password = 'vyos1234' + bandwidth = '10000' + cost = '150' + network = 'point-to-point' + priority = '200' + + for interface in interfaces: + self.session.set(base_path + ['interface', interface, 'authentication', 'plaintext-password', password]) + self.session.set(base_path + ['interface', interface, 'bandwidth', bandwidth]) + self.session.set(base_path + ['interface', interface, 'bfd']) + self.session.set(base_path + ['interface', interface, 'cost', cost]) + self.session.set(base_path + ['interface', interface, 'mtu-ignore']) + self.session.set(base_path + ['interface', interface, 'network', network]) + self.session.set(base_path + ['interface', interface, 'priority', priority]) + + # commit changes + self.session.commit() + + for interface in interfaces: + config = getFRRInterfaceConfig(interface) + self.assertIn(f'interface {interface}', config) + self.assertIn(f' ip ospf authentication-key {password}', config) + self.assertIn(f' ip ospf bfd', config) + self.assertIn(f' ip ospf cost {cost}', config) + self.assertIn(f' ip ospf mtu-ignore', config) + self.assertIn(f' ip ospf network {network}', config) + self.assertIn(f' ip ospf priority {priority}', config) + self.assertIn(f' bandwidth {bandwidth}', config) + if __name__ == '__main__': unittest.main(verbosity=2) |