From 6f5c4a8e07f8cdf3f6352e9e85d7376937bb32d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Erik=20Bot=C3=B6?= Date: Mon, 6 Nov 2017 10:13:03 -0800 Subject: [PATCH] masterimage.py: fix issue with calling reboot on masterimage/DUT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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ö Signed-off-by: Stephano Cetola Signed-off-by: Ross Burton Signed-off-by: Armin Kuster --- meta/lib/oeqa/controllers/masterimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py index 07418fcda1..fe90967923 100644 --- a/meta/lib/oeqa/controllers/masterimage.py +++ b/meta/lib/oeqa/controllers/masterimage.py @@ -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) -- 2.40.1