summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/controllers/masterimage.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/controllers/masterimage.py')
-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