From 05a7114a4a9713521faed4145a8bf0f4c35020bb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 25 Jun 2021 21:05:28 +0200 Subject: smoketest: ospf: sometimes the passive-interface-test fails - add debug code --- smoketest/scripts/cli/test_protocols_ospf.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 7ff909e33..23e5f2678 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -20,6 +20,7 @@ from base_vyostest_shim import VyOSUnitTestSHIM from vyos.ifconfig import Section from vyos.util import process_named_running +from vyos.util import cmd PROCESS_NAME = 'ospfd' base_path = ['protocols', 'ospf'] @@ -195,11 +196,17 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): # Verify FRR ospfd configuration frrconfig = self.getFRRconfig('router ospf') - self.assertIn(f'router ospf', frrconfig) - self.assertIn(f' passive-interface default', frrconfig) # default - for interface in interfaces: - self.assertIn(f' no passive-interface {interface}', frrconfig) # default - + try: + self.assertIn(f'router ospf', frrconfig) + self.assertIn(f' passive-interface default', frrconfig) # default + for interface in interfaces: + self.assertIn(f' no passive-interface {interface}', frrconfig) # default + except: + tmp = cmd('tail -n 250 /var/log/messages') + print(tmp) + tmp = cmd('vtysh -c "show run"') + print(tmp) + self.fail('Now we can hopefully see why OSPF fails') def test_ospf_08_redistribute(self): metric = '15' -- cgit v1.2.3