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.
This commit is contained in:
Rafael Zalamena 2017-06-29 10:49:11 -03:00 committed by Donald Sharp
parent b06e9eff75
commit 8833a8387f

7
tests/topotests/conftest.py Normal file → Executable file
View File

@ -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')