X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestNode.py;h=f8545e9f8d299f3e9b4634a0d3ef79091073e34a;hb=2d81c36417ec9fef607d93737ee6f74573ddaf45;hp=aacd63d8fd92dfa14ee2c89a48510a0ef0f38e57;hpb=d62d923bfc6c56e43db497d0feb7c83261402468;p=tests.git diff --git a/system/TestNode.py b/system/TestNode.py index aacd63d..f8545e9 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -11,7 +11,7 @@ class TestNode: self.test_plc=test_plc self.test_site=test_site self.node_spec=node_spec - + def name(self): return self.node_spec['node_fields']['hostname'] @@ -126,21 +126,21 @@ class TestNode: def configure_qemu(self): if not self.is_qemu(): return - mac=self.node_spec['network_fields']['mac'] conf_filename="%s/start-qemu.conf"%(self.areaname()) utils.header('Storing qemu config for %s in %s'%(self.name(),conf_filename)) file=open(conf_filename,'w') - file.write('MACADDR=%s\n'%mac) file.write('NODE_ISO=%s.iso\n'%self.name()) file.close() # if relevant, push the qemu area onto the host box if ( not self.test_box().is_local()): utils.header ("Transferring configuration files for node %s onto %s"%(self.name(),self.host_box())) - self.test_box().clean_dir() - self.test_box().mkdir() + self.test_box().clean_dir(self.buildname()) + self.test_box().mkdir(self.buildname()) + self.test_box().mkdir("nodeslogs") self.test_box().copy(self.areaname(),recursive=True) + def start_node (self,options): model=self.node_spec['node_fields']['model'] #starting the Qemu nodes before @@ -154,8 +154,13 @@ class TestNode: utils.header("Starting qemu node %s on %s"%(self.name(),test_box.hostname())) test_box.run_in_buildname("qemu-%s/env-qemu start >> nodeslogs/%s.log"%(self.name(),self.name())) - test_box.run_in_buildname("qemu-%s/start-qemu-node 2>&1 >> nodeslogs/%s.log &"%( - self.name(),self.name())) + test_box.run_in_buildname("qemu-%s/start-qemu-node 2>&1 >> nodeslogs/%s.log &"%(self.name(),self.name())) + + def list_qemu (self): + utils.header("Listing qemu for host %s on box %s"%(self.name(),self.test_box().hostname())) + command="qemu-%s/kill-qemu-node -l %s"%(self.name(),self.name()) + self.test_box().run_in_buildname(command) + return True def kill_qemu (self): #Prepare the log file before killing the nodes @@ -164,6 +169,6 @@ class TestNode: utils.header("Failed to get the nodes log files") # kill the right processes utils.header("Stopping qemu for host %s on box %s"%(self.name(),self.test_box().hostname())) - command="qemu_kill.sh %s"%self.name() + command="qemu-%s/kill-qemu-node %s"%(self.name(),self.name()) self.test_box().run_in_buildname(command) return True