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,buildname)
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 return self.test_ssh.run_in_buildname (command)
31 # should use rsync instead
32 def copy (self,local_file,recursive=False):
33 return self.test_ssh.copy (local_file,recursive=False)
38 return utils.system("rm -rf %s"%self.buildname)
43 return utils.system("mkdir %s"%self.buildname)
45 def kill_all_qemus(self):
46 self.run_in_buildname("killall qemu")