pass the MAC address and the HOSTNAME to the qemu conf file
[tests.git] / system / TestNode.py
index 7b5bccd..d44a159 100644 (file)
@@ -127,11 +127,13 @@ class TestNode:
         if not self.is_qemu():
             return
         mac=self.node_spec['network_fields']['mac']
-        conf_filename="%s/start-qemu.conf"%(self.areaname())
+        hostname=self.node_spec['node_fields']['hostname']
+        conf_filename="%s/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.write('HOSTNAME=%s\n'%hostname)
         file.close()
 
         # if relevant, push the qemu area onto the host box
@@ -158,6 +160,12 @@ class TestNode:
         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()))
 
+    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
         test_box = self.test_box()
@@ -165,6 +173,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