Exemplo n.º 1
0
    def deploy(self):
        # base class just sets the ssh log file for us
        super(MasterImageHardwareTarget, self).deploy()
        self.master = sshcontrol.SSHControl(ip=self.ip,
                                            logfile=self.sshlog,
                                            timeout=600,
                                            port=self.port)
        status, output = self.master.run("cat /etc/masterimage")
        if status != 0:
            # We're not booted into the master image, so try rebooting
            bb.plain("%s - booting into the master image" % self.pn)
            self.power_ctl("cycle")
            self._wait_until_booted()

        bb.plain("%s - deploying image on target" % self.pn)
        status, output = self.master.run("cat /etc/masterimage")
        if status != 0:
            bb.fatal(
                "No ssh connectivity or target isn't running a master image.\n%s"
                % output)
        if self.user_cmds:
            self.deploy_cmds = self.user_cmds.split("\n")
        try:
            self._deploy()
        except Exception as e:
            bb.fatal("Failed deploying test image: %s" % e)
Exemplo n.º 2
0
 def start(self, params=None):
     bb.plain("%s - boot test image on target" % self.pn)
     self._start()
     # set the ssh object for the target/test image
     self.connection = sshcontrol.SSHControl(self.ip,
                                             logfile=self.sshlog,
                                             port=self.port)
     bb.plain("%s - start running tests" % self.pn)
Exemplo n.º 3
0
 def start(self, params=None):
     bb.plain("%s - boot test image on target" % self.pn)
     self.power_cycle(self.master)
     # there are better ways than a timeout but this should work for now
     time.sleep(120)
     # set the ssh object for the target/test image
     self.connection = sshcontrol.SSHControl(self.ip,
                                             logfile=self.sshlog,
                                             port=self.port)
     bb.plain("%s - start running tests" % self.pn)
Exemplo n.º 4
0
 def deploy(self):
     bb.plain("%s - deploying image on target" % self.pn)
     # base class just sets the ssh log file for us
     super(GummibootTarget, self).deploy()
     self.master = sshcontrol.SSHControl(ip=self.ip,
                                         logfile=self.sshlog,
                                         timeout=600,
                                         port=self.port)
     try:
         self._deploy()
     except Exception as e:
         bb.fatal("Failed deploying test image: %s" % e)
Exemplo n.º 5
0
 def deploy(self):
     super(MasterImageHardwareTarget, self).deploy()
     self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
     for cmd in self.deploy_cmds:
         os.system(cmd)