From 92abca4c3b8bde5f862bb3b724c3577a25f742af Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Sep 2023 00:07:16 +0200 Subject: tests/shell: fix handling failures with VALGRIND=y With VALGRIND=y, on memleaks the tests did not fail. Fix that by passing "--error-exitcode=122" to valgrind. But just returning 122 from $NFT command may not correctly fail the test. Instead, ensure to write a "rc-failed-valrind" file, which is picked up by "test-wrapper.sh" to properly handle the valgrind failure (and fail with error code 122 itself). Also, accept NFT_TEST_VALGRIND_OPTS variable to a pass additional arguments to valgrind. For example a "--suppressions" file. Also show the special error code [VALGRIND] in "run-test.sh". Signed-off-by: Thomas Haller Signed-off-by: Florian Westphal --- tests/shell/run-tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/shell/run-tests.sh') diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index c8688587..ab91fd4d 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -527,7 +527,9 @@ print_test_result() { else ((failed++)) result_msg_level="W" - if [ "$rc_got" -eq 123 ] ; then + if [ "$rc_got" -eq 122 ] ; then + result_msg_status="VALGRIND" + elif [ "$rc_got" -eq 123 ] ; then result_msg_status="TAINTED" elif [ "$rc_got" -eq 124 ] ; then result_msg_status="DUMP FAIL" -- cgit v1.2.3