diff --git a/.gitlab-ci/bare-metal/cros-servo.sh b/.gitlab-ci/bare-metal/cros-servo.sh index 021ce9022d3..df08958b998 100755 --- a/.gitlab-ci/bare-metal/cros-servo.sh +++ b/.gitlab-ci/bare-metal/cros-servo.sh @@ -50,6 +50,10 @@ if [ -z "$BM_CMDLINE" ]; then exit 1 fi +. "${SCRIPTS_DIR}/setup-test-env.sh" + +section_start prepare_rootfs "Preparing rootfs components" + set -ex # Clear out any previous run's artifacts. @@ -104,11 +108,15 @@ python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_typ python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update farm "${FARM}" python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --create-dut-job dut_name "${CI_RUNNER_DESCRIPTION}" python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit "${CI_JOB_STARTED_AT}" +section_end prepare_rootfs + python3 $BM/cros_servo_run.py \ --cpu $BM_SERIAL \ --ec $BM_SERIAL_EC \ --test-timeout ${TEST_PHASE_TIMEOUT_MINUTES:-20} ret=$? + +section_start dut_cleanup "Cleaning up after job" python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close set -e @@ -116,5 +124,6 @@ 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/ +section_end dut_cleanup exit $ret diff --git a/.gitlab-ci/bare-metal/fastboot.sh b/.gitlab-ci/bare-metal/fastboot.sh index 6c795a00c23..35491379b66 100755 --- a/.gitlab-ci/bare-metal/fastboot.sh +++ b/.gitlab-ci/bare-metal/fastboot.sh @@ -55,6 +55,8 @@ if echo $BM_CMDLINE | grep -q "root=/dev/nfs"; then BM_FASTBOOT_NFSROOT=1 fi +section_start prepare_rootfs "Preparing rootfs components" + set -ex # Clear out any previous run's artifacts. @@ -148,6 +150,8 @@ if [ -n "$BM_SERIAL_SCRIPT" ]; then done fi +section_end prepare_rootfs + set +e $BM/fastboot_run.py \ --dev="$BM_SERIAL" \ diff --git a/.gitlab-ci/bare-metal/poe-powered.sh b/.gitlab-ci/bare-metal/poe-powered.sh index 56afc600b17..06df9381289 100755 --- a/.gitlab-ci/bare-metal/poe-powered.sh +++ b/.gitlab-ci/bare-metal/poe-powered.sh @@ -71,6 +71,8 @@ if [ -z "$BM_CMDLINE" ]; then exit 1 fi +section_start prepare_rootfs "Preparing rootfs components" + set -ex date +'%F %T' @@ -181,6 +183,8 @@ if [ -n "$BM_BOOTCONFIG" ]; then printf "$BM_BOOTCONFIG" >> /tftp/config.txt fi +section_end prepare_rootfs + set +e STRUCTURED_LOG_FILE=results/job_detail.json python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_type "${DEVICE_TYPE}"