* [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
@ 2017-05-19 14:20 Erik Botö
2017-05-19 14:20 ` [PATCH 2/4] masterimage.py: rename parameter "params" in start() to "extra_bootparams" Erik Botö
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Erik Botö @ 2017-05-19 14:20 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
---
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..6cdcfa3068 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("{ 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.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] masterimage.py: rename parameter "params" in start() to "extra_bootparams"
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
@ 2017-05-19 14:20 ` Erik Botö
2017-05-19 14:20 ` [PATCH 3/4] masterimage.py: fix stop() Erik Botö
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Erik Botö @ 2017-05-19 14:20 UTC (permalink / raw)
To: openembedded-core
This matches how it is called, and how it is named in qmeu target.
Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
---
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 6cdcfa3068..18da2799bb 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] masterimage.py: fix stop()
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
2017-05-19 14:20 ` [PATCH 2/4] masterimage.py: rename parameter "params" in start() to "extra_bootparams" Erik Botö
@ 2017-05-19 14:20 ` Erik Botö
2017-05-19 14:20 ` [PATCH 4/4] sshcontrol.py: in copy_to() always use scp Erik Botö
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Erik Botö @ 2017-05-19 14:20 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
---
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 18da2799bb..75bcd4b08d 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -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):
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] sshcontrol.py: in copy_to() always use scp
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
2017-05-19 14:20 ` [PATCH 2/4] masterimage.py: rename parameter "params" in start() to "extra_bootparams" Erik Botö
2017-05-19 14:20 ` [PATCH 3/4] masterimage.py: fix stop() Erik Botö
@ 2017-05-19 14:20 ` Erik Botö
2017-05-19 14:59 ` [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Leonardo Sandoval
2017-05-26 9:01 ` Erik Botö
4 siblings, 0 replies; 9+ messages in thread
From: Erik Botö @ 2017-05-19 14:20 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
---
meta/lib/oeqa/utils/sshcontrol.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index 05d6502550..d292893c08 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -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]
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
` (2 preceding siblings ...)
2017-05-19 14:20 ` [PATCH 4/4] sshcontrol.py: in copy_to() always use scp Erik Botö
@ 2017-05-19 14:59 ` Leonardo Sandoval
2017-05-19 18:24 ` Erik Botö
2017-05-26 9:01 ` Erik Botö
4 siblings, 1 reply; 9+ messages in thread
From: Leonardo Sandoval @ 2017-05-19 14:59 UTC (permalink / raw)
To: Erik Botö; +Cc: openembedded-core
On Fri, 2017-05-19 at 16:20 +0200, Erik Botö wrote:
> 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.
>
> Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
> ---
> 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..6cdcfa3068 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("{ sleep 1; reboot; } > /dev/null &")
what would make the difference having the sleep before reboot?
> 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.11.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
2017-05-19 14:59 ` [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Leonardo Sandoval
@ 2017-05-19 18:24 ` Erik Botö
0 siblings, 0 replies; 9+ messages in thread
From: Erik Botö @ 2017-05-19 18:24 UTC (permalink / raw)
To: Leonardo Sandoval, Erik Botö; +Cc: openembedded-core
On 2017-05-19 16:59, Leonardo Sandoval wrote:
> On Fri, 2017-05-19 at 16:20 +0200, Erik Botö wrote:
>> 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.
>>
>> Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
>> ---
>> 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..6cdcfa3068 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("{ sleep 1; reboot; } > /dev/null &")
> what would make the difference having the sleep before reboot?
It's an extra safety measure to make sure that reboot hasn't had time to
do anything before the command returns. Inspired by:
https://unix.stackexchange.com/questions/58271/closing-connection-after-executing-reboot-using-ssh-command
>
>> 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.11.0
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
` (3 preceding siblings ...)
2017-05-19 14:59 ` [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Leonardo Sandoval
@ 2017-05-26 9:01 ` Erik Botö
2017-05-26 13:57 ` Leonardo Sandoval
4 siblings, 1 reply; 9+ messages in thread
From: Erik Botö @ 2017-05-26 9:01 UTC (permalink / raw)
To: Erik Botö, openembedded-core
I guess an introduction should have been added to this patchset, so here
it comes a bit late:
These patches are what I needed to do in order to get automated runtime
tests on target using the systemd-boot target working. There is an open
bug in the bugzilla for this as well:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11524.
Cheers,
Erik
On 05/19/2017 04:20 PM, Erik Botö wrote:
> 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.
>
> Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
> ---
> 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..6cdcfa3068 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("{ 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)
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
2017-05-26 9:01 ` Erik Botö
@ 2017-05-26 13:57 ` Leonardo Sandoval
0 siblings, 0 replies; 9+ messages in thread
From: Leonardo Sandoval @ 2017-05-26 13:57 UTC (permalink / raw)
To: Erik Botö; +Cc: Cetola, Stephano, openembedded-core
On Fri, 2017-05-26 at 11:01 +0200, Erik Botö wrote:
> I guess an introduction should have been added to this patchset, so here
> it comes a bit late:
>
no problem, in that case, you may need to tag the commit(s) with the
bugzilla ID
> These patches are what I needed to do in order to get automated runtime
> tests on target using the systemd-boot target working. There is an open
> bug in the bugzilla for this as well:
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=11524.
>
> Cheers,
> Erik
>
>
> On 05/19/2017 04:20 PM, Erik Botö wrote:
> > 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.
> >
> > Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
> > ---
> > 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..6cdcfa3068 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("{ 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)
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT
2017-11-06 18:13 [PATCH 0/4] fix runtime tests with systemd-boot Stephano Cetola
@ 2017-11-06 18:13 ` Stephano Cetola
0 siblings, 0 replies; 9+ messages in thread
From: Stephano Cetola @ 2017-11-06 18:13 UTC (permalink / raw)
To: openembedded-core
From: Erik Botö <erik.boto@pelagicore.com>
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>
---
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.14.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-11-06 18:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 14:20 [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Erik Botö
2017-05-19 14:20 ` [PATCH 2/4] masterimage.py: rename parameter "params" in start() to "extra_bootparams" Erik Botö
2017-05-19 14:20 ` [PATCH 3/4] masterimage.py: fix stop() Erik Botö
2017-05-19 14:20 ` [PATCH 4/4] sshcontrol.py: in copy_to() always use scp Erik Botö
2017-05-19 14:59 ` [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Leonardo Sandoval
2017-05-19 18:24 ` Erik Botö
2017-05-26 9:01 ` Erik Botö
2017-05-26 13:57 ` Leonardo Sandoval
-- strict thread matches above, loose matches on Subject: below --
2017-11-06 18:13 [PATCH 0/4] fix runtime tests with systemd-boot Stephano Cetola
2017-11-06 18:13 ` [PATCH 1/4] masterimage.py: fix issue with calling reboot on masterimage/DUT Stephano Cetola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox