diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-06 10:54:02 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-03-06 10:54:02 +0100 |
commit | 0f643ddcf292cbe63617c507044462da29060f55 (patch) | |
tree | e1c5af80c6dd0eb8456b7ebbe3ee9a65e72bab52 | |
parent | bb3fb05b0dce3b4dc4f84b16fc257ea65b64953a (diff) | |
download | vyos-1x-0f643ddcf292cbe63617c507044462da29060f55.tar.gz vyos-1x-0f643ddcf292cbe63617c507044462da29060f55.zip |
smoketest: ospf: add debug code
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_ospf.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 0ca8bb3bd..d9a6c17e4 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -28,7 +28,7 @@ base_path = ['protocols', 'ospf'] route_map = 'foo-bar-baz10' def getFRROSPFconfig(): - return cmd('vtysh -c "show run" | sed -n "/router ospf/,/^!/p"') + 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"') @@ -258,6 +258,19 @@ class TestProtocolsOSPF(unittest.TestCase): # Verify FRR ospfd configuration frrconfig = getFRROSPFconfig() + import pprint + # From time to time the CI fails with an error like: + # ====================================================================== + # FAIL: test_ospf_09_virtual_link (__main__.TestProtocolsOSPF) + # ---------------------------------------------------------------------- + # Traceback (most recent call last): + # File "/usr/libexec/vyos/tests/smoke/cli/test_protocols_ospf.py", line 261, in test_ospf_09_virtual_link + # self.assertIn(f'router ospf', frrconfig) + # AssertionError: 'router ospf' not found in '' + # + # Add some debug code so we can find the root cause + pprint.pprint(frrconfig) + self.assertIn(f'router ospf', frrconfig) self.assertIn(f' area {area} shortcut {shortcut}', frrconfig) self.assertIn(f' area {area} virtual-link {virtual_link} hello-interval {hello} retransmit-interval {retransmit} transmit-delay {transmit} dead-interval {dead}', frrconfig) |