mesa/.gitlab-ci/bare-metal/init.sh

49 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
set -ex
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev || echo possibly already mounted
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /tmp
. /set-job-env-vars.sh
ci: add testing for VC4 drivers (Raspberry Pi 3) This tests OpenGL ES 2.0 CTS suite with VC4 drivers, through baremetal Raspberry Pi 3 devices. The devices are connected to a switch that supports Power over Ethernet (PoE), so the devices can be started/stopped through the switch, and also to a host that runs the GitLab runner through serial-to-USB cables, to monitor the devices to know when the testing finishes. The Raspberries uses a network boot, using NFS and TFTP. For the root filesystem, they use the one created in the armhf container. For the kernel/modules case, this is handled externally. Currently it is using the same kernel/modules that come with the Raspberry Pi OS. In future we could build them in the same armhf container. At this moment we only test armhf architecture, as this is the default one suggested by the Raspberry Pi Foundation. In future we could also add testing for arm64 architecture. Finally, for the very rare ocassions where the Raspberry Pi 3 device is booted but no data is received, it retries the testing for a second time, powering off and on the device in the process. v2: - Remove commit that exists capture devcoredump (Eric) - Squash remaining commits in one (Andres) v3: - Add missing boot timeout check (Juan) v4: - Use locks when running the PoE on/off script (Eric) - Use a timeout for serial read (Eric) v5: - Rename stage to "raspberrypi" (Eric) - Bump up arm64_test tag (Eric) v6: - Make serial buffer timeout optional (Juan) Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7628>
2020-11-15 19:57:55 +00:00
[ -z "$BM_KERNEL_MODULES" ] || modprobe "$BM_KERNEL_MODULES"
# Store Mesa's disk cache under /tmp, rather than sending it out over NFS.
export XDG_CACHE_HOME=/tmp
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# Not all DUTs have network
sntp -sS pool.ntp.org || true
# Start a little daemon to capture the first devcoredump we encounter. (They
# expire after 5 minutes, so we poll for them).
./capture-devcoredump.sh &
if sh $BARE_METAL_TEST_SCRIPT; then
OK=1
else
OK=0
fi
# upload artifacts via webdav
WEBDAV=$(cat /proc/cmdline | tr " " "\n" | grep webdav | cut -d '=' -f 2 || true)
if [ -n "$WEBDAV" ]; then
find /results -type f -exec curl -T {} $WEBDAV/{} \;
fi
if [ $OK -eq 1 ]; then
echo "bare-metal result: pass"
else
echo "bare-metal result: fail"
fi
# Wait until the job would have timed out anyway, so we don't spew a "init
# exited" panic.
sleep 6000