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
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Boot script for devices attached to a PoE switch, using NFS for the root
|
|
|
|
# filesystem.
|
|
|
|
|
|
|
|
# We're run from the root of the repo, make a helper var for our paths
|
|
|
|
BM=$CI_PROJECT_DIR/install/bare-metal
|
|
|
|
|
|
|
|
# Runner config checks
|
|
|
|
if [ -z "$BM_SERIAL" ]; then
|
|
|
|
echo "Must set BM_SERIAL in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is the serial port to listen the device."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POE_ADDRESS" ]; then
|
|
|
|
echo "Must set BM_POE_ADDRESS in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is the PoE switch address to connect for powering up/down devices."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POE_USERNAME" ]; then
|
|
|
|
echo "Must set BM_POE_USERNAME in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is the PoE switch username."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POE_PASSWORD" ]; then
|
|
|
|
echo "Must set BM_POE_PASSWORD in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is the PoE switch password."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POE_INTERFACE" ]; then
|
|
|
|
echo "Must set BM_POE_INTERFACE in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is the PoE switch interface where the device is connected."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POWERUP" ]; then
|
|
|
|
echo "Must set BM_POWERUP in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is a shell script that should power up the device and begin its boot sequence."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_POWERDOWN" ]; then
|
|
|
|
echo "Must set BM_POWERDOWN in your gitlab-runner config.toml [[runners]] environment"
|
|
|
|
echo "This is a shell script that should power off the device."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d /nfs ]; then
|
|
|
|
echo "NFS rootfs directory needs to be mounted at /nfs by the gitlab runner"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d /tftp ]; then
|
|
|
|
echo "TFTP directory for this board needs to be mounted at /tftp by the gitlab runner"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# job config checks
|
|
|
|
if [ -z "$BM_ROOTFS" ]; then
|
|
|
|
echo "Must set BM_ROOTFS to your board's rootfs directory in the job's variables"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_BOOTFS" ]; then
|
|
|
|
echo "Must set /boot files for the TFTP boot in the job's variables"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$BM_CMDLINE" ]; then
|
|
|
|
echo "Must set BM_CMDLINE to your board's kernel command line arguments"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
# Clear out any previous run's artifacts.
|
|
|
|
rm -rf results/
|
|
|
|
mkdir -p results
|
|
|
|
|
|
|
|
# Create the rootfs in the NFS directory. rm to make sure it's in a pristine
|
|
|
|
# state, since it's volume-mounted on the host.
|
|
|
|
rsync -a --delete $BM_ROOTFS/ /nfs/
|
|
|
|
|
|
|
|
[ -z $BM_ROOTFS_EXTRA ] || rsync -a $BM_ROOTFS_EXTRA/ /nfs/
|
|
|
|
|
|
|
|
mkdir -p /nfs/results
|
|
|
|
. $BM/rootfs-setup.sh /nfs
|
|
|
|
|
|
|
|
rsync -a --delete $BM_BOOTFS/ /tftp/
|
|
|
|
|
|
|
|
echo "$BM_CMDLINE" > /tftp/cmdline.txt
|
|
|
|
|
|
|
|
set +e
|
|
|
|
ATTEMPTS=2
|
|
|
|
while [ $((ATTEMPTS--)) -gt 0 ]; do
|
|
|
|
python3 $BM/poe_run.py \
|
|
|
|
--dev="$BM_SERIAL" \
|
|
|
|
--powerup="$BM_POWERUP" \
|
2021-01-25 11:28:05 +00:00
|
|
|
--powerdown="$BM_POWERDOWN" \
|
|
|
|
--timeout="${BM_POE_TIMEOUT:-60}"
|
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
|
|
|
ret=$?
|
|
|
|
|
|
|
|
if [ $ret -eq 2 ]; then
|
|
|
|
echo "Did not detect boot sequence, retrying..."
|
|
|
|
else
|
|
|
|
ATTEMPTS=0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
|
|
|
|
# will look for them.
|
|
|
|
cp -Rp /nfs/results/. results/
|
|
|
|
|
|
|
|
exit $ret
|