summaryrefslogtreecommitdiffstats
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:32 +0100
commit6cd18d7f91b1c6b378f4d6e048382ec1fc748a63 (patch)
tree97df70d69388d4f2fb00d482b5f019006b811b09 /meta/lib/oeqa/controllers
parentbd64b91314723408aabfc87d51c2bf30caaeb053 (diff)
downloadpoky-6cd18d7f91b1c6b378f4d6e048382ec1fc748a63.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. (From OE-Core rev: 5131094ad8f53b2052a97efd505e7a170d0c915d) 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):
70 # the command should take as the last argument "off" and "on" and "cycle" (off, on) 70 # the command should take as the last argument "off" and "on" and "cycle" (off, on)
71 self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None 71 self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None
72 self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or "" 72 self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or ""
73
74 self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) or None
75 self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or ""
76
73 self.origenv = os.environ 77 self.origenv = os.environ
74 if self.powercontrol_cmd: 78 if self.powercontrol_cmd or self.serialcontrol_cmd:
75 if self.powercontrol_args:
76 self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
77 # the external script for controlling power might use ssh 79 # the external script for controlling power might use ssh
78 # ssh + keys means we need the original user env 80 # ssh + keys means we need the original user env
79 bborigenv = d.getVar("BB_ORIGENV", False) or {} 81 bborigenv = d.getVar("BB_ORIGENV", False) or {}
@@ -81,7 +83,14 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
81 val = bborigenv.getVar(key, True) 83 val = bborigenv.getVar(key, True)
82 if val is not None: 84 if val is not None:
83 self.origenv[key] = str(val) 85 self.origenv[key] = str(val)
86
87 if self.powercontrol_cmd:
88 if self.powercontrol_args:
89 self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
84 self.power_ctl("on") 90 self.power_ctl("on")
91 if self.serialcontrol_cmd:
92 if self.serialcontrol_args:
93 self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
85 94
86 def power_ctl(self, msg): 95 def power_ctl(self, msg):
87 if self.powercontrol_cmd: 96 if self.powercontrol_cmd:
@@ -172,4 +181,3 @@ class GummibootTarget(MasterImageHardwareTarget):
172 self.power_cycle(self.master) 181 self.power_cycle(self.master)
173 # there are better ways than a timeout but this should work for now 182 # there are better ways than a timeout but this should work for now
174 time.sleep(120) 183 time.sleep(120)
175