Small tweaks for testimage
v2 cover Small tweaks for testimage
Changed in v2:
- 4/4 had an extra change that wasn't meant to be.
The following changes since commit bd1c441a210cae03fb6006c996227211cc29056b:
bitbake: bitbake: runqueue: add warning if invalidating invalid task (2013-07-29 15:25:09 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib stefans/testimage-fix1
for you to fetch changes up to 42a3f746ec638bfb4802ccc4c10f0cbd09de958e:
oeqa/runtime/xorg: use the right ps command for xorg test (2013-07-30 11:59:30 +0300)
----------------------------------------------------------------
Stefan Stanacar (4):
oeqa/utils/sshcontrol: increase and log timeout in output oeqa/utils/qemurunner: add comment and header oeqa/utils/qemurunner: tweak console bootparam and ip command oeqa/runtime/xorg: use the right ps command for xorg test
meta/lib/oeqa/runtime/xorg.py | 4 ++-- meta/lib/oeqa/utils/qemurunner.py | 11 +++++++++-- meta/lib/oeqa/utils/sshcontrol.py | 10 ++++++---- 3 files changed, 17 insertions(+), 8 deletions(-)
Stefan Stanacar (4):
oeqa/utils/sshcontrol: increase and log timeout in output oeqa/utils/qemurunner: add comment and header oeqa/utils/qemurunner: tweak console bootparam and ip command oeqa/runtime/xorg: use the right ps command for xorg test
meta/lib/oeqa/runtime/xorg.py | 4 ++-- meta/lib/oeqa/utils/qemurunner.py | 11 +++++++++-- meta/lib/oeqa/utils/sshcontrol.py | 10 ++++++---- 3 files changed, 17 insertions(+), 8 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/4 oeqa/utils/sshcontrol: increase and log timeout in output
Increase a bit the timeout for ssh commands and also write in the output that the command timed out (it's easier to see that in a test fail than checking the ssh log)
--- meta/lib/oeqa/utils/sshcontrol.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
meta/lib/oeqa/utils/sshcontrol.py +6 -4
@@ -13,7 +13,7 @@ import os class SSHControl(object): - def __init__(self, host=None, timeout=200, logfile=None): + def __init__(self, host=None, timeout=300, logfile=None): self.host = host self.timeout = timeout self._out = ''
@@ -52,9 +52,10 @@ class SSHControl(object): self._ret = sshconn.poll() else: if timeout is None: - endtime = time.time() + self.timeout + tdelta = self.timeout else: - endtime = time.time() + timeout + tdelta = timeout + endtime = time.time() + tdelta while sshconn.poll() is None and time.time() < endtime: time.sleep(1) # process hasn't returned yet
@@ -64,7 +65,8 @@ class SSHControl(object): sshconn.kill() self._out = sshconn.stdout.read() sshconn.stdout.close() - self.log("[!!! process killed]") + self._out += "\n[!!! SSH command timed out after %d seconds and it was killed]" % tdelta + self.log("[!!! SSH command timed out after %d seconds and it was killed]" % tdelta) else: self._out = sshconn.stdout.read() self._ret = sshconn.poll()
Signature · 1 line
1.8.3.1
PATCH v2 2/4 oeqa/utils/qemurunner: add comment and header
In reply to Stefan StanacarOne of the files was missing comment/header, unlike the others.
--- meta/lib/oeqa/utils/qemurunner.py | 7 +++++++ 1 file changed, 7 insertions(+)
meta/lib/oeqa/utils/qemurunner.py +7 -0
@@ -1,3 +1,10 @@ +# Copyright (C) 2013 Intel Corporation +# +# Released under the MIT license (see COPYING.MIT) + +# This module provides a class for starting qemu images using runqemu. +# It's used by testimage.bbclass. + import subprocess import optparse import sys
Signature · 1 line
1.8.3.1
PATCH v2 3/4 oeqa/utils/qemurunner: tweak console bootparam and ip command
In reply to Stefan StanacarSync serial baud rate with default inittab which should help with apparent boot fails. Also keep a console on tty1.
Also we shouldn't assume eth0 it the right interface. (systemd images can rename interfaces to something else).
--- meta/lib/oeqa/utils/qemurunner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/utils/qemurunner.py +2 -2
@@ -25,7 +25,7 @@ class QemuRunner: self.rootfs = rootfs self.streampath = '/tmp/qemuconnection.%s' % os.getpid() - self.qemuparams = 'bootparams="console=ttyS0" qemuparams="-serial unix:%s,server,nowait"' % self.streampath + self.qemuparams = 'bootparams="console=tty1 console=ttyS0,115200n8" qemuparams="-serial unix:%s,server,nowait"' % self.streampath self.qemupid = None self.ip = None
@@ -76,7 +76,7 @@ class QemuRunner: if not match: bb.note("Couldn't get prompt, all I got was:\n%s" % match.group(0)) return False - console.write("ip addr show eth0 | sed -n '3p' | awk '{ print $2 }' | cut -f 1 -d \"/\"\n") + console.write("ip addr show `ip route list | sed -n '1p' | awk '{print $5}'` | sed -n '3p' | awk '{ print $2 }' | cut -f 1 -d \"/\"\n") (index, match, text) = console.expect([r"((?:[0-9]{1,3}\.){3}[0-9]{1,3})"],10) console.close() if match:
Signature · 1 line
1.8.3.1
PATCH v2 4/4 oeqa/runtime/xorg: use the right ps command for xorg test
In reply to Stefan StanacarUse our determined ps command, otherwise test fails for images with procps.
--- meta/lib/oeqa/runtime/xorg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/runtime/xorg.py +2 -2
@@ -11,8 +11,8 @@ class XorgTest(oeRuntimeTest): @skipUnlessPassed('test_ssh') def test_xorg_running(self): - (status, output) = self.target.run('ps | grep -v xinit | grep [X]org') - self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run('ps')[1]) + (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -v xinit | grep [X]org') + self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run(oeRuntimeTest.pscmd)[1]) @skipUnlessPassed('test_ssh') def test_xorg_error(self):
Signature · 1 line
1.8.3.1
Quoted 17 lines · On Tuesday 30 July 2013 12:28:16 Stefan Stanacar wrote:
Changed in v2:
- 4/4 had an extra change that wasn't meant to be.The following changes since commit
bd1c441a210cae03fb6006c996227211cc29056b:bitbake: bitbake: runqueue: add warning if invalidating invalid task
(2013-07-29 15:25:09 +0100)are available in the git repository at:
git://git.yoctoproject.org/poky-contribstefans/testimage-fix1for you to fetch changes up to
42a3f746ec638bfb4802ccc4c10f0cbd09de958e:oeqa/runtime/xorg: use the right ps command for xorg test (2013-07-30
11:59:30 +0300)
Quoted 6 lines
----------------------------------------------------------------
Stefan Stanacar (4):
oeqa/utils/sshcontrol: increase and log timeout in output oeqa/utils/qemurunner: add comment and header oeqa/utils/qemurunner: tweak console bootparam and ip command oeqa/runtime/xorg: use the right ps command for xorg test
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre