linux-stable/tools
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
..
accounting
arch perf tools fixes and improvements for v6.2: 2nd batch 2022-12-22 11:07:29 -08:00
bootconfig
bpf bpftool: Fix linkage with statically built libllvm 2022-12-22 20:09:43 +01:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include
io_uring
kvm/kvm_stat
laptop
leds
lib
memory-model
objtool
pci
pcmcia
perf perf tools fixes and improvements for v6.2: 2nd batch 2022-12-22 11:07:29 -08:00
power
rcu
scripts
spi
testing selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure. 2023-01-10 10:13:52 +01:00
thermal
time
tracing
usb
verification Tracing fix for 6.2: 2022-12-21 19:03:42 -08:00
virtio tools/virtio: remove smp_read_barrier_depends() 2022-12-28 05:28:11 -05:00
vm
wmi
Makefile