From 8833a8387fd085a6f7af80bd2a53c1a3f4d8e67d Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Thu, 29 Jun 2017 10:49:11 -0300 Subject: [PATCH] topogen: don't backtrace when topogen is not used 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/topotests/conftest.py diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py old mode 100644 new mode 100755 index e042a3d13a..a8bc539943 --- a/tests/topotests/conftest.py +++ b/tests/topotests/conftest.py @@ -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') -- 2.39.5