linux/tools/testing
Guillaume Nault d68ff8ad33 selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure.
Use 'set -e' and an exit handler to stop the script if a command fails
and ensure the test environment is cleaned up in any case. Also, handle
the case where the script is interrupted by SIGINT.

The only command that's expected to fail is 'wait $ping_pid', since
it's killed by the script. Handle this case with '|| true' to make it
play well with 'set -e'.

Finally, return the Kselftest SKIP code (4) when the script breaks
because of an environment problem or a command line failure. The 0 and
1 return codes should now reliably indicate that all tests have been
run (0: all tests run and passed, 1: all tests run but at least one
failed, 4: test script didn't run completely).

Fixes: b690842d12 ("selftests/net: test l2 tunnel TOS/TTL inheriting")
Reported-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Tested-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-01-10 10:13:52 +01:00
..
crypto/chacha20-s390 tools/testing/crypto: Use vzalloc instead of vmalloc+memset 2022-07-05 14:46:36 +02:00
cxl tools/testing/cxl: Require cache invalidation bypass 2022-12-05 12:33:20 -08:00
fault-injection
ktest ktest.pl: Add shell commands to variables 2022-12-08 23:23:05 -05:00
kunit kunit: tool: make parser preserve whitespace when printing test log 2022-12-12 14:13:48 -07:00
memblock memblock tests: remove completed TODO item 2022-11-08 09:50:24 +02:00
nvdimm libnvdimm: Introduce CONFIG_NVDIMM_SECURITY_TEST flag 2022-12-01 12:42:35 -08:00
radix-tree maple_tree: update copyright dates for test code 2022-12-15 16:37:49 -08:00
scatterlist
selftests selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure. 2023-01-10 10:13:52 +01:00
vsock vsock_test: POLLIN + SO_RCVLOWAT test 2022-08-23 10:43:12 +02:00