diff mbox series

[isar-cip-core,v1,1/3] templates/swupdate_template.yml: Fail the job immediately after unexpected outcome

Message ID 20240618161035.1810237-2-Sai.Sathujoda@toshiba-tsip.com (mailing list archive)
State Accepted
Headers show
Series Minor corrections to CIP Core testing | expand

Commit Message

Sai.Sathujoda@toshiba-tsip.com June 18, 2024, 4:10 p.m. UTC
From: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>

Previously to make the job incomplete, a sleep command is added in the test job under
the intention that it will cause a timeout error and make the job incomplete. Sometimes
due to unknown circumstances the error cannot be caught using this method. This also
increases the job time. To avoid this, "lava-test-raise <message>" can be used to
immediately fail the job as soon as unexpected outcome occurs.

Signed-off-by: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>
---
 tests/templates/swupdate_template.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tests/templates/swupdate_template.yml b/tests/templates/swupdate_template.yml
index bf6777c..119a5d3 100644
--- a/tests/templates/swupdate_template.yml
+++ b/tests/templates/swupdate_template.yml
@@ -58,7 +58,7 @@  actions:
       password: "CIPsecurity@123"
 
 # TEST_BLOCK
-# Sleep 200s is added to make the job incomplete with a timeout if software update application failed
+# Fail the job if software update application failed
 - test:
     timeout:
       minutes: 15
@@ -70,7 +70,7 @@  actions:
           description: "Test software update"
         run:
           steps:
-            - if swupdate -d "-u #project_url#/#branch#/#architecture#/cip-core-image-security-cip-core-#distribution#-#architecture#.swu"; then echo software update is successful!!; else sleep 200s; fi
+            - if swupdate -d "-u #project_url#/#branch#/#architecture#/cip-core-image-security-cip-core-#distribution#-#architecture#.swu"; then echo software update is successful!!; else lava-test-raise "Fail job"; fi
       from: inline
       name: sample-test-1
       path: inline/sample-test.yaml
@@ -102,7 +102,7 @@  actions:
     parameters:
        kernel-start-message: "kernel: C:BOOT1:linux.efi"
 
-# sleep 180s is added to make the job incomplete if ustate is not 2 in the updated partition
+# Fail the job if ustate is not #updatestate# after reboot
 - test:
     timeout:
       minutes: 5
@@ -114,7 +114,7 @@  actions:
           description: "check boot loader environment variables"
         run:
           steps:
-            - if [ $(bg_printenv | grep ustate | awk 'FNR == 2{print $2}') = 2 ]; then bg_setenv -c; else sleep 180s; fi
+            - if [ $(bg_printenv | grep ustate | awk 'FNR == 2{print $2}') = 2 ]; then bg_setenv -c; else lava-test-raise "Fail job"; fi
       from: inline
       name: sample-test-2
       path: inline/sample-test.yaml