ci/crosvm: Add log sections for crosvm
Clean up the GitLab job logs for crosvm jobs by adding a few collapsed log section. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13882 Signed-off-by: Valentine Burley <valentine.burley@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37327>
This commit is contained in:
committed by
Marge Bot
parent
ea5e190b91
commit
d1ff7cf445
@@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck disable=SC2086 # we want word splitting
|
# shellcheck disable=SC2086 # we want word splitting
|
||||||
|
# shellcheck disable=SC1091 # paths only become valid at runtime
|
||||||
|
|
||||||
|
. "${SCRIPTS_DIR}/setup-test-env.sh"
|
||||||
|
|
||||||
set -ue
|
set -ue
|
||||||
|
|
||||||
@@ -82,10 +85,11 @@ fi
|
|||||||
set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
|
set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
|
||||||
|
|
||||||
# Securely pass the current variables to the crosvm environment
|
# Securely pass the current variables to the crosvm environment
|
||||||
echo "Variables passed through:"
|
section_start variables "Environment variables passed through to VM:"
|
||||||
SCRIPTS_DIR=$(readlink -en "${0%/*}")
|
SCRIPTS_DIR=$(readlink -en "${0%/*}")
|
||||||
filter_env_vars | tee ${VM_TEMP_DIR}/crosvm-env.sh
|
filter_env_vars | tee ${VM_TEMP_DIR}/crosvm-env.sh
|
||||||
cp ${SCRIPTS_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh
|
cp ${SCRIPTS_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh
|
||||||
|
section_end variables
|
||||||
|
|
||||||
# Set the crosvm-script as the arguments of the current script
|
# Set the crosvm-script as the arguments of the current script
|
||||||
{
|
{
|
||||||
@@ -120,12 +124,14 @@ then
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
section_start kernel "Downloading kernel image"
|
||||||
if [ ! -f "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" ]; then
|
if [ ! -f "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" ]; then
|
||||||
mkdir -p /kernel
|
mkdir -p /kernel
|
||||||
# shellcheck disable=SC2153
|
# shellcheck disable=SC2153
|
||||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 30 \
|
curl -L --retry 4 -f --retry-all-errors --retry-delay 30 \
|
||||||
-o "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH:-amd64}/${KERNEL_IMAGE_NAME:-bzImage}"
|
-o "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH:-amd64}/${KERNEL_IMAGE_NAME:-bzImage}"
|
||||||
fi
|
fi
|
||||||
|
section_end kernel
|
||||||
|
|
||||||
# We aren't testing the host driver here, so we don't need to validate NIR on the host
|
# We aren't testing the host driver here, so we don't need to validate NIR on the host
|
||||||
NIR_DEBUG="novalidate" \
|
NIR_DEBUG="novalidate" \
|
||||||
@@ -141,6 +147,7 @@ crosvm --no-syslog run \
|
|||||||
--cid ${VSOCK_CID} -p "${CROSVM_KERN_ARGS}" \
|
--cid ${VSOCK_CID} -p "${CROSVM_KERN_ARGS}" \
|
||||||
/kernel/${KERNEL_IMAGE_NAME:-bzImage} > ${VM_TEMP_DIR}/crosvm 2>&1
|
/kernel/${KERNEL_IMAGE_NAME:-bzImage} > ${VM_TEMP_DIR}/crosvm 2>&1
|
||||||
|
|
||||||
|
section_start crosvm_results "Processing crosvm results"
|
||||||
CROSVM_RET=$?
|
CROSVM_RET=$?
|
||||||
|
|
||||||
[ ${CROSVM_RET} -eq 0 ] && {
|
[ ${CROSVM_RET} -eq 0 ] && {
|
||||||
@@ -157,5 +164,6 @@ CROSVM_RET=$?
|
|||||||
cat ${VM_TEMP_DIR}/crosvm >&2
|
cat ${VM_TEMP_DIR}/crosvm >&2
|
||||||
set -x
|
set -x
|
||||||
}
|
}
|
||||||
|
section_end crosvm_results
|
||||||
|
|
||||||
exit ${CROSVM_RET}
|
exit ${CROSVM_RET}
|
||||||
|
|||||||
Reference in New Issue
Block a user