mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 09:44:26 +00:00
topotests: skip tests when any assert fails
When an `assert` fails we should skip all other tests on the file. Once a failure is detected we can't rely on the setup anymore, since most of the tests assume the previous worked. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
44cde8a39f
commit
c8c265f571
@ -74,3 +74,9 @@ def pytest_runtest_makereport(item, call):
|
|||||||
parent._previousfailed = item
|
parent._previousfailed = item
|
||||||
logger.error('assert failed at "{}/{}": {}'.format(
|
logger.error('assert failed at "{}/{}": {}'.format(
|
||||||
modname, item.name, call.excinfo.value))
|
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))
|
||||||
|
Loading…
Reference in New Issue
Block a user