ci: enable shellcheck on whole .gitlab-ci

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21977>
This commit is contained in:
David Heidelberg 2023-05-21 00:47:05 +02:00
parent a99b952a5d
commit 5941fc8ccd
44 changed files with 187 additions and 171 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
if [ -z "$BM_POE_INTERFACE" ]; then if [ -z "$BM_POE_INTERFACE" ]; then
echo "Must supply the PoE Interface to power down" echo "Must supply the PoE Interface to power down"
@ -11,7 +12,6 @@ if [ -z "$BM_POE_ADDRESS" ]; then
fi fi
SNMP_KEY="1.3.6.1.4.1.9.9.402.1.2.1.1.1.$BM_POE_INTERFACE" SNMP_KEY="1.3.6.1.4.1.9.9.402.1.2.1.1.1.$BM_POE_INTERFACE"
SNMP_ON="i 1"
SNMP_OFF="i 4" SNMP_OFF="i 4"
snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF snmpset -v2c -r 3 -t 30 -cmesaci "$BM_POE_ADDRESS" "$SNMP_KEY" $SNMP_OFF

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
if [ -z "$BM_POE_INTERFACE" ]; then if [ -z "$BM_POE_INTERFACE" ]; then
echo "Must supply the PoE Interface to power up" echo "Must supply the PoE Interface to power up"
@ -16,6 +17,6 @@ SNMP_KEY="1.3.6.1.4.1.9.9.402.1.2.1.1.1.$BM_POE_INTERFACE"
SNMP_ON="i 1" SNMP_ON="i 1"
SNMP_OFF="i 4" SNMP_OFF="i 4"
snmpset -v2c -r 3 -t 10 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF snmpset -v2c -r 3 -t 10 -cmesaci "$BM_POE_ADDRESS" "$SNMP_KEY" $SNMP_OFF
sleep 3s sleep 3s
snmpset -v2c -r 3 -t 10 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_ON snmpset -v2c -r 3 -t 10 -cmesaci "$BM_POE_ADDRESS" "$SNMP_KEY" $SNMP_ON

View file

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
# shellcheck disable=SC2034
# shellcheck disable=SC2086 # we want word splitting
# Boot script for Chrome OS devices attached to a servo debug connector, using # Boot script for Chrome OS devices attached to a servo debug connector, using
# NFS and TFTP to boot. # NFS and TFTP to boot.

View file

@ -7,4 +7,4 @@ if [ -z "$relay" ]; then
exit 1 exit 1
fi fi
$CI_PROJECT_DIR/install/bare-metal/eth008-power-relay.py $ETH_HOST $ETH_PORT off $relay "$CI_PROJECT_DIR"/install/bare-metal/eth008-power-relay.py "$ETH_HOST" "$ETH_PORT" off "$relay"

View file

@ -7,6 +7,6 @@ if [ -z "$relay" ]; then
exit 1 exit 1
fi fi
$CI_PROJECT_DIR/install/bare-metal/eth008-power-relay.py $ETH_HOST $ETH_PORT off $relay "$CI_PROJECT_DIR"/install/bare-metal/eth008-power-relay.py "$ETH_HOST" "$ETH_PORT" off "$relay"
sleep 5 sleep 5
$CI_PROJECT_DIR/install/bare-metal/eth008-power-relay.py $ETH_HOST $ETH_PORT on $relay "$CI_PROJECT_DIR"/install/bare-metal/eth008-power-relay.py "$ETH_HOST" "$ETH_PORT" on "$relay"

View file

@ -5,26 +5,27 @@ set -e
STRINGS=$(mktemp) STRINGS=$(mktemp)
ERRORS=$(mktemp) ERRORS=$(mktemp)
trap "rm $STRINGS; rm $ERRORS;" EXIT trap 'rm $STRINGS; rm $ERRORS;' EXIT
FILE=$1 FILE=$1
shift 1 shift 1
while getopts "f:e:" opt; do while getopts "f:e:" opt; do
case $opt in case $opt in
f) echo "$OPTARG" >> $STRINGS;; f) echo "$OPTARG" >> "$STRINGS";;
e) echo "$OPTARG" >> $STRINGS ; echo "$OPTARG" >> $ERRORS;; e) echo "$OPTARG" >> "$STRINGS" ; echo "$OPTARG" >> "$ERRORS";;
*) exit
esac esac
done done
shift $((OPTIND -1)) shift $((OPTIND -1))
echo "Waiting for $FILE to say one of following strings" echo "Waiting for $FILE to say one of following strings"
cat $STRINGS cat "$STRINGS"
while ! egrep -wf $STRINGS $FILE; do while ! grep -E -wf "$STRINGS" "$FILE"; do
sleep 2 sleep 2
done done
if egrep -wf $ERRORS $FILE; then if grep -E -wf "$ERRORS" "$FILE"; then
exit 1 exit 1
fi fi

View file

@ -1,11 +1,14 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
# shellcheck disable=SC2034
# shellcheck disable=SC2086 # we want word splitting
. "$SCRIPTS_DIR"/setup-test-env.sh . "$SCRIPTS_DIR"/setup-test-env.sh
BM=$CI_PROJECT_DIR/install/bare-metal BM=$CI_PROJECT_DIR/install/bare-metal
CI_COMMON=$CI_PROJECT_DIR/install/common CI_COMMON=$CI_PROJECT_DIR/install/common
if [ -z "$BM_SERIAL" -a -z "$BM_SERIAL_SCRIPT" ]; then if [ -z "$BM_SERIAL" ] && [ -z "$BM_SERIAL_SCRIPT" ]; then
echo "Must set BM_SERIAL OR BM_SERIAL_SCRIPT in your gitlab-runner config.toml [[runners]] environment" echo "Must set BM_SERIAL OR BM_SERIAL_SCRIPT in your gitlab-runner config.toml [[runners]] environment"
echo "BM_SERIAL:" echo "BM_SERIAL:"
echo " This is the serial device to talk to for waiting for fastboot to be ready and logging from the kernel." echo " This is the serial device to talk to for waiting for fastboot to be ready and logging from the kernel."
@ -84,10 +87,10 @@ else
fi fi
pushd rootfs pushd rootfs
find -H | \ find -H . | \
egrep -v "external/(openglcts|vulkancts|amber|glslang|spirv-tools)" | grep -E -v "external/(openglcts|vulkancts|amber|glslang|spirv-tools)" |
egrep -v "traces-db|apitrace|renderdoc" | \ grep -E -v "traces-db|apitrace|renderdoc" | \
egrep -v $EXCLUDE_FILTER | \ grep -E -v $EXCLUDE_FILTER | \
cpio -H newc -o | \ cpio -H newc -o | \
xz --check=crc32 -T4 - > $CI_PROJECT_DIR/rootfs.cpio.gz xz --check=crc32 -T4 - > $CI_PROJECT_DIR/rootfs.cpio.gz
popd popd

View file

@ -7,4 +7,4 @@ if [ -z "$relay" ]; then
exit 1 exit 1
fi fi
$CI_PROJECT_DIR/install/bare-metal/google-power-relay.py off $relay "$CI_PROJECT_DIR"/install/bare-metal/google-power-relay.py off "$relay"

View file

@ -7,6 +7,6 @@ if [ -z "$relay" ]; then
exit 1 exit 1
fi fi
$CI_PROJECT_DIR/install/bare-metal/google-power-relay.py off $relay "$CI_PROJECT_DIR"/install/bare-metal/google-power-relay.py off "$relay"
sleep 5 sleep 5
$CI_PROJECT_DIR/install/bare-metal/google-power-relay.py on $relay "$CI_PROJECT_DIR"/install/bare-metal/google-power-relay.py on "$relay"

View file

@ -10,8 +10,7 @@ if [ -z "$BM_POE_ADDRESS" ]; then
exit 1 exit 1
fi fi
SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.`expr 48 + $BM_POE_INTERFACE`" SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.$((48 + BM_POE_INTERFACE))"
SNMP_ON="i 1"
SNMP_OFF="i 2" SNMP_OFF="i 2"
flock /var/run/poe.lock -c "snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF" flock /var/run/poe.lock -c "snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF"

View file

@ -10,7 +10,7 @@ if [ -z "$BM_POE_ADDRESS" ]; then
exit 1 exit 1
fi fi
SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.`expr 48 + $BM_POE_INTERFACE`" SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.$((48 + BM_POE_INTERFACE))"
SNMP_ON="i 1" SNMP_ON="i 1"
SNMP_OFF="i 2" SNMP_OFF="i 2"

View file

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC1091
# shellcheck disable=SC2034
# shellcheck disable=SC2059
# shellcheck disable=SC2086 # we want word splitting
. "$SCRIPTS_DIR"/setup-test-env.sh . "$SCRIPTS_DIR"/setup-test-env.sh

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
rootfs_dst=$1 rootfs_dst=$1

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# shellcheck disable=SC1091
set -e set -e

View file

@ -1,3 +1,5 @@
# shellcheck disable=SC1091
# shellcheck disable=SC2086 # we want word splitting
if command -V ccache >/dev/null 2>/dev/null; then if command -V ccache >/dev/null 2>/dev/null; then
CCACHE=ccache CCACHE=ccache
else else

View file

@ -1,7 +1,10 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2035
# shellcheck disable=SC2061
# shellcheck disable=SC2086 # we want word splitting
while true; do while true; do
devcds=`find /sys/devices/virtual/devcoredump/ -name data 2>/dev/null` devcds=$(find /sys/devices/virtual/devcoredump/ -name data 2>/dev/null)
for i in $devcds; do for i in $devcds; do
echo "Found a devcoredump at $i." echo "Found a devcoredump at $i."
if cp $i /results/first.devcore; then if cp $i /results/first.devcore; then

View file

@ -22,4 +22,4 @@ echo "nameserver 8.8.8.8" > /etc/resolv.conf
# Set the time so we can validate certificates before we fetch anything; # Set the time so we can validate certificates before we fetch anything;
# however as not all DUTs have network, make this non-fatal. # however as not all DUTs have network, make this non-fatal.
for i in 1 2 3; do sntp -sS pool.ntp.org && break || sleep 2; done || true for _ in 1 2 3; do sntp -sS pool.ntp.org && break || sleep 2; done || true

View file

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC1090
# shellcheck disable=SC1091
# shellcheck disable=SC2086 # we want word splitting
# shellcheck disable=SC2155
# Second-stage init, used to set up devices and our job environment before # Second-stage init, used to set up devices and our job environment before
# running tests. # running tests.
@ -67,12 +71,12 @@ fi
# #
if [ "$HWCI_KVM" = "true" ]; then if [ "$HWCI_KVM" = "true" ]; then
unset KVM_KERNEL_MODULE unset KVM_KERNEL_MODULE
grep -qs '\bvmx\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_intel || { (grep -qs '\bvmx\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_intel) || {
grep -qs '\bsvm\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_amd grep -qs '\bsvm\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_amd
} }
[ -z "${KVM_KERNEL_MODULE}" ] && \ ([ -z "${KVM_KERNEL_MODULE}" ] && \
echo "WARNING: Failed to detect CPU virtualization extensions" || \ echo "WARNING: Failed to detect CPU virtualization extensions") || \
modprobe ${KVM_KERNEL_MODULE} modprobe ${KVM_KERNEL_MODULE}
mkdir -p /lava-files mkdir -p /lava-files
@ -103,14 +107,14 @@ if [ "$HWCI_FREQ_MAX" = "true" ]; then
head -0 /dev/dri/renderD128 head -0 /dev/dri/renderD128
# Disable GPU frequency scaling # Disable GPU frequency scaling
DEVFREQ_GOVERNOR=`find /sys/devices -name governor | grep gpu || true` DEVFREQ_GOVERNOR=$(find /sys/devices -name governor | grep gpu || true)
test -z "$DEVFREQ_GOVERNOR" || echo performance > $DEVFREQ_GOVERNOR || true test -z "$DEVFREQ_GOVERNOR" || echo performance > $DEVFREQ_GOVERNOR || true
# Disable CPU frequency scaling # Disable CPU frequency scaling
echo performance | tee -a /sys/devices/system/cpu/cpufreq/policy*/scaling_governor || true echo performance | tee -a /sys/devices/system/cpu/cpufreq/policy*/scaling_governor || true
# Disable GPU runtime power management # Disable GPU runtime power management
GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1` GPU_AUTOSUSPEND=$(find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1)
test -z "$GPU_AUTOSUSPEND" || echo -1 > $GPU_AUTOSUSPEND || true test -z "$GPU_AUTOSUSPEND" || echo -1 > $GPU_AUTOSUSPEND || true
# Lock Intel GPU frequency to 70% of the maximum allowed by hardware # Lock Intel GPU frequency to 70% of the maximum allowed by hardware
# and enable throttling detection & reporting. # and enable throttling detection & reporting.
@ -139,12 +143,12 @@ fi
if [ -n "$HWCI_START_XORG" ]; then if [ -n "$HWCI_START_XORG" ]; then
echo "touch /xorg-started; sleep 100000" > /xorg-script echo "touch /xorg-started; sleep 100000" > /xorg-script
env \ env \
VK_ICD_FILENAMES=/install/share/vulkan/icd.d/${VK_DRIVER}_icd.`uname -m`.json \ VK_ICD_FILENAMES="/install/share/vulkan/icd.d/${VK_DRIVER}_icd.$(uname -m).json" \
xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log & xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS" BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
# Wait for xorg to be ready for connections. # Wait for xorg to be ready for connections.
for i in 1 2 3 4 5; do for _ in 1 2 3 4 5; do
if [ -e /xorg-started ]; then if [ -e /xorg-started ]; then
break break
fi fi

View file

@ -1,4 +1,14 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2013
# shellcheck disable=SC2015
# shellcheck disable=SC2034
# shellcheck disable=SC2046
# shellcheck disable=SC2059
# shellcheck disable=SC2086 # we want word splitting
# shellcheck disable=SC2154
# shellcheck disable=SC2155
# shellcheck disable=SC2162
# shellcheck disable=SC2229
# #
# This is an utility script to manage Intel GPU frequencies. # This is an utility script to manage Intel GPU frequencies.
# It can be used for debugging performance problems or trying to obtain a stable # It can be used for debugging performance problems or trying to obtain a stable
@ -193,7 +203,7 @@ compute_freq_set() {
val=${FREQ_RPn} val=${FREQ_RPn}
;; ;;
*%) *%)
val=$((${1%?} * ${FREQ_RP0} / 100)) val=$((${1%?} * FREQ_RP0 / 100))
# Adjust freq to comply with 50 MHz increments # Adjust freq to comply with 50 MHz increments
val=$((val / 50 * 50)) val=$((val / 50 * 50))
;; ;;
@ -242,12 +252,12 @@ set_freq_max() {
[ -z "${DRY_RUN}" ] || return 0 [ -z "${DRY_RUN}" ] || return 0
printf "%s" ${SET_MAX_FREQ} | tee $(print_freq_sysfs_path max) \ if ! printf "%s" ${SET_MAX_FREQ} | tee $(print_freq_sysfs_path max) \
$(print_freq_sysfs_path boost) > /dev/null $(print_freq_sysfs_path boost) > /dev/null;
[ $? -eq 0 ] || { then
log ERROR "Failed to set GPU max frequency" log ERROR "Failed to set GPU max frequency"
return 1 return 1
} fi
} }
# #
@ -272,11 +282,11 @@ set_freq_min() {
[ -z "${DRY_RUN}" ] || return 0 [ -z "${DRY_RUN}" ] || return 0
printf "%s" ${SET_MIN_FREQ} > $(print_freq_sysfs_path min) if ! printf "%s" ${SET_MIN_FREQ} > $(print_freq_sysfs_path min);
[ $? -eq 0 ] || { then
log ERROR "Failed to set GPU min frequency" log ERROR "Failed to set GPU min frequency"
return 1 return 1
} fi
} }
# #
@ -495,7 +505,7 @@ compute_cpu_freq_set() {
val=${CPU_FREQ_cpuinfo_min} val=${CPU_FREQ_cpuinfo_min}
;; ;;
*%) *%)
val=$((${1%?} * ${CPU_FREQ_cpuinfo_max} / 100)) val=$((${1%?} * CPU_FREQ_cpuinfo_max / 100))
;; ;;
*[!0-9]*) *[!0-9]*)
log ERROR "Cannot set CPU freq to invalid value: %s" "$1" log ERROR "Cannot set CPU freq to invalid value: %s" "$1"
@ -538,11 +548,11 @@ set_cpu_freq_max() {
local pstate_info=$(printf "${CPU_PSTATE_SYSFS_PATTERN}" max_perf_pct) local pstate_info=$(printf "${CPU_PSTATE_SYSFS_PATTERN}" max_perf_pct)
[ -e "${pstate_info}" ] && { [ -e "${pstate_info}" ] && {
log INFO "Setting intel_pstate max perf to %s" "${target_freq}%" log INFO "Setting intel_pstate max perf to %s" "${target_freq}%"
printf "%s" "${target_freq}" > "${pstate_info}" if ! printf "%s" "${target_freq}" > "${pstate_info}";
[ $? -eq 0 ] || { then
log ERROR "Failed to set intel_pstate max perf" log ERROR "Failed to set intel_pstate max perf"
res=1 res=1
} fi
} }
local cpu_index local cpu_index
@ -555,11 +565,11 @@ set_cpu_freq_max() {
log INFO "Setting CPU%s max scaling freq to %s Hz" ${cpu_index} "${target_freq}" log INFO "Setting CPU%s max scaling freq to %s Hz" ${cpu_index} "${target_freq}"
[ -n "${DRY_RUN}" ] && continue [ -n "${DRY_RUN}" ] && continue
printf "%s" ${target_freq} > $(print_cpu_freq_sysfs_path scaling_max ${cpu_index}) if ! printf "%s" ${target_freq} > $(print_cpu_freq_sysfs_path scaling_max ${cpu_index});
[ $? -eq 0 ] || { then
res=1 res=1
log ERROR "Failed to set CPU%s max scaling frequency" ${cpu_index} log ERROR "Failed to set CPU%s max scaling frequency" ${cpu_index}
} fi
done done
return ${res} return ${res}

View file

@ -13,7 +13,7 @@ fi
xinit /bin/sh "${_XORG_SCRIPT}" -- /usr/bin/Xorg vt45 -noreset -s 0 -dpms -logfile /Xorg.0.log & xinit /bin/sh "${_XORG_SCRIPT}" -- /usr/bin/Xorg vt45 -noreset -s 0 -dpms -logfile /Xorg.0.log &
# Wait for xorg to be ready for connections. # Wait for xorg to be ready for connections.
for i in 1 2 3 4 5; do for _ in 1 2 3 4 5; do
if [ -e "${_FLAG_FILE}" ]; then if [ -e "${_FLAG_FILE}" ]; then
break break
fi fi

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
# shellcheck disable=SC2086 # we want word splitting
set -e set -e
VSOCK_STDOUT=$1 VSOCK_STDOUT=$1

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
set -e set -e
# If run outside of a deqp-runner invoction (e.g. piglit trace replay), then act # If run outside of a deqp-runner invoction (e.g. piglit trace replay), then act
@ -35,7 +35,7 @@ set_vsock_context() {
rm -rf $VM_TEMP_DIR rm -rf $VM_TEMP_DIR
mkdir $VM_TEMP_DIR || return 1 mkdir $VM_TEMP_DIR || return 1
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((${THREAD} & 0x7f) << 25))) VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((THREAD & 0x7f) << 25)))
VSOCK_STDOUT=5001 VSOCK_STDOUT=5001
VSOCK_STDERR=5002 VSOCK_STDERR=5002
@ -66,7 +66,7 @@ set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
echo "Variables passed through:" echo "Variables passed through:"
SCRIPT_DIR=$(readlink -en "${0%/*}") SCRIPT_DIR=$(readlink -en "${0%/*}")
${SCRIPT_DIR}/common/generate-env.sh | tee ${VM_TEMP_DIR}/crosvm-env.sh ${SCRIPT_DIR}/common/generate-env.sh | tee ${VM_TEMP_DIR}/crosvm-env.sh
cp ${SCRIPTS_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh cp ${SCRIPT_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh
# Set the crosvm-script as the arguments of the current script # Set the crosvm-script as the arguments of the current script
echo ". ${VM_TEMP_DIR}/setup-test-env.sh" > ${VM_TEMP_DIR}/crosvm-script.sh echo ". ${VM_TEMP_DIR}/setup-test-env.sh" > ${VM_TEMP_DIR}/crosvm-script.sh

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
section_start cuttlefish_setup "cuttlefish: setup" section_start cuttlefish_setup "cuttlefish: setup"
set -xe set -xe
@ -26,6 +28,7 @@ ADB="adb -s vsock:3:5555"
$ADB root $ADB root
sleep 1 sleep 1
$ADB shell echo Hi from Android $ADB shell echo Hi from Android
# shellcheck disable=SC2035
$ADB logcat dEQP:D *:S & $ADB logcat dEQP:D *:S &
# overlay vendor # overlay vendor
@ -97,7 +100,7 @@ $ADB shell "mkdir /data/results; cd /data; strace -o /data/results/out.strace -f
--flakes /data/$GPU_VERSION-flakes.txt \ --flakes /data/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \ --testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \ --fraction-start $CI_NODE_INDEX \
--fraction `expr $CI_NODE_TOTAL \* ${DEQP_FRACTION:-1}` \ --fraction $(( CI_NODE_TOTAL * ${DEQP_FRACTION:-1})) \
--jobs ${FDO_CI_CONCURRENT:-4} \ --jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS" $DEQP_RUNNER_OPTIONS"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
section_start test_setup "deqp: preparing test setup" section_start test_setup "deqp: preparing test setup"
@ -32,8 +33,6 @@ findmnt -n tmpfs ${SHADER_CACHE_HOME} || findmnt -n tmpfs ${SHADER_CACHE_DIR} ||
mount -t tmpfs -o nosuid,nodev,size=2G,mode=1755 tmpfs ${SHADER_CACHE_DIR} mount -t tmpfs -o nosuid,nodev,size=2G,mode=1755 tmpfs ${SHADER_CACHE_DIR}
} }
HANG_DETECTION_CMD=""
if [ -z "$DEQP_SUITE" ]; then if [ -z "$DEQP_SUITE" ]; then
if [ -z "$DEQP_VER" ]; then if [ -z "$DEQP_VER" ]; then
echo 'DEQP_SUITE must be set to the name of your deqp-gpu_version.toml, or DEQP_VER must be set to something like "gles2", "gles31-khr" or "vk" for the test run' echo 'DEQP_SUITE must be set to the name of your deqp-gpu_version.toml, or DEQP_VER must be set to something like "gles2", "gles31-khr" or "vk" for the test run'
@ -50,7 +49,7 @@ if [ -z "$DEQP_SUITE" ]; then
DEQP_OPTIONS="$DEQP_OPTIONS --deqp-gl-config-name=$DEQP_CONFIG" DEQP_OPTIONS="$DEQP_OPTIONS --deqp-gl-config-name=$DEQP_CONFIG"
DEQP_OPTIONS="$DEQP_OPTIONS --deqp-visibility=hidden" DEQP_OPTIONS="$DEQP_OPTIONS --deqp-visibility=hidden"
if [ "$DEQP_VER" = "vk" -a -z "$VK_DRIVER" ]; then if [ "$DEQP_VER" = "vk" ] && [ -z "$VK_DRIVER" ]; then
echo 'VK_DRIVER must be to something like "radeon" or "intel" for the test run' echo 'VK_DRIVER must be to something like "radeon" or "intel" for the test run'
exit 1 exit 1
fi fi
@ -59,11 +58,10 @@ if [ -z "$DEQP_SUITE" ]; then
if [ "$DEQP_VER" = "vk" ]; then if [ "$DEQP_VER" = "vk" ]; then
MUSTPASS=/deqp/mustpass/vk-$DEQP_VARIANT.txt MUSTPASS=/deqp/mustpass/vk-$DEQP_VARIANT.txt
DEQP=/deqp/external/vulkancts/modules/vulkan/deqp-vk DEQP=/deqp/external/vulkancts/modules/vulkan/deqp-vk
HANG_DETECTION_CMD="/parallel-deqp-runner/build/bin/hang-detection" elif [ "$DEQP_VER" = "gles2" ] || [ "$DEQP_VER" = "gles3" ] || [ "$DEQP_VER" = "gles31" ] || [ "$DEQP_VER" = "egl" ]; then
elif [ "$DEQP_VER" = "gles2" -o "$DEQP_VER" = "gles3" -o "$DEQP_VER" = "gles31" -o "$DEQP_VER" = "egl" ]; then
MUSTPASS=/deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt MUSTPASS=/deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt
DEQP=/deqp/modules/$DEQP_VER/deqp-$DEQP_VER DEQP=/deqp/modules/$DEQP_VER/deqp-$DEQP_VER
elif [ "$DEQP_VER" = "gles2-khr" -o "$DEQP_VER" = "gles3-khr" -o "$DEQP_VER" = "gles31-khr" -o "$DEQP_VER" = "gles32-khr" ]; then elif [ "$DEQP_VER" = "gles2-khr" ] || [ "$DEQP_VER" = "gles3-khr" ] || [ "$DEQP_VER" = "gles31-khr" ] || [ "$DEQP_VER" = "gles32-khr" ]; then
MUSTPASS=/deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt MUSTPASS=/deqp/mustpass/$DEQP_VER-$DEQP_VARIANT.txt
DEQP=/deqp/external/openglcts/modules/glcts DEQP=/deqp/external/openglcts/modules/glcts
else else
@ -129,7 +127,7 @@ export VK_LAYER_SETTINGS_PATH=$INSTALL/$GPU_VERSION-validation-settings.txt
report_load() { report_load() {
echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)" echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)"
echo "# of CPU cores: $(cat /proc/cpuinfo | grep processor | wc -l)" echo "# of CPU cores: $(grep -c processor /proc/cpuinfo)"
} }
if [ "$GALLIUM_DRIVER" = "virpipe" ]; then if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
@ -149,10 +147,11 @@ fi
if [ -z "$DEQP_SUITE" ]; then if [ -z "$DEQP_SUITE" ]; then
if [ -n "$DEQP_EXPECTED_RENDERER" ]; then if [ -n "$DEQP_EXPECTED_RENDERER" ]; then
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --renderer-check "$DEQP_EXPECTED_RENDERER"" export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --renderer-check $DEQP_EXPECTED_RENDERER"
fi fi
if [ $DEQP_VER != vk -a $DEQP_VER != egl ]; then if [ $DEQP_VER != vk ] && [ $DEQP_VER != egl ]; then
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --version-check `cat $INSTALL/VERSION | sed 's/[() ]/./g'`" VER=$(sed 's/[() ]/./g' "$INSTALL/VERSION")
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --version-check $VER"
fi fi
fi fi
@ -181,7 +180,7 @@ else
--flakes $INSTALL/$GPU_VERSION-flakes.txt \ --flakes $INSTALL/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \ --testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \ --fraction-start $CI_NODE_INDEX \
--fraction `expr $CI_NODE_TOTAL \* ${DEQP_FRACTION:-1}` \ --fraction $((CI_NODE_TOTAL * ${DEQP_FRACTION:-1})) \
--jobs ${FDO_CI_CONCURRENT:-4} \ --jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS $DEQP_RUNNER_OPTIONS
fi fi

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set +e set +e
set -o xtrace set -o xtrace
@ -16,12 +16,9 @@ fi
TMP_DIR=$(mktemp -d) TMP_DIR=$(mktemp -d)
echo "Downloading archived master..." echo "Downloading archived master..."
/usr/bin/wget \ if ! /usr/bin/wget \
-O "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" \ -O "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" \
"https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz" "https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz";
# check wget error code
if [[ $? -ne 0 ]]
then then
echo "Repository cache not available" echo "Repository cache not available"
exit exit

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
set -ex set -ex
@ -7,15 +7,15 @@ if [ -z "$VK_DRIVER" ]; then
exit 1 exit 1
fi fi
INSTALL=`pwd`/install INSTALL=$PWD/install
# Set up the driver environment. # Set up the driver environment.
export LD_LIBRARY_PATH=`pwd`/install/lib/ export LD_LIBRARY_PATH="$INSTALL/lib/"
export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.x86_64.json export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
export LD_PRELOAD=`pwd`/install/lib/libamdgpu_noop_drm_shim.so export LD_PRELOAD="$INSTALL/lib/libamdgpu_noop_drm_shim.so"
# To store Fossilize logs on failure. # To store Fossilize logs on failure.
RESULTS=`pwd`/results RESULTS="$PWD/results"
mkdir -p results mkdir -p results
"$INSTALL/fossils/fossils.sh" "$INSTALL/fossils.yml" "$RESULTS" "$INSTALL/fossils/fossils.sh" "$INSTALL/fossils.yml" "$RESULTS"

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# shellcheck disable=SC2155
FOSSILS_SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" FOSSILS_SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
FOSSILS_YAML="$(readlink -f "$1")" FOSSILS_YAML="$(readlink -f "$1")"
@ -10,7 +12,7 @@ clone_fossils_db()
local commit="$2" local commit="$2"
rm -rf fossils-db rm -rf fossils-db
git clone --no-checkout "$repo" fossils-db git clone --no-checkout "$repo" fossils-db
(cd fossils-db; git reset "$commit" || git reset "origin/$commit") (cd fossils-db || return; git reset "$commit" || git reset "origin/$commit")
} }
query_fossils_yaml() query_fossils_yaml()
@ -51,7 +53,7 @@ fetch_fossil()
if [[ -n "$(query_fossils_yaml fossils_db_repo)" ]]; then if [[ -n "$(query_fossils_yaml fossils_db_repo)" ]]; then
clone_fossils_db "$(query_fossils_yaml fossils_db_repo)" \ clone_fossils_db "$(query_fossils_yaml fossils_db_repo)" \
"$(query_fossils_yaml fossils_db_commit)" "$(query_fossils_yaml fossils_db_commit)"
cd fossils-db cd fossils-db || return
else else
echo "Warning: No fossils-db entry in $FOSSILS_YAML, assuming fossils-db is current directory" echo "Warning: No fossils-db entry in $FOSSILS_YAML, assuming fossils-db is current directory"
fi fi
@ -65,8 +67,8 @@ create_clean_git
for fossil in $(query_fossils_yaml fossils) for fossil in $(query_fossils_yaml fossils)
do do
fetch_fossil "$fossil" || exit $? fetch_fossil "$fossil" || exit $?
fossilize-replay --num-threads 4 $fossil 1>&2 2> $FOSSILS_RESULTS/fossil_replay.txt if ! fossilize-replay --num-threads 4 $fossil 1>&2 2> $FOSSILS_RESULTS/fossil_replay.txt;
if [ $? != 0 ]; then then
echo "Replay of $fossil failed" echo "Replay of $fossil failed"
grep "pipeline crashed or hung" $FOSSILS_RESULTS/fossil_replay.txt grep "pipeline crashed or hung" $FOSSILS_RESULTS/fossil_replay.txt
exit 1 exit 1

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
set -ex set -ex

View file

@ -1,35 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# # SPDX-License-Identifier: MIT
# Copyright (C) 2022 Collabora Limited # © Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com> # Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This script runs unit/integration tests related with LAVA CI tools # This script runs unit/integration tests related with LAVA CI tools
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
set -ex set -ex
# Use this script in a python virtualenv for isolation # Use this script in a python virtualenv for isolation
python3 -m venv .venv python3 -m venv .venv
. .venv/bin/activate . .venv/bin/activate
python3 -m pip install --break-system-packages -r ${CI_PROJECT_DIR}/.gitlab-ci/lava/requirements-test.txt python3 -m pip install --break-system-packages -r "${CI_PROJECT_DIR}/.gitlab-ci/lava/requirements-test.txt"
TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
set -e set -ex
set -x
# If we run in the fork (not from mesa or Marge-bot), reuse mainline kernel and rootfs, if exist. # If we run in the fork (not from mesa or Marge-bot), reuse mainline kernel and rootfs, if exist.
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}" BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}"

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC1003 # works for us now...
# shellcheck disable=SC2086 # we want word splitting
section_switch meson-configure "meson: configure" section_switch meson-configure "meson: configure"
@ -19,9 +21,9 @@ printf > native.file "%s\n" \
# tweak the cross file or generate a native file to do so. # tweak the cross file or generate a native file to do so.
if test -n "$LLVM_VERSION"; then if test -n "$LLVM_VERSION"; then
LLVM_CONFIG="llvm-config-${LLVM_VERSION}" LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
echo "llvm-config = '`which $LLVM_CONFIG`'" >> native.file echo "llvm-config = '$(which "$LLVM_CONFIG")'" >> native.file
if [ -n "$CROSS" ]; then if [ -n "$CROSS" ]; then
sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE sed -i -e '/\[binaries\]/a\' -e "llvm-config = '$(which "$LLVM_CONFIG")'" $CROSS_FILE
fi fi
$LLVM_CONFIG --version $LLVM_CONFIG --version
fi fi
@ -71,7 +73,7 @@ meson setup _build \
--wrap-mode=nofallback \ --wrap-mode=nofallback \
--force-fallback-for perfetto \ --force-fallback-for perfetto \
${CROSS+--cross "$CROSS_FILE"} \ ${CROSS+--cross "$CROSS_FILE"} \
-D prefix=`pwd`/install \ -D prefix=$PWD/install \
-D libdir=lib \ -D libdir=lib \
-D buildtype=${BUILDTYPE:-debug} \ -D buildtype=${BUILDTYPE:-debug} \
-D build-tests=true \ -D build-tests=true \
@ -101,7 +103,7 @@ fi
uncollapsed_section_switch meson-test "meson: test" uncollapsed_section_switch meson-test "meson: test"
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} --print-errorlogs ${MESON_TEST_ARGS} LC_ALL=C.UTF-8 meson test --num-processes "${FDO_CI_CONCURRENT:-4}" --print-errorlogs ${MESON_TEST_ARGS}
if command -V mold &> /dev/null ; then if command -V mold &> /dev/null ; then
mold --run ninja install mold --run ninja install
else else

View file

@ -1,7 +1,8 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
if [ "x$STRACEDIR" = "x" ]; then if [[ -z "$STRACEDIR" ]]; then
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done).$$ STRACEDIR=meson-logs/strace/$(for i in "$@"; do basename -z -- $i; echo -n _; done).$$
fi fi
mkdir -p $STRACEDIR mkdir -p $STRACEDIR

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
set -ex set -ex
@ -7,14 +8,14 @@ if [ -z "$GPU_VERSION" ]; then
exit 1 exit 1
fi fi
INSTALL=`pwd`/install INSTALL="$PWD/install"
# Set up the driver environment. # Set up the driver environment.
export LD_LIBRARY_PATH=`pwd`/install/lib/ export LD_LIBRARY_PATH="$INSTALL/lib/"
export EGL_PLATFORM=surfaceless export EGL_PLATFORM=surfaceless
export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_CPU:-`uname -m`}.json export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.${VK_CPU:-$(uname -m)}.json"
RESULTS=`pwd`/${PIGLIT_RESULTS_DIR:-results} RESULTS=$PWD/${PIGLIT_RESULTS_DIR:-results}
mkdir -p $RESULTS mkdir -p $RESULTS
# Ensure Mesa Shader Cache resides on tmpfs. # Ensure Mesa Shader Cache resides on tmpfs.
@ -42,8 +43,8 @@ if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
sleep 1 sleep 1
fi fi
if [ -n "$PIGLIT_FRACTION" -o -n "$CI_NODE_INDEX" ]; then if [ -n "$PIGLIT_FRACTION" ] || [ -n "$CI_NODE_INDEX" ]; then
FRACTION=`expr ${PIGLIT_FRACTION:-1} \* ${CI_NODE_TOTAL:-1}` FRACTION=$((${PIGLIT_FRACTION:-1} * ${CI_NODE_TOTAL:-1}))
PIGLIT_RUNNER_OPTIONS="$PIGLIT_RUNNER_OPTIONS --fraction $FRACTION" PIGLIT_RUNNER_OPTIONS="$PIGLIT_RUNNER_OPTIONS --fraction $FRACTION"
fi fi

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2035 # FIXME glob
# shellcheck disable=SC2086 # we want word splitting
set -ex set -ex
@ -26,7 +28,7 @@ esac
#PATH="/opt/wine-stable/bin/:$PATH" # WineHQ path #PATH="/opt/wine-stable/bin/:$PATH" # WineHQ path
# Avoid asking about Gecko or Mono instalation # Avoid asking about Gecko or Mono instalation
export WINEDLLOVERRIDES=mscoree=d;mshtml=d export WINEDLLOVERRIDES="mscoree=d;mshtml=d" # FIXME: drop, not needed anymore? (wine dir is already created)
# Set environment for DXVK. # Set environment for DXVK.
export DXVK_LOG_LEVEL="info" export DXVK_LOG_LEVEL="info"
@ -40,20 +42,12 @@ export DXVK_STATE_CACHE=0
# using a command wrapper. Hence, we will just set it when running the # using a command wrapper. Hence, we will just set it when running the
# command. # command.
export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/" export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.${VK_CPU:-`uname -m`}.json" export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.${VK_CPU:-$(uname -m)}.json"
# Sanity check to ensure that our environment is sufficient to make our tests # Sanity check to ensure that our environment is sufficient to make our tests
# run against the Mesa built by CI, rather than any installed distro version. # run against the Mesa built by CI, rather than any installed distro version.
MESA_VERSION=$(head -1 "$INSTALL/VERSION" | sed 's/\./\\./g') MESA_VERSION=$(head -1 "$INSTALL/VERSION" | sed 's/\./\\./g')
print_red() {
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}"
"$@"
printf "${NC}"
}
# wrapper to supress +x to avoid spamming the log # wrapper to supress +x to avoid spamming the log
quiet() { quiet() {
set +x set +x
@ -79,14 +73,14 @@ HANG_DETECTION_CMD=""
# Set up the platform windowing system. # Set up the platform windowing system.
if [ "x$EGL_PLATFORM" = "xsurfaceless" ]; then if [ "$EGL_PLATFORM" = "surfaceless" ]; then
# Use the surfaceless EGL platform. # Use the surfaceless EGL platform.
export DISPLAY= export DISPLAY=
export WAFFLE_PLATFORM="surfaceless_egl" export WAFFLE_PLATFORM="surfaceless_egl"
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform surfaceless_egl --api gles2" SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform surfaceless_egl --api gles2"
if [ "x$GALLIUM_DRIVER" = "xvirpipe" ]; then if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
# piglit is to use virpipe, and virgl_test_server llvmpipe # piglit is to use virpipe, and virgl_test_server llvmpipe
export GALLIUM_DRIVER="$GALLIUM_DRIVER" export GALLIUM_DRIVER="$GALLIUM_DRIVER"
@ -98,9 +92,9 @@ if [ "x$EGL_PLATFORM" = "xsurfaceless" ]; then
sleep 1 sleep 1
fi fi
elif [ "x$PIGLIT_PLATFORM" = "xgbm" ]; then elif [ "$PIGLIT_PLATFORM" = "gbm" ]; then
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform gbm --api gl" SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform gbm --api gl"
elif [ "x$PIGLIT_PLATFORM" = "xmixed_glx_egl" ]; then elif [ "$PIGLIT_PLATFORM" = "mixed_glx_egl" ]; then
# It is assumed that you have already brought up your X server before # It is assumed that you have already brought up your X server before
# calling this script. # calling this script.
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl" SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
@ -115,6 +109,7 @@ if [ -n "$CI_NODE_INDEX" ]; then
USE_CASELIST=1 USE_CASELIST=1
fi fi
# shellcheck disable=SC2317
replay_minio_upload_images() { replay_minio_upload_images() {
find "$RESULTS/$__PREFIX" -type f -name "*.png" -printf "%P\n" \ find "$RESULTS/$__PREFIX" -type f -name "*.png" -printf "%P\n" \
| while read -r line; do | while read -r line; do
@ -167,7 +162,7 @@ PIGLIT_CMD="./piglit run -l verbose --timeout 300 -j${FDO_CI_CONCURRENT:-4} $PIG
RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD && $HANG_DETECTION_CMD $PIGLIT_CMD" RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD && $HANG_DETECTION_CMD $PIGLIT_CMD"
if [ "$RUN_CMD_WRAPPER" ]; then if [ "$RUN_CMD_WRAPPER" ]; then
RUN_CMD="set +e; $RUN_CMD_WRAPPER "$(/usr/bin/printf "%q" "$RUN_CMD")"; set -e" RUN_CMD="set +e; $RUN_CMD_WRAPPER \"$(/usr/bin/printf "%q" "$RUN_CMD")\"; set -e"
fi fi
# The replayer doesn't do any size or checksum verification for the traces in # The replayer doesn't do any size or checksum verification for the traces in
@ -177,9 +172,8 @@ fi
# run. # run.
rm -rf replayer-db rm -rf replayer-db
eval $RUN_CMD if ! eval $RUN_CMD;
then
if [ $? -ne 0 ]; then
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION" printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
fi fi
@ -217,7 +211,7 @@ find "$RESULTS"/summary -type f -name "*.html" -print0 \
find "$RESULTS"/summary -type f -name "*.html" -print0 \ find "$RESULTS"/summary -type f -name "*.html" -print0 \
| xargs -0 sed -i 's%<img src="file://%<img src="https://'"${PIGLIT_REPLAY_REFERENCE_IMAGES_BASE}"'/%g' | xargs -0 sed -i 's%<img src="file://%<img src="https://'"${PIGLIT_REPLAY_REFERENCE_IMAGES_BASE}"'/%g'
quiet print_red echo "Failures in traces:" echo "Failures in traces:"
cat $RESULTSFILE cat $RESULTSFILE
quiet print_red echo "Review the image changes and get the new checksums at: ${ARTIFACTS_BASE_URL}/results/summary/problems.html" error echo "Review the image changes and get the new checksums at: ${ARTIFACTS_BASE_URL}/results/summary/problems.html"
exit 1 exit 1

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2038 # TODO: rewrite the find
# shellcheck disable=SC2086 # we want word splitting
section_switch prepare-artifacts "artifacts: prepare" section_switch prepare-artifacts "artifacts: prepare"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CHECKPATH=".gitlab-ci/container" # TODO: expand to cover whole .gitlab-ci/ CHECKPATH=".gitlab-ci"
is_bash() { is_bash() {
[[ $1 == *.sh ]] && return 0 [[ $1 == *.sh ]] && return 0

View file

@ -1,4 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2048
# shellcheck disable=SC2086 # we want word splitting
# shellcheck disable=SC2155 # mktemp usually not failing
function x_off { function x_off {
if [[ "$-" == *"x"* ]]; then if [[ "$-" == *"x"* ]]; then

View file

@ -1,8 +1,9 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
set -ex set -ex
if [ "x$VK_DRIVER" = "x" ]; then if [[ -z "$VK_DRIVER" ]]; then
exit 1 exit 1
fi fi
@ -21,14 +22,14 @@ export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
# Sanity check to ensure that our environment is sufficient to make our tests # Sanity check to ensure that our environment is sufficient to make our tests
# run against the Mesa built by CI, rather than any installed distro version. # run against the Mesa built by CI, rather than any installed distro version.
MESA_VERSION=$(cat "$INSTALL/VERSION" | sed 's/\./\\./g') MESA_VERSION=$(sed 's/\./\\./g' "$INSTALL/VERSION")
# Force the stdout and stderr streams to be unbuffered in python. # Force the stdout and stderr streams to be unbuffered in python.
export PYTHONUNBUFFERED=1 export PYTHONUNBUFFERED=1
# Set the Vulkan driver to use. # Set the Vulkan driver to use.
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json" export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
if [ ${VK_DRIVER} = "radeon" ]; then if [ "${VK_DRIVER}" = "radeon" ]; then
# Disable vsync # Disable vsync
export MESA_VK_WSI_PRESENT_MODE=mailbox export MESA_VK_WSI_PRESENT_MODE=mailbox
export vblank_mode=0 export vblank_mode=0
@ -63,7 +64,7 @@ SANITY_MESA_VERSION_CMD="vulkaninfo"
# Set up the Window System Interface (WSI) # Set up the Window System Interface (WSI)
# TODO: Can we get away with GBM? # TODO: Can we get away with GBM?
if [ ${TEST_START_XORG:-0} -eq 1 ]; then if [ "${TEST_START_XORG:-0}" -eq 1 ]; then
"$INSTALL"/common/start-x.sh "$INSTALL" "$INSTALL"/common/start-x.sh "$INSTALL"
export DISPLAY=:0 export DISPLAY=:0
fi fi
@ -75,9 +76,8 @@ SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD | tee /tmp/version.txt | grep
RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD" RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD"
set +e set +e
eval $RUN_CMD if ! eval $RUN_CMD;
then
if [ $? -ne 0 ]; then
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION" printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
fi fi
set -e set -e

View file

@ -1,8 +1,9 @@
#!/bin/sh #!/usr/bin/env bash
# shellcheck disable=SC2035 # FIXME glob
set -ex set -ex
if [ "x$VK_DRIVER" = "x" ]; then if [[ -z "$VK_DRIVER" ]]; then
exit 1 exit 1
fi fi
@ -19,7 +20,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/:/vkd3d-proton-tests/x64/"
# Sanity check to ensure that our environment is sufficient to make our tests # Sanity check to ensure that our environment is sufficient to make our tests
# run against the Mesa built by CI, rather than any installed distro version. # run against the Mesa built by CI, rather than any installed distro version.
MESA_VERSION=$(cat "$INSTALL/VERSION" | sed 's/\./\\./g') MESA_VERSION=$(sed 's/\./\\./g' "$INSTALL/VERSION")
# Set the Vulkan driver to use. # Set the Vulkan driver to use.
export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json" export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
@ -29,14 +30,6 @@ export WINEDEBUG="-all"
export WINEPREFIX="/vkd3d-proton-wine64" export WINEPREFIX="/vkd3d-proton-wine64"
export WINEESYNC=1 export WINEESYNC=1
print_red() {
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}"
"$@"
printf "${NC}"
}
# wrapper to supress +x to avoid spamming the log # wrapper to supress +x to avoid spamming the log
quiet() { quiet() {
set +x set +x
@ -45,9 +38,8 @@ quiet() {
} }
set +e set +e
vulkaninfo | tee /tmp/version.txt | grep \"Mesa $MESA_VERSION\(\s\|$\)\" if ! vulkaninfo | tee /tmp/version.txt | grep "\"Mesa $MESA_VERSION\(\s\|$\)\"";
then
if [ $? -ne 0 ]; then
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION" printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
fi fi
set -e set -e
@ -61,10 +53,9 @@ fi
quiet printf "%s\n" "Running vkd3d-proton testsuite..." quiet printf "%s\n" "Running vkd3d-proton testsuite..."
set +e set +e
/vkd3d-proton-tests/x64/bin/d3d12 > $RESULTS/vkd3d-proton.log if ! /vkd3d-proton-tests/x64/bin/d3d12 > "$RESULTS/vkd3d-proton.log";
then
if [ $? != 0 ]; then error printf "%s\n" "Failed, see vkd3d-proton.log!"
quiet print_red printf "%s\n" "Failed, see vkd3d-proton.log!"
# Collect all the failures # Collect all the failures
VKD3D_PROTON_RESULTS="${VKD3D_PROTON_RESULTS:-vkd3d-proton-results}" VKD3D_PROTON_RESULTS="${VKD3D_PROTON_RESULTS:-vkd3d-proton-results}"
@ -82,7 +73,7 @@ if [ $? != 0 ]; then
# Make sure that the failures found in this run match the current expectation # Make sure that the failures found in this run match the current expectation
if ! diff -q ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"; then if ! diff -q ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"; then
quiet print_red printf "%s\n" "Changes found, see vkd3d-proton.log!" error printf "%s\n" "Changes found, see vkd3d-proton.log!"
quiet diff --color=always -u ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE" quiet diff --color=always -u ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"
fi fi