]> git.puffer.fish Git - mirror/frr.git/commitdiff
topogen: don't backtrace when topogen is not used
authorRafael Zalamena <rzalamena@gmail.com>
Thu, 29 Jun 2017 13:49:11 +0000 (10:49 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:11 +0000 (20:22 -0500)
This allows old tests to be run with '--topology-only' without
generating tons of error messages, instead it will just stop the test
without trying anything else.

tests/topotests/conftest.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index e042a3d..a8bc539
@@ -21,6 +21,9 @@ def pytest_runtest_call():
     # pylint: disable=E1101
     # Trust me, 'config' exists.
     if pytest.config.getoption('--topology-only'):
-        # Allow user to play with the setup.
-        get_topogen().mininet_cli()
+        tgen = get_topogen()
+        if tgen is not None:
+            # Allow user to play with the setup.
+            tgen.mininet_cli()
+
         pytest.exit('the topology executed successfully')