aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/controllers
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2014-04-30 13:31:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-30 21:52:12 +0100
commit5131094ad8f53b2052a97efd505e7a170d0c915d (patch)
tree80b0d7b9dcf2ed8ff54fff1691c241090abf8949 /meta/lib/oeqa/controllers
parent1dd1edb5ea551c8a01538b130aa4d0c361eae14d (diff)
downloadopenembedded-core-5131094ad8f53b2052a97efd505e7a170d0c915d.tar.gz
oeqa/controllers/masterimage: add a serial control command
Similar to power control command, this depends on a user's setup to get to the serial port of a board. For a local connected board this could just be: TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200" and for a serial console server: "telnet 10.11.12.13 7003" or some conmux command. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/controllers')
-rw-r--r--meta/lib/oeqa/controllers/masterimage.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
index e8d321f7ab..c6fc7d60e0 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -70,10 +70,12 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
# the command should take as the last argument "off" and "on" and "cycle" (off, on)
self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None
self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or ""
+
+ self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) or None
+ self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or ""
+
self.origenv = os.environ
- if self.powercontrol_cmd:
- if self.powercontrol_args:
- self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
+ if self.powercontrol_cmd or self.serialcontrol_cmd:
# the external script for controlling power might use ssh
# ssh + keys means we need the original user env
bborigenv = d.getVar("BB_ORIGENV", False) or {}
@@ -81,7 +83,14 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
val = bborigenv.getVar(key, True)
if val is not None:
self.origenv[key] = str(val)
+
+ if self.powercontrol_cmd:
+ if self.powercontrol_args:
+ self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
self.power_ctl("on")
+ if self.serialcontrol_cmd:
+ if self.serialcontrol_args:
+ self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
def power_ctl(self, msg):
if self.powercontrol_cmd:
@@ -172,4 +181,3 @@ class GummibootTarget(MasterImageHardwareTarget):
self.power_cycle(self.master)
# there are better ways than a timeout but this should work for now
time.sleep(120)
-