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.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
index c6fc7d60e0..d151e24bd7 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -87,7 +87,6 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
87 if self.powercontrol_cmd: 87 if self.powercontrol_cmd:
88 if self.powercontrol_args: 88 if self.powercontrol_args:
89 self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args) 89 self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
90 self.power_ctl("on")
91 if self.serialcontrol_cmd: 90 if self.serialcontrol_cmd:
92 if self.serialcontrol_args: 91 if self.serialcontrol_args:
93 self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args) 92 self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
@@ -108,13 +107,25 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
108 if status != 0: 107 if status != 0:
109 bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output) 108 bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output)
110 109
110 def _wait_until_booted(self):
111 ''' Waits until the target device has booted (if we have just power cycled it) '''
112 # Subclasses with better methods of determining boot can override this
113 time.sleep(120)
114
111 def deploy(self): 115 def deploy(self):
112 bb.plain("%s - deploying image on target" % self.pn)
113 # base class just sets the ssh log file for us 116 # base class just sets the ssh log file for us
114 super(MasterImageHardwareTarget, self).deploy() 117 super(MasterImageHardwareTarget, self).deploy()
115 self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port) 118 self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
116 status, output = self.master.run("cat /etc/masterimage") 119 status, output = self.master.run("cat /etc/masterimage")
117 if status != 0: 120 if status != 0:
121 # We're not booted into the master image, so try rebooting
122 bb.plain("%s - booting into the master image" % self.pn)
123 self.power_ctl("cycle")
124 self._wait_until_booted()
125
126 bb.plain("%s - deploying image on target" % self.pn)
127 status, output = self.master.run("cat /etc/masterimage")
128 if status != 0:
118 bb.fatal("No ssh connectivity or target isn't running a master image.\n%s" % output) 129 bb.fatal("No ssh connectivity or target isn't running a master image.\n%s" % output)
119 if self.user_cmds: 130 if self.user_cmds:
120 self.deploy_cmds = self.user_cmds.split("\n") 131 self.deploy_cmds = self.user_cmds.split("\n")