auth=self.test_plc.auth_root()
self.test_plc.server.DeleteNode(auth,self.name())
- def get_node_status(self,hostname,host_machine):
+ def get_node_status(self,hostname,host_box):
filter=['boot_state']
status=False
node_status=self.test_plc.server.GetNodes(self.test_plc.auth_root(),hostname, filter)
def conffile(self,image,hostname,path):
model=self.node_spec['node_fields']['model']
- host_machine=self.node_spec['node_fields']['host_machine']
if model.find("vmware") >= 0:
+ host_box=self.node_spec['node_fields']['host_box']
template='%s/template-vmplayer/node.vmx'%(path)
actual='%s/vmplayer-%s/node.vmx'%(path,hostname)
sed_command="sed -e s,@BOOTCD@,%s,g %s > %s"%(image,template,actual)
utils.header('Creating %s from %s'%(actual,template))
utils.system(sed_command)
elif model.find("qemu") >= 0:
+ host_box=self.node_spec['node_fields']['host_box']
mac=self.node_spec['network_fields']['mac']
dest_dir="qemu-%s"%(hostname)
utils.header('Storing the mac address for node %s'%hostname)
file.write('%s\n'%mac)
file.write(dest_dir)
file.close()
- utils.header ('Transfert of configuration files for node %s into %s '%(hostname,host_machine))
- cleandir_command="ssh root@%s rm -rf %s"%(host_machine, dest_dir)
- createdir_command = "ssh root@%s mkdir -p %s"%(host_machine, dest_dir)
+ utils.header ('Transfert of configuration files for node %s into %s '%(hostname,host_box))
+ cleandir_command="ssh root@%s rm -rf %s"%(host_box, dest_dir)
+ createdir_command = "ssh root@%s mkdir -p %s"%(host_box, dest_dir)
utils.system(cleandir_command)
utils.system(createdir_command)
- scp_command = "scp -r %s/qemu-%s/* root@%s:/root/%s"%(path,hostname,host_machine,dest_dir)
+ scp_command = "scp -r %s/qemu-%s/* root@%s:/root/%s"%(path,hostname,host_box,dest_dir)
utils.system(scp_command)
def create_boot_cd(self,path):
utils.system('cd %s/vmplayer-%s ; DISPLAY=%s vmplayer node.vmx < /dev/null >/dev/null 2>/dev/null &'%(path,hostname,display))
def start_qemu (self, options):
- host_machine=self.node_spec['node_fields']['host_machine']
+ host_box=self.node_spec['node_fields']['host_box']
hostname=self.node_spec['node_fields']['hostname']
path=options.path
display=options.display
dest_dir="qemu-%s"%(hostname)
utils.header('Starting qemu for node %s '%(hostname))
- utils.system("ssh root@%s ~/%s/env-qemu start "%(host_machine, dest_dir ))
- utils.system("ssh root@%s DISPLAY=%s ~/%s/start-qemu-node %s & "%( host_machine, display, dest_dir, dest_dir))
+ utils.system("ssh root@%s ~/%s/env-qemu start "%(host_box, dest_dir ))
+ utils.system("ssh root@%s DISPLAY=%s ~/%s/start-qemu-node %s & "%( host_box, display, dest_dir, dest_dir))
- def stop_qemu(self,host_machine, hostname):
+ def stop_qemu(self,host_box, hostname):
utils.header('Stoping qemu emulation of %s on the host machine %s and Restoring the initial network'
- %(hostname,host_machine))
- utils.system("ssh root@%s ~/qemu-%s/env-qemu stop "%(host_machine, hostname ))
+ %(hostname,host_box))
+ utils.system("ssh root@%s ~/qemu-%s/env-qemu stop "%(host_box, hostname ))
for node_spec in site_spec['nodes']:
test_node=TestNode (self,test_site,node_spec)
model=node_spec['node_fields']['model']
- host_machine=node_spec['node_fields']['host_machine']
+ host_box=node_spec['node_fields']['host_box']
hostname=node_spec['node_fields']['hostname']
print model
if model.find("qemu") >= 0:
- utils.system('ssh root@%s killall qemu'%host_machine)
- test_node.stop_qemu(host_machine,hostname)
+ utils.system('ssh root@%s killall qemu'%host_box)
+ test_node.stop_qemu(host_box,hostname)
#################### step methods
hostname=node_spec['node_fields']['hostname']
if (hostname in notfullybooted_nodes): #to avoid requesting already booted node
test_node=TestNode (self,test_site,node_spec)
- host_machine=node_spec['node_fields']['host_machine']
- node_status=test_node.get_node_status(hostname,host_machine)
+ host_box=node_spec['node_fields']['host_box']
+ node_status=test_node.get_node_status(hostname,host_box)
if (node_status):
booted_nodes.append(hostname)
del notfullybooted_nodes[notfullybooted_nodes.index(hostname)]