From 3f8046fd3e70774a17db078d9bc2172e9b7dedb4 Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Fri, 17 Jan 2025 07:48:38 +0530 Subject: [PATCH] ci: export RESULTS_DIR in crosvm-script.sh Export the RESULTS_DIR environment variable in crosvm-script.sh to ensure it points to the correct directory. Without this, artifacts are not generated because the results directory is created in the wrong location after the directory changes in the VM. Also fix https://www.shellcheck.net/wiki/SC2129 shellcheck error. Suggested-by: Eric Engestrom Signed-off-by: Vignesh Raman Reviewed-by: Eric Engestrom Part-of: --- .gitlab-ci/crosvm-runner.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci/crosvm-runner.sh b/.gitlab-ci/crosvm-runner.sh index c47b76197ba..cb6a0ecd68b 100755 --- a/.gitlab-ci/crosvm-runner.sh +++ b/.gitlab-ci/crosvm-runner.sh @@ -80,9 +80,12 @@ ${SCRIPTS_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 "export SCRIPTS_DIR=${SCRIPTS_DIR}" > ${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 +{ + echo "export SCRIPTS_DIR=${SCRIPTS_DIR}" + echo "export RESULTS_DIR=${RESULTS_DIR}" + echo ". ${VM_TEMP_DIR}/setup-test-env.sh" + echo "$@" +} > ${VM_TEMP_DIR}/crosvm-script.sh # Setup networking /usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE