selftests: openvswitch: Catch cases where the tests are killed
authorAaron Conole <aconole@redhat.com>
Wed, 11 Oct 2023 19:49:37 +0000 (15:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:07 +0000 (12:03 +0200)
commit af846afad5ca1c1a24d320adf9e48255e97db84e upstream.

In case of fatal signal, or early abort at least cleanup the current
test case.

Fixes: 25f16c873fb1 ("selftests: add openvswitch selftest suite")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/openvswitch/openvswitch.sh

index 7ce46700a3ae3ec608075f0dc537f53147e682f5..5e6686398a313f4a9c5f3804cf0912e1442cca21 100755 (executable)
@@ -3,6 +3,8 @@
 #
 # OVS kernel module self tests
 
+trap ovs_exit_sig EXIT TERM INT ERR
+
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4