summaryrefslogtreecommitdiff
path: root/tests/topotests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/conftest.py')
-rwxr-xr-xtests/topotests/conftest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py
index 49e48ba927..76b0ab017e 100755
--- a/tests/topotests/conftest.py
+++ b/tests/topotests/conftest.py
@@ -74,3 +74,9 @@ def pytest_runtest_makereport(item, call):
parent._previousfailed = item
logger.error('assert failed at "{}/{}": {}'.format(
modname, item.name, call.excinfo.value))
+
+ # (topogen) Set topology error to avoid advancing in the test.
+ tgen = get_topogen()
+ if tgen is not None:
+ # This will cause topogen to report error on `routers_have_failure`.
+ tgen.set_error('{}/{}'.format(modname, item.name))