summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-11 18:08:22 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-11 18:08:22 +0200
commit82fbacd13f852374df2ecdd394b983325445f81b (patch)
treef1c0a9035466efcd5ba0ddc3beb86a5a16a16118 /smoketest/scripts/cli
parent29463355e6ec98195ffd52e018bc775cd4199456 (diff)
downloadvyos-1x-82fbacd13f852374df2ecdd394b983325445f81b.tar.gz
vyos-1x-82fbacd13f852374df2ecdd394b983325445f81b.zip
smoketest: ospf: add logger to passive-interface test
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index 623d40497..59862ca3d 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import logging
+import sys
import unittest
from base_vyostest_shim import VyOSUnitTestSHIM
@@ -27,6 +29,8 @@ base_path = ['protocols', 'ospf']
route_map = 'foo-bar-baz10'
+log = logging.getLogger('TestProtocolsOSPF')
+
class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
def setUp(self):
self.cli_set(['policy', 'route-map', route_map, 'rule', '10', 'action', 'permit'])
@@ -202,10 +206,11 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
for interface in interfaces:
self.assertIn(f' no passive-interface {interface}', frrconfig) # default
except:
- tmp1 = cmd('sudo dmesg')
- tmp2 = cmd('tail -n 250 /var/log/messages')
- tmp3 = cmd('vtysh -c "show run"')
- self.fail(f'Now we can hopefully see why OSPF fails:\n{tmp1}\n\n{tmp2}\n\n{tmp3}')
+ log.debug(frrconfig)
+ log.debug(cmd('sudo dmesg'))
+ log.debug(cmd('sudo cat /var/log/messages'))
+ log.debug(cmd('vtysh -c "show run"'))
+ self.fail('Now we can hopefully see why OSPF fails!')
def test_ospf_08_redistribute(self):
metric = '15'
@@ -345,4 +350,5 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.assertNotIn(zebra_route_map, frrconfig)
if __name__ == '__main__':
+ logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
unittest.main(verbosity=2)