split qemu_export into clean & export, make it safer to re-use run_log
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 24 Apr 2013 14:45:56 +0000 (16:45 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 24 Apr 2013 14:45:56 +0000 (16:45 +0200)
system/TestNode.py
system/TestPlc.py

index 9447fd6..c9d31f8 100644 (file)
@@ -201,6 +201,12 @@ class TestNode:
         file.close()
         return True
 
+    def qemu_clean (self):
+        utils.header("Cleaning up qemu for host %s on box %s"%(self.name(),self.test_box().hostname()))
+        dry_run=self.dry_run()
+        self.test_box().rmdir(self.nodedir(), dry_run=dry_run)
+        return True
+
     def qemu_export (self):
         "all nodes: push local node-dep directory on the qemu box"
         # if relevant, push the qemu area onto the host box
@@ -208,7 +214,6 @@ class TestNode:
             return True
         dry_run=self.dry_run()
         utils.header ("Cleaning any former sequel of %s on %s"%(self.name(),self.host_box()))
-        self.test_box().rmdir(self.nodedir(), dry_run=dry_run)
         utils.header ("Transferring configuration files for node %s onto %s"%(self.name(),self.host_box()))
         return self.test_box().copy(self.nodedir(),recursive=True,dry_run=dry_run)==0
             
@@ -244,12 +249,6 @@ class TestNode:
         self.test_box().run_in_buildname(command, dry_run=self.dry_run())
         return True
 
-    def clean_qemu (self):
-        utils.header("Cleaning up qemu for host %s on box %s"%(self.name(),self.test_box().hostname()))
-        command="rm -rf %s"%(self.nodedir())
-        self.test_box().run_in_buildname(command, dry_run=self.dry_run())
-        return True
-
     def kill_qemu (self):
         #Prepare the log file before killing the nodes
         test_box = self.test_box()
index c1486e2..cda7874 100644 (file)
@@ -92,7 +92,7 @@ class TestPlc:
 # keep this our of the way for now
 #        'check_vsys_defaults', SEP,
         'nodestate_reinstall', 'qemu_local_init','bootcd', 'qemu_local_config', SEP,
-        'qemu_export', 'qemu_kill_mine', 'qemu_start', 'timestamp_qemu', SEP,
+        'qemu_kill_mine','qemu_clean_mine', 'qemu_export', 'qemu_start', 'timestamp_qemu', SEP,
         'sfa_install_all', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', SEPSFA,
         'sfi_configure@1', 'sfa_add_site@1','sfa_add_pi@1', SEPSFA,
         'sfa_add_user@1', 'sfa_update_user@1', 'sfa_add_slice@1', 'sfa_renew_slice@1', SEPSFA,
@@ -115,7 +115,7 @@ class TestPlc:
         'delete_leases', 'list_leases', SEP,
         'populate', SEP,
         'nodestate_show','nodestate_safeboot','nodestate_boot', SEP,
-        'qemu_list_all', 'qemu_list_mine', 'qemu_kill_all', 'qemu_clean_mine', SEP,
+        'qemu_list_all', 'qemu_list_mine', 'qemu_kill_all', SEP,
        'sfa_install_core', 'sfa_install_sfatables', 'sfa_install_plc', 'sfa_install_client', SEPSFA,
         'sfa_plcclean', 'sfa_dbclean', 'sfa_stop','sfa_uninstall', 'sfi_clean', SEPSFA,
         'plc_db_dump' , 'plc_db_restore', SEP,
@@ -387,7 +387,7 @@ class TestPlc:
         for (box,nodes) in self.get_BoxNodes().iteritems():
             # the fine-grain version
             for node in nodes:
-                node.clean_qemu()
+                node.qemu_clean()
         return True
 
     # kill only the right qemus