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
10 def __init__(self,hostname,buildname,key=None):
11 self.hostname_value=hostname
12 self.buildname=buildname
14 self.test_ssh=TestSsh(self.hostname_value,self.buildname,self.key)
17 return self.hostname_value
20 return self.test_ssh.is_local()
23 if os.path.isdir("nodeslogs"):
24 tar_command="tar cvf nodeslogs.tar nodeslogs/"
25 self.run_in_buildname (tar_command)
29 def run_in_buildname (self,command):
30 utils.header("Running command %s on testbox %s"%(command,self.hostname()))
31 return self.test_ssh.run_in_buildname (command)
33 # should use rsync instead
34 def copy (self,local_file,recursive=False):
35 return self.test_ssh.copy (local_file,recursive)
37 def clean_dir (self,dirname):
38 return self.test_ssh.clean_dir(dirname)
40 def mkdir (self,direname):
41 return self.test_ssh.mkdir(direname)
43 def kill_all_qemus(self):
44 self.run_in_buildname("template-qemu/kill-qemu-node")
47 def list_all_qemus(self):
48 self.run_in_buildname("template-qemu/kill-qemu-node -l")