From: Corentin Noël Date: Fri, 3 Mar 2023 13:20:19 +0000 (+0100) Subject: ci: Allow to use crosvm-runner before deqp-runner X-Git-Tag: upstream/23.3.3~11648 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b55d4a6b743c3f4cb11168a8897a1de90345e90;p=platform%2Fupstream%2Fmesa.git ci: Allow to use crosvm-runner before deqp-runner Since the addition of unified sections, many scripts need to be aware of the content of the setup-test-env.sh file. The use of bash is also mandatory to have exports of function declarations. Signed-off-by: Corentin Noël Part-of: --- diff --git a/.gitlab-ci/crosvm-init.sh b/.gitlab-ci/crosvm-init.sh index 57366bf..ac5eb1b 100755 --- a/.gitlab-ci/crosvm-init.sh +++ b/.gitlab-ci/crosvm-init.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -e @@ -13,6 +13,7 @@ mount -t devpts devpts /dev/pts mount -t tmpfs tmpfs /tmp . ${VM_TEMP_DIR}/crosvm-env.sh +. ${VM_TEMP_DIR}/setup-test-env.sh # Required by the wayland platform export XDG_RUNTIME_DIR=$(mktemp -d) @@ -34,7 +35,7 @@ DMESG_PID=$! # Transfer the errors and crosvm-script output via a pair of virtio-vsocks socat -d -u pipe:${STDERR_FIFO} vsock-listen:${VSOCK_STDERR} & socat -d -U vsock-listen:${VSOCK_STDOUT} \ - system:"stdbuf -eL sh ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork + system:"stdbuf -eL bash ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork kill ${DMESG_PID} wait diff --git a/.gitlab-ci/crosvm-runner.sh b/.gitlab-ci/crosvm-runner.sh index f75ab1d..fac6559 100755 --- a/.gitlab-ci/crosvm-runner.sh +++ b/.gitlab-ci/crosvm-runner.sh @@ -66,9 +66,11 @@ set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; } echo "Variables passed through:" SCRIPT_DIR=$(readlink -en "${0%/*}") ${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 # Set the crosvm-script as the arguments of the current script -echo "$@" > ${VM_TEMP_DIR}/crosvm-script.sh +echo ". ${VM_TEMP_DIR}/setup-test-env.sh" > ${VM_TEMP_DIR}/crosvm-script.sh +echo "$@" >> ${VM_TEMP_DIR}/crosvm-script.sh # Setup networking /usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE