mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 01:46:14 +00:00
tests: add exit value constants for shell script tests
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
8a58734c11
commit
02cdd9899d
@ -3,4 +3,4 @@
|
||||
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
||||
. $SOURCE_DIR/drm_lib.sh
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -13,4 +13,4 @@ done
|
||||
|
||||
# If we got here, we haven't crashed
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -1,20 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
IGT_EXIT_TIMEOUT=78
|
||||
IGT_EXIT_SKIP=77
|
||||
IGT_EXIT_SUCCESS=0
|
||||
IGT_EXIT_INVALID=79
|
||||
IGT_EXIT_FAILURE=99
|
||||
|
||||
# hacked-up long option parsing
|
||||
for arg in $@ ; do
|
||||
case $arg in
|
||||
--list-subtests)
|
||||
exit 79
|
||||
exit $IGT_EXIT_INVALID
|
||||
;;
|
||||
--run-subtest)
|
||||
exit 79
|
||||
exit $IGT_EXIT_INVALID
|
||||
;;
|
||||
--debug)
|
||||
IGT_LOG_LEVEL=debug
|
||||
;;
|
||||
--help-description)
|
||||
echo $IGT_TEST_DESCRIPTION
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
;;
|
||||
--help)
|
||||
echo "Usage: `basename $0` [OPTIONS]"
|
||||
@ -23,18 +29,18 @@ for arg in $@ ; do
|
||||
echo " --debug"
|
||||
echo " --help-description"
|
||||
echo " --help"
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
die() {
|
||||
echo "$@"
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
}
|
||||
|
||||
do_or_die() {
|
||||
$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1)
|
||||
$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
|
||||
}
|
||||
|
||||
if [ -d /debug/dri ] ; then
|
||||
@ -63,7 +69,7 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
|
||||
die "ERROR: other drm clients running"
|
||||
fi
|
||||
|
||||
whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
|
||||
whoami | grep -q root || ( echo ERROR: not running as root; exit $IGT_EXIT_FAILURE )
|
||||
|
||||
i915_sfs_path=
|
||||
if [ -d /sys/class/drm ] ; then
|
||||
@ -76,7 +82,7 @@ fi
|
||||
|
||||
function drmtest_skip_on_simulation()
|
||||
{
|
||||
[ -n "$INTEL_SIMULATION" ] && exit 77
|
||||
[ -n "$INTEL_SIMULATION" ] && exit $IGT_EXIT_SKIP
|
||||
}
|
||||
|
||||
drmtest_skip_on_simulation
|
||||
|
@ -6,4 +6,4 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
||||
# read everything we can
|
||||
cat $i915_dfs_path/* > /dev/null 2>&1
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -19,20 +19,20 @@ function blt_wait {
|
||||
function check_for_missed_irq {
|
||||
if test `cat i915_ring_missed_irq` = 0x00000000; then
|
||||
echo "missed interrupts undetected"
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
}
|
||||
|
||||
function check_for_hang {
|
||||
if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then
|
||||
echo "gpu hang reported"
|
||||
exit 2
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -f i915_ring_missed_irq ] ; then
|
||||
echo "kernel doesn't support interrupt masking"
|
||||
exit 77
|
||||
exit $IGT_EXIT_SKIP
|
||||
fi
|
||||
|
||||
# clear error state first
|
||||
@ -43,7 +43,7 @@ echo 0xf > i915_ring_test_irq
|
||||
echo "Interrupts masked"
|
||||
if test `cat i915_ring_test_irq` != 0x0000000f; then
|
||||
echo "Failed to set interrupt mask"
|
||||
exit 3
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
blt_wait
|
||||
@ -57,7 +57,7 @@ echo 0 > i915_ring_test_irq
|
||||
echo "Interrupts unmasked"
|
||||
if test `cat i915_ring_test_irq` != 0x00000000; then
|
||||
echo "Failed to clear interrupt mask"
|
||||
exit 3
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
blt_wait
|
||||
@ -67,7 +67,7 @@ echo 0 > i915_ring_missed_irq
|
||||
echo "Cleared missed interrupts"
|
||||
if test `cat i915_ring_missed_irq` != 0x00000000; then
|
||||
echo "Failed to clear missed interrupts"
|
||||
exit 3
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -33,7 +33,7 @@ rmmod drm &> /dev/null
|
||||
|
||||
if lsmod | grep i915 &> /dev/null ; then
|
||||
echo WARNING: i915.ko still loaded!
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
else
|
||||
echo module successfully unloaded
|
||||
fi
|
||||
@ -48,13 +48,13 @@ if $SOURCE_DIR/gem_alive > /dev/null ; then
|
||||
echo "module successfully loaded again"
|
||||
else
|
||||
echo "failed to reload module successfully"
|
||||
exit 2
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
# then try to run something
|
||||
if ! $SOURCE_DIR/gem_linear_blits --run-subtest basic > /dev/null ; then
|
||||
echo "failed to execute a simple batch after reload"
|
||||
exit 3
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -19,7 +19,7 @@ RES=$(((TIME2 - TIME1) / 1000000))
|
||||
|
||||
if [ $RES -gt 600 ]; then
|
||||
echo "Talking to outputs took ${RES}ms, something is wrong"
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -5,7 +5,7 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
||||
|
||||
if ! find /sys/class/drm/card*/ | grep l3_parity > /dev/null ; then
|
||||
echo "no l3_parity interface, skipping test"
|
||||
exit 77
|
||||
exit $IGT_EXIT_SKIP
|
||||
fi
|
||||
|
||||
$SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e
|
||||
@ -15,7 +15,7 @@ $SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -d
|
||||
disabled=`$SOURCE_DIR/../tools/intel_l3_parity -l | grep -c 'Row 0, Bank 0, Subbank 0 is disabled'`
|
||||
if [ "$disabled" != "1" ] ; then
|
||||
echo "Fail"
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
||||
$SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e
|
||||
@ -23,5 +23,5 @@ $SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e
|
||||
#Check that we can clear remaps
|
||||
if [ `$SOURCE_DIR/../tools/intel_l3_parity -l | wc -l` != 1 ] ; then
|
||||
echo "Fail 2"
|
||||
exit 1
|
||||
exit $IGT_EXIT_FAILURE
|
||||
fi
|
||||
|
@ -3,4 +3,4 @@
|
||||
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
||||
. $SOURCE_DIR/drm_lib.sh
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
@ -12,5 +12,5 @@ do_or_die "intel_reg_dumper"
|
||||
|
||||
# TODO: Add more tests
|
||||
|
||||
exit 0
|
||||
exit $IGT_EXIT_SUCCESS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user