diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-21 15:11:38 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-22 11:18:27 +0100 |
commit | b6ec517495d15f1bb27389f966ce309f274a715b (patch) | |
tree | dbb0f1a0a0c53bc71dcac5c80eb1064881fe3a6c /smoketest | |
parent | ee86c0e710a2fba01a84a5950e79ebcd04826fb6 (diff) | |
download | vyos-1x-b6ec517495d15f1bb27389f966ce309f274a715b.tar.gz vyos-1x-b6ec517495d15f1bb27389f966ce309f274a715b.zip |
babel: T6746: define fixed testcase order
Currently FRR does not like it if redistribution tests are run last.
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_babel.py | 117 |
1 files changed, 59 insertions, 58 deletions
diff --git a/smoketest/scripts/cli/test_protocols_babel.py b/smoketest/scripts/cli/test_protocols_babel.py index 107e262cc..12f6ecf38 100755 --- a/smoketest/scripts/cli/test_protocols_babel.py +++ b/smoketest/scripts/cli/test_protocols_babel.py @@ -50,54 +50,30 @@ class TestProtocolsBABEL(VyOSUnitTestSHIM.TestCase): # check process health and continuity self.assertEqual(self.daemon_pid, process_named_running(babel_daemon)) - def test_babel_interfaces(self): - def_update_interval = default_value(base_path + ['interface', 'eth0', 'update-interval']) - channel = '20' - hello_interval = '1000' - max_rtt_penalty = '100' - rtt_decay = '23' - rtt_max = '119' - rtt_min = '11' - rxcost = '40000' - type = 'wired' + def test_01_basic(self): + diversity_factor = '64' + resend_delay = '100' + smoothing_half_life = '400' - for interface in self._interfaces: - self.cli_set(base_path + ['interface', interface]) - self.cli_set(base_path + ['interface', interface, 'channel', channel]) - self.cli_set(base_path + ['interface', interface, 'enable-timestamps']) - self.cli_set(base_path + ['interface', interface, 'hello-interval', hello_interval]) - self.cli_set(base_path + ['interface', interface, 'max-rtt-penalty', max_rtt_penalty]) - self.cli_set(base_path + ['interface', interface, 'rtt-decay', rtt_decay]) - self.cli_set(base_path + ['interface', interface, 'rtt-max', rtt_max]) - self.cli_set(base_path + ['interface', interface, 'rtt-min', rtt_min]) - self.cli_set(base_path + ['interface', interface, 'enable-timestamps']) - self.cli_set(base_path + ['interface', interface, 'rxcost', rxcost]) - self.cli_set(base_path + ['interface', interface, 'split-horizon', 'disable']) - self.cli_set(base_path + ['interface', interface, 'type', type]) + self.cli_set(base_path + ['parameters', 'diversity']) + self.cli_set(base_path + ['parameters', 'diversity-factor', diversity_factor]) + self.cli_set(base_path + ['parameters', 'resend-delay', resend_delay]) + self.cli_set(base_path + ['parameters', 'smoothing-half-life', smoothing_half_life]) self.cli_commit() frrconfig = self.getFRRconfig('router babel', endsection='^exit', daemon=babel_daemon) - for interface in self._interfaces: - self.assertIn(f' network {interface}', frrconfig) - - iface_config = self.getFRRconfig(f'interface {interface}', endsection='^exit', daemon=babel_daemon) - self.assertIn(f' babel channel {channel}', iface_config) - self.assertIn(f' babel enable-timestamps', iface_config) - self.assertIn(f' babel update-interval {def_update_interval}', iface_config) - self.assertIn(f' babel hello-interval {hello_interval}', iface_config) - self.assertIn(f' babel rtt-decay {rtt_decay}', iface_config) - self.assertIn(f' babel rtt-max {rtt_max}', iface_config) - self.assertIn(f' babel rtt-min {rtt_min}', iface_config) - self.assertIn(f' babel rxcost {rxcost}', iface_config) - self.assertIn(f' babel max-rtt-penalty {max_rtt_penalty}', iface_config) - self.assertIn(f' no babel split-horizon', iface_config) - self.assertIn(f' babel {type}', iface_config) + self.assertIn(f' babel diversity', frrconfig) + self.assertIn(f' babel diversity-factor {diversity_factor}', frrconfig) + self.assertIn(f' babel resend-delay {resend_delay}', frrconfig) + self.assertIn(f' babel smoothing-half-life {smoothing_half_life}', frrconfig) - def test_babel_redistribute(self): + def test_02_redistribute(self): ipv4_protos = ['bgp', 'connected', 'isis', 'kernel', 'ospf', 'rip', 'static'] ipv6_protos = ['bgp', 'connected', 'isis', 'kernel', 'ospfv3', 'ripng', 'static'] + self.cli_set(base_path + ['interface', self._interfaces[0], 'enable-timestamps']) + for protocol in ipv4_protos: self.cli_set(base_path + ['redistribute', 'ipv4', protocol]) for protocol in ipv6_protos: @@ -113,25 +89,7 @@ class TestProtocolsBABEL(VyOSUnitTestSHIM.TestCase): protocol = 'ospf6' self.assertIn(f' redistribute ipv6 {protocol}', frrconfig) - def test_babel_basic(self): - diversity_factor = '64' - resend_delay = '100' - smoothing_half_life = '400' - - self.cli_set(base_path + ['parameters', 'diversity']) - self.cli_set(base_path + ['parameters', 'diversity-factor', diversity_factor]) - self.cli_set(base_path + ['parameters', 'resend-delay', resend_delay]) - self.cli_set(base_path + ['parameters', 'smoothing-half-life', smoothing_half_life]) - - self.cli_commit() - - frrconfig = self.getFRRconfig('router babel', endsection='^exit', daemon=babel_daemon) - self.assertIn(f' babel diversity', frrconfig) - self.assertIn(f' babel diversity-factor {diversity_factor}', frrconfig) - self.assertIn(f' babel resend-delay {resend_delay}', frrconfig) - self.assertIn(f' babel smoothing-half-life {smoothing_half_life}', frrconfig) - - def test_babel_distribute_list(self): + def test_03_distribute_list(self): access_list_in4 = '40' access_list_out4 = '50' access_list_in4_iface = '44' @@ -214,5 +172,48 @@ class TestProtocolsBABEL(VyOSUnitTestSHIM.TestCase): self.assertIn(f' ipv6 distribute-list prefix {prefix_list_in6}-{interface} in {interface}', frrconfig) self.assertIn(f' ipv6 distribute-list prefix {prefix_list_out6}-{interface} out {interface}', frrconfig) + def test_04_interfaces(self): + def_update_interval = default_value(base_path + ['interface', 'eth0', 'update-interval']) + channel = '20' + hello_interval = '1000' + max_rtt_penalty = '100' + rtt_decay = '23' + rtt_max = '119' + rtt_min = '11' + rxcost = '40000' + type = 'wired' + + for interface in self._interfaces: + self.cli_set(base_path + ['interface', interface]) + self.cli_set(base_path + ['interface', interface, 'channel', channel]) + self.cli_set(base_path + ['interface', interface, 'enable-timestamps']) + self.cli_set(base_path + ['interface', interface, 'hello-interval', hello_interval]) + self.cli_set(base_path + ['interface', interface, 'max-rtt-penalty', max_rtt_penalty]) + self.cli_set(base_path + ['interface', interface, 'rtt-decay', rtt_decay]) + self.cli_set(base_path + ['interface', interface, 'rtt-max', rtt_max]) + self.cli_set(base_path + ['interface', interface, 'rtt-min', rtt_min]) + self.cli_set(base_path + ['interface', interface, 'rxcost', rxcost]) + self.cli_set(base_path + ['interface', interface, 'split-horizon', 'disable']) + self.cli_set(base_path + ['interface', interface, 'type', type]) + + self.cli_commit() + + frrconfig = self.getFRRconfig('router babel', endsection='^exit', daemon=babel_daemon) + for interface in self._interfaces: + self.assertIn(f' network {interface}', frrconfig) + + iface_config = self.getFRRconfig(f'interface {interface}', endsection='^exit', daemon=babel_daemon) + self.assertIn(f' babel channel {channel}', iface_config) + self.assertIn(f' babel enable-timestamps', iface_config) + self.assertIn(f' babel update-interval {def_update_interval}', iface_config) + self.assertIn(f' babel hello-interval {hello_interval}', iface_config) + self.assertIn(f' babel rtt-decay {rtt_decay}', iface_config) + self.assertIn(f' babel rtt-max {rtt_max}', iface_config) + self.assertIn(f' babel rtt-min {rtt_min}', iface_config) + self.assertIn(f' babel rxcost {rxcost}', iface_config) + self.assertIn(f' babel max-rtt-penalty {max_rtt_penalty}', iface_config) + self.assertIn(f' no babel split-horizon', iface_config) + self.assertIn(f' babel {type}', iface_config) + if __name__ == '__main__': unittest.main(verbosity=2) |