tests: allow to run conntrackd-tests.py via unshare
Florian Westphal
maintainerPATCH 1/1 tests: allow to run conntrackd-tests.py via unshare
Minor tweak, set lo to up so this works when run as:
unshare -n ./conntrackd-tests.py
Also allow the script to exit(1) in case there are failures so CI pipeline doesn't have to screen-scrape for errors.
Signed-off-by Florian Westphal <[email protected]>
--- tests/conntrackd/conntrackd-tests.py | 4 ++++ tests/conntrackd/tests.yaml | 1 + 2 files changed, 5 insertions(+)
tests/conntrackd/conntrackd-tests.py +4 -0
@@ -185,6 +185,10 @@ def stage_report(): logging.info("--- failed tests: {}".format(ctx.counter_test_failed)) logging.info("--- scenario failure: {}".format(ctx.counter_scenario_failed)) logging.info("--- total tests: {}".format(total)) + if ctx.counter_test_failed > 0: + exit(1) + if ctx.counter_test_ok == 0: + exit(1) def parse_args():
tests/conntrackd/tests.yaml +1 -0
@@ -78,6 +78,7 @@ NetlinkBufferSizeMaxGrowth 8388608 } EOF + - ip link set lo up - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -d - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -s | grep -q "cache" - $CONNTRACKD -C /tmp/conntrackd_notrack_hash_defaults -k
Signature · 1 line
2.53.0