← Back to team overview

canonical-hw-cert team mailing list archive

[Merge] ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master

 

Kevin Yeh has proposed merging ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master.

Commit message:
Fix: 1. fix wait-resource.sh which won't wait apt or dpkg process finish.
     2. fix disable auto-suspend cmd that only effective execute by non-root user.

Requested reviews:
  hwcert-jenkins (hwcert-jenkins)

For more details, see:
https://code.launchpad.net/~kevinyeh/hwcert-jenkins-jobs/+git/hwcert-jenkins-jobs/+merge/435180
-- 
Your team hwcert-jenkins is requested to review the proposed merge of ~kevinyeh/hwcert-jenkins-jobs:fix-running-script-sru into hwcert-jenkins-jobs:master.
diff --git a/jobs/sru/test-cmds-pre-test-actions.sh b/jobs/sru/test-cmds-pre-test-actions.sh
index 6d00657..2906651 100644
--- a/jobs/sru/test-cmds-pre-test-actions.sh
+++ b/jobs/sru/test-cmds-pre-test-actions.sh
@@ -20,7 +20,7 @@
         # to make sure it doesnt get chance to start
         _run sudo cp /usr/share/unattended-upgrades/20auto-upgrades-disabled  /etc/apt/apt.conf.d/20auto-upgrades
         # Disable suspend use gsettings cmd to avoid some systems won't go to suspend by gschema.override.
-        _run sudo gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
+        _run gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
         _run sudo reboot
         sleep 120
         wait_for_ssh
diff --git a/jobs/sru/wait-resource.sh b/jobs/sru/wait-resource.sh
index 14e2a7f..1cf487e 100644
--- a/jobs/sru/wait-resource.sh
+++ b/jobs/sru/wait-resource.sh
@@ -40,8 +40,10 @@
         while [ "\\\${rtn_apt}" -ne 0 -o "\\\${rtn_dpkg}" -ne 0 ]
         do
           sleep 1
-          rtn_apt=\\\$(checkrtn apt)
-          rtn_dpkg=\\\$(checkrtn dpkg)
+          checkrtn apt
+          rtn_apt=\\\$?
+          checkrtn dpkg
+          rtn_dpkg=\\\$?
           echo "Found \\\${rtn_apt} apt processes and \\\${rtn_dpkg} dpkg processes"
           echo "System daily updating...wait for APT resource... \\\${counter} seconds passed."
           # debug message

Follow ups