+ if model.find("qemu") >= 0:
+ clean_dir="rm -rf %s/qemu-%s"%(path,hostname)
+ mkdir_command="mkdir -p %s/qemu-%s"%(path,hostname)
+ utils.system(clean_dir)
+ utils.system(mkdir_command)
+ copy_command="cp -r %s/template-Qemu/* %s/qemu-%s"%(path,path,hostname)
+ utils.system(copy_command)
+ utils.header('Creating boot medium for node %s'%hostname)
+ file=open(path+'/qemu-'+hostname+'/boot_file.iso','w')
+ else:
+ nodepath="%s/real-%s"%(path,hostname)
+ utils.system("rm -rf %s"%nodepath)
+ utils.system("mkdir %s"%nodepath)
+ file=open("%s/%s"%(nodepath,"/boot_file.iso"),'w')
+
+ file.write(base64.b64decode(encoded))
+ file.close()
+ utils.header('boot cd created for %s'%hostname)
+ self.conffile('boot_file.iso',hostname, path)
+
+ def start_node (self,options):
+ model=self.node_spec['node_fields']['model']
+ #starting the Qemu nodes before
+ if model.find("qemu") >= 0:
+ self.start_qemu(options)
+ else:
+ utils.header("TestNode.start_node : ignoring model %s"%model)
+
+ def get_host_in_hostbox(self,hostbox,test_site):
+ hosts=[]
+ for node_spec in test_site.site_spec['nodes']:
+ if (node_spec['host_box'] == hostbox):
+ hosts.append((node_spec['node_fields']['hostname'],node_spec['node_fields']['model']))
+ return hosts
+
+ def start_qemu (self, options):
+ utils.header("Starting Qemu nodes")
+ host_box=self.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))
+ self.test_plc.run_in_host("ssh root@%s ~/%s/%s/env-qemu start"%(host_box, path, dest_dir ))
+ self.test_plc.run_in_host("ssh root@%s DISPLAY=%s ~/%s/start-qemu-node %s & "%( host_box, display, dest_dir, dest_dir))
+
+ def stop_qemu(self,node_spec):