2 # this models a box that hosts qemu nodes
3 # could probably also be used for boxes that host plc instances
6 from TestSsh import TestSsh
8 # xxx this should probably inherit TestSsh
11 def __init__(self,hostname,buildname,key=None):
12 self.hostname_value=hostname
13 self.buildname=buildname
15 self.test_ssh=TestSsh(self.hostname_value,self.buildname,self.key)
18 return self.hostname_value
21 return self.test_ssh.is_local()
23 def run_in_buildname (self,command,background=False):
24 utils.header("Running command %s on testbox %s"%(command,self.hostname()))
25 return self.test_ssh.run_in_buildname (command,background)
27 # xxx could/should use rsync instead
28 def copy (self,local_file,recursive=False):
29 return self.test_ssh.copy (local_file,recursive)
31 def clean_dir (self,dirname):
32 return self.test_ssh.clean_dir(dirname)
34 def mkdir (self,dirname):
35 return self.test_ssh.mkdir(dirname)
37 # we need at least one nodename, as template-qemu is not synced on remote testboxes
38 def kill_all_qemus(self,nodename):
39 self.run_in_buildname("qemu-%s/qemu-kill-node"%nodename)
42 def list_all_qemus(self):
43 self.run_in_buildname("template-qemu/qemu-kill-node -l")