]> code.ossystems Code Review - openembedded-core.git/commitdiff
masterimage.py: fix issue with calling reboot on masterimage/DUT
authorErik Botö <erik.boto@pelagicore.com>
Mon, 6 Nov 2017 18:13:03 +0000 (10:13 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Nov 2017 19:54:23 +0000 (19:54 +0000)
On systemd systems calling reboot over an ssh connection doesn't
return as expected causing an exception, therefore wrap the call
to reboot in order to avoid this issue.

Also sync the filesystems before rebooting cause otherwise, it will be
done as part of the reboot and could take a very long time and testimage
will fail to access the machine. This issue was observed consistently with
one of our rootfs at Pelagicore.

[YOCTO #11524]

Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/controllers/masterimage.py

index 07418fcda19108747dbf1a0a08c397736e8c6a3d..fe9096792351c35732f37edebfe70cc453db1762 100644 (file)
@@ -108,7 +108,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
             time.sleep(10)
             self.power_ctl("cycle")
         else:
-            status, output = conn.run("reboot")
+            status, output = conn.run("sync; { sleep 1; reboot; } > /dev/null &")
             if status != 0:
                 bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output)