From 526ade02341c5851135922d5855aa1fde0573f0d Mon Sep 17 00:00:00 2001 From: Abdullah Date: Thu, 28 Nov 2024 10:16:58 +0100 Subject: [PATCH] reboot machine in testflinger job and re-run DSS validations --- .../testflinger/job-def.yaml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/contrib/checkbox-dss-validation/testflinger/job-def.yaml b/contrib/checkbox-dss-validation/testflinger/job-def.yaml index 2658571dd6..fac9dbd421 100644 --- a/contrib/checkbox-dss-validation/testflinger/job-def.yaml +++ b/contrib/checkbox-dss-validation/testflinger/job-def.yaml @@ -59,3 +59,26 @@ test_data: ssh ubuntu@$DEVICE_IP ' checkbox-dss.validate-with-gpu ' + + # Reboot the machine + ssh -t ubuntu@$DEVICE_IP ' + SLEEP_SECS=15 + >&2 echo "[INFO]: sleeping for ${SLEEP_SECS} seconds before rebooting." + sleep ${SLEEP_SECS} + >&2 echo "[INFO]: rebooting now. Best of luck!" + sudo reboot + ' || >&2 echo "reboot started with exit code $?" + + SLEEP_SECS=30 + >&2 echo "[INFO]: sleeping for ${SLEEP_SECS} seconds for reboot to finish." + sleep ${SLEEP_SECS} + >&2 echo "[INFO]: attempting to reconnect." + + # Re-test after reboot, attempting to connect max 30 times, waiting 10 sec each time + ssh -t ubuntu@$DEVICE_IP -o 'ConnectionAttempts 30' -o 'ConnectTimeout 10' ' + SLEEP_SECS=60 + >&2 echo "[INFO]: sleeping for ${SLEEP_SECS} seconds for things to settle down a bit." + sleep ${SLEEP_SECS} + sudo microk8s status --wait-ready + checkbox-dss.validate-with-gpu + '