diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2020-06-10 14:44:17 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-07-20 20:21:12 +0000 |
commit | 096adbe369ab6e02c79c87e6730a87b4bc245d68 (patch) | |
tree | b57ef6b2eed6fed134eb28139c20d6423c7a6085 /.gitlab-ci | |
parent | 101400d4495d3ab6dba4af70782698ef13b3b06c (diff) |
ci: bare-metal: use nginx to get results from DUT
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2655
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5661>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/bare-metal/fastboot.sh | 17 | ||||
-rwxr-xr-x | .gitlab-ci/bare-metal/init.sh | 12 | ||||
-rw-r--r-- | .gitlab-ci/bare-metal/nginx-default-site | 20 | ||||
-rw-r--r-- | .gitlab-ci/container/arm_test-base.sh | 5 | ||||
-rw-r--r-- | .gitlab-ci/create-rootfs.sh | 1 |
5 files changed, 54 insertions, 1 deletions
diff --git a/.gitlab-ci/bare-metal/fastboot.sh b/.gitlab-ci/bare-metal/fastboot.sh index ad4a665055b..9adda125113 100755 --- a/.gitlab-ci/bare-metal/fastboot.sh +++ b/.gitlab-ci/bare-metal/fastboot.sh @@ -45,6 +45,13 @@ if [ -z "$BM_ROOTFS" ]; then exit 1 fi +if [ -z "$BM_WEBDAV_IP" -o -z "$BM_WEBDAV_PORT" ]; then + echo "BM_WEBDAV_IP and/or BM_WEBDAV_PORT is not set - no results will be uploaded from DUT!" + WEBDAV_CMDLINE="" +else + WEBDAV_CMDLINE="webdav=http://$BM_WEBDAV_IP:$BM_WEBDAV_PORT" +fi + set -ex # Clear out any previous run's artifacts. @@ -72,9 +79,17 @@ abootimg \ --create artifacts/fastboot.img \ -k Image.gz-dtb \ -r rootfs.cpio.gz \ - -c cmdline="$BM_CMDLINE" + -c cmdline="$BM_CMDLINE $WEBDAV_CMDLINE" rm Image.gz-dtb +# Start nginx to get results from DUT +if [ -n "$WEBDAV_CMDLINE" ]; then + ln -s `pwd`/results /results + sed -i s/80/$BM_WEBDAV_PORT/g /etc/nginx/sites-enabled/default + sed -i s/www-data/root/g /etc/nginx/nginx.conf + nginx +fi + # Start watching serial, and power up the device. if [ -n "$BM_SERIAL" ]; then $BM/serial-buffer.py $BM_SERIAL | tee artifacts/serial-output.txt & diff --git a/.gitlab-ci/bare-metal/init.sh b/.gitlab-ci/bare-metal/init.sh index 9dfef684977..00bee38a616 100755 --- a/.gitlab-ci/bare-metal/init.sh +++ b/.gitlab-ci/bare-metal/init.sh @@ -13,6 +13,18 @@ mount -t devpts devpts /dev/pts echo "nameserver 8.8.8.8" > /etc/resolv.conf 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" diff --git a/.gitlab-ci/bare-metal/nginx-default-site b/.gitlab-ci/bare-metal/nginx-default-site new file mode 100644 index 00000000000..7c46fa21c2c --- /dev/null +++ b/.gitlab-ci/bare-metal/nginx-default-site @@ -0,0 +1,20 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + server_name _; + + location / { + dav_methods PUT; + dav_ext_methods PROPFIND OPTIONS; + dav_access user:rw group:rw all:r; + + client_body_temp_path /tmp; + client_max_body_size 0; + create_full_put_path on; + + root /results; + + autoindex on; + } +} diff --git a/.gitlab-ci/container/arm_test-base.sh b/.gitlab-ci/container/arm_test-base.sh index 5f5be0464fe..9b3da12fbc5 100644 --- a/.gitlab-ci/container/arm_test-base.sh +++ b/.gitlab-ci/container/arm_test-base.sh @@ -24,6 +24,7 @@ apt-get install -y --no-remove \ flex \ git \ netcat \ + nginx-full \ python3-distutils \ python3-minimal \ python3-serial \ @@ -37,4 +38,8 @@ apt-get install -y --no-remove \ apt install -t buster-backports -y --no-remove \ meson +# setup nginx +sed -i '/gzip_/ s/#\ //g' /etc/nginx/nginx.conf +cp .gitlab-ci/bare-metal/nginx-default-site /etc/nginx/sites-enabled/default + . .gitlab-ci/container/container_post_build.sh diff --git a/.gitlab-ci/create-rootfs.sh b/.gitlab-ci/create-rootfs.sh index e9a2c787041..21c2844f73f 100644 --- a/.gitlab-ci/create-rootfs.sh +++ b/.gitlab-ci/create-rootfs.sh @@ -4,6 +4,7 @@ set -ex apt-get -y install --no-install-recommends \ ca-certificates \ + curl \ initramfs-tools \ libpng16-16 \ strace \ |