Skip to content

Commit f08ae0c

Browse files
oohalgregkh
authored andcommitted
selftests/powerpc: Fix eeh-basic.sh exit codes
[ Upstream commit 996f9e0 ] The kselftests test running infrastructure expects tests to finish with an exit code of 4 if the test decided it should be skipped. Currently eeh-basic.sh exits with the number of devices that failed to recover, so if four devices didn't recover we'll report a skip instead of a fail. Fix this by checking if the return code is non-zero and report success and failure by returning 0 or 1 respectively. For the cases where should actually skip return 4. Fixes: 85d86c8 ("selftests/powerpc: Add basic EEH selftest") Signed-off-by: Oliver O'Halloran <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 180cf2e commit f08ae0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/testing/selftests/powerpc/eeh/eeh-basic.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0-only
33

4+
KSELFTESTS_SKIP=4
5+
46
. ./eeh-functions.sh
57

68
if ! eeh_supported ; then
79
echo "EEH not supported on this system, skipping"
8-
exit 0;
10+
exit $KSELFTESTS_SKIP;
911
fi
1012

1113
if [ ! -e "/sys/kernel/debug/powerpc/eeh_dev_check" ] && \
1214
[ ! -e "/sys/kernel/debug/powerpc/eeh_dev_break" ] ; then
1315
echo "debugfs EEH testing files are missing. Is debugfs mounted?"
14-
exit 1;
16+
exit $KSELFTESTS_SKIP;
1517
fi
1618

1719
pre_lspci=`mktemp`
@@ -79,4 +81,5 @@ echo "$failed devices failed to recover ($dev_count tested)"
7981
lspci | diff -u $pre_lspci -
8082
rm -f $pre_lspci
8183

82-
exit $failed
84+
test "$failed" == 0
85+
exit $?

0 commit comments

Comments
 (0)