fix runtime testing using systemd-boot targe
v4 cover fix runtime testing using systemd-boot targe
I'm sending this on behalf of Zeeshan Ali <[email protected]>. One of the patches required a rebase and he is on vacation. This fixes [YOCTO #11524].
Erik Botö (4):
sshcontrol.py: in copy_to() always use scp masterimage.py: fix stop()
masterimage.py: rename parameter "params" in start() to
"extra_bootparams"
masterimage.py: fix issue with calling reboot on masterimage/DUT
meta/lib/oeqa/controllers/masterimage.py | 6 +++--- meta/lib/oeqa/utils/sshcontrol.py | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-)
Signature · 1 line
2.13.1
PATCH v4 1/4 sshcontrol.py: in copy_to() always use scp
From: Erik Botö <[email protected]>
The current implementation is broken when the localpath is a link. Then only a symlink would be created on the target, instead of copying the actual file.
[YOCTO #11524]
--- meta/lib/oeqa/utils/sshcontrol.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
meta/lib/oeqa/utils/sshcontrol.py +3 -6
@@ -150,12 +150,9 @@ class SSHControl(object): def copy_to(self, localpath, remotepath): if os.path.islink(localpath): - link = os.readlink(localpath) - dst_dir, dst_base = os.path.split(remotepath) - return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base)) - else: - command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] - return self._internal_run(command, ignore_status=False) + localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath) + command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] + return self._internal_run(command, ignore_status=False) def copy_from(self, remotepath, localpath): command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]
Signature · 1 line
2.13.1
PATCH v4 2/4 masterimage.py: fix stop()
In reply to Stephano CetolaFrom: Erik Botö <[email protected]>
The stop() function is called in the context of the masterimage, so self.master should be used instead of self.connection which is undefined at that time.
[YOCTO #11524]
--- meta/lib/oeqa/controllers/masterimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/controllers/masterimage.py +1 -1
@@ -156,7 +156,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta def stop(self): bb.plain("%s - reboot/powercycle target" % self.pn) - self.power_cycle(self.connection) + self.power_cycle(self.master) class SystemdbootTarget(MasterImageHardwareTarget):
Signature · 1 line
2.13.1
PATCH v4 3/4 masterimage.py: rename parameter "params" in start() to "extra_bootparams"
In reply to Stephano CetolaFrom: Erik Botö <[email protected]>
This matches how it is called, and how it is named in qmeu target.
[YOCTO #11524]
--- meta/lib/oeqa/controllers/masterimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/controllers/masterimage.py +1 -1
@@ -143,7 +143,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta def _deploy(self): pass - def start(self, params=None): + def start(self, extra_bootparams=None): bb.plain("%s - boot test image on target" % self.pn) self._start() # set the ssh object for the target/test image
Signature · 1 line
2.13.1
PATCH v4 4/4 masterimage.py: fix issue with calling reboot on masterimage/DUT
In reply to Stephano CetolaFrom: Erik Botö <[email protected]>
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]
--- meta/lib/oeqa/controllers/masterimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/controllers/masterimage.py +1 -1
@@ -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)
Signature · 1 line
2.13.1
Any updates on this?
I can setup a test for this if one doesn't already exist.
Cheers,
Stephano
Quoted 18 lines · Stephano Cetola
I'm sending this on behalf of Zeeshan Ali <[email protected]>. One of the patches required a rebase and he is on vacation. This fixes [YOCTO #11524].
Erik Botö (4):
sshcontrol.py: incopy_to()always use scpmasterimage.py: fixstop()
masterimage.py: rename parameter "params" instart()to
"extra_bootparams"
masterimage.py: fix issue with calling reboot on masterimage/DUTmeta/lib/oeqa/controllers/masterimage.py | 6 +++--- meta/lib/oeqa/utils/sshcontrol.py | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-)Signature · 1 line
2.13.1