xref: /linux/drivers/gpu/drm/ci/igt_runner.sh (revision 6efced27f5df9d7a57e4847fe2898cdd19f72311)
1#!/usr/bin/env bash
2# SPDX-License-Identifier: MIT
3
4. "${SCRIPTS_DIR}/setup-test-env.sh"
5
6set -ex
7
8export IGT_FORCE_DRIVER=${DRIVER_NAME}
9export PATH=$PATH:/igt/bin/
10export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib/aarch64-linux-gnu/:/igt/lib/x86_64-linux-gnu:/igt/lib:/igt/lib64
11
12# Uncomment the below to debug problems with driver probing
13: '
14ls -l /dev/dri/
15cat /sys/kernel/debug/devices_deferred
16cat /sys/kernel/debug/device_component/*
17'
18
19# Dump drm state to confirm that kernel was able to find a connected display:
20set +e
21cat /sys/kernel/debug/dri/*/state
22set -e
23
24mkdir -p /lib/modules
25case "$DRIVER_NAME" in
26    amdgpu|vkms|panthor)
27        # Cannot use HWCI_KERNEL_MODULES as at that point we don't have the module in /lib
28        mv /install/modules/lib/modules/* /lib/modules/. || true
29        modprobe --first-time $DRIVER_NAME
30        ;;
31esac
32
33if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt" ]; then
34    IGT_SKIPS="--skips /install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt"
35fi
36
37if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt" ]; then
38    IGT_FLAKES="--flakes /install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt"
39fi
40
41if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt" ]; then
42    IGT_FAILS="--baseline /install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt"
43fi
44
45if [ "`uname -m`" = "aarch64" ]; then
46    ARCH="arm64"
47elif [ "`uname -m`" = "armv7l" ]; then
48    ARCH="arm"
49else
50    ARCH="x86_64"
51fi
52
53curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s $PIPELINE_ARTIFACTS_BASE/$ARCH/igt.tar.gz | tar --zstd -v -x -C /
54
55TESTLIST="/igt/libexec/igt-gpu-tools/ci-testlist.txt"
56
57# If the job is parallel at the gitab job level, take the corresponding fraction
58# of the caselist.
59if [ -n "$CI_NODE_INDEX" ]; then
60    sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" $TESTLIST
61fi
62
63# core_getversion checks if the driver is loaded and probed correctly
64# so run it in all shards
65if ! grep -q "core_getversion" $TESTLIST; then
66    # Add the line to the file
67    echo "core_getversion" >> $TESTLIST
68fi
69
70set +e
71igt-runner \
72    run \
73    --igt-folder /igt/libexec/igt-gpu-tools \
74    --caselist $TESTLIST \
75    --output $RESULTS_DIR \
76    -vvvv \
77    $IGT_SKIPS \
78    $IGT_FLAKES \
79    $IGT_FAILS \
80    --jobs 1
81ret=$?
82set -e
83
84deqp-runner junit \
85   --testsuite IGT \
86   --results $RESULTS_DIR/failures.csv \
87   --output $RESULTS_DIR/junit.xml \
88   --limit 50 \
89   --template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
90
91# Check if /proc/lockdep_stats exists
92if [ -f /proc/lockdep_stats ]; then
93    # If debug_locks is 0, it indicates lockdep is detected and it turns itself off.
94    debug_locks=$(grep 'debug_locks:' /proc/lockdep_stats | awk '{print $2}')
95    if [ "$debug_locks" -eq 0 ] && [ "$ret" -eq 0 ]; then
96        echo "Warning: LOCKDEP issue detected. Please check dmesg logs for more information."
97        cat /proc/lockdep_stats
98        ret=101
99    fi
100fi
101
102cd $oldpath
103exit $ret
104