diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 132: Format test partitions at the beginning of deployment

Message ID 20111014051812.8436.32768.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Spring Zhang Oct. 14, 2011, 5:18 a.m. UTC
Merge authors:
  Spring Zhang (qzhang)
Related merge proposals:
  https://code.launchpad.net/~qzhang/lava-dispatcher/fix-867858/+merge/78704
  proposed by: Spring Zhang (qzhang)
  review: Approve - Paul Larson (pwlars)
  review: Resubmit - Spring Zhang (qzhang)
------------------------------------------------------------
revno: 132 [merge]
committer: Spring Zhang <spring.zhang@linaro.org>
branch nick: fix-867858
timestamp: Fri 2011-10-14 13:04:20 +0800
message:
  Format test partitions at the beginning of deployment
modified:
  lava_dispatcher/actions/deploy.py
  lava_dispatcher/actions/launch_control.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py	2011-09-28 17:57:03 +0000
+++ lava_dispatcher/actions/deploy.py	2011-10-14 05:04:20 +0000
@@ -42,6 +42,7 @@ 
             logging.info("  package: %s" % kernel_matrix[0])
         logging.info("Booting master image")
         client.boot_master_image()
+        self._format_testpartition()
 
         logging.info("Waiting for network to come up")
         try:
@@ -83,6 +84,16 @@ 
         finally:
             shutil.rmtree(self.tarball_dir)
 
+    def _format_testpartition(self):
+        client = self.client
+        logging.info("Format testboot and testrootfs partitions")
+        client.run_cmd_master('umount /dev/disk/by-label/testrootfs')
+        client.run_cmd_master(
+            'mkfs.ext3 -q /dev/disk/by-label/testrootfs -L testrootfs')
+        client.run_cmd_master('umount /dev/disk/by-label/testboot')
+        client.run_cmd_master(
+            'mkfs.vfat /dev/disk/by-label/testboot -n testboot')
+
     def _get_partition_offset(self, image, partno):
         cmd = 'parted %s -m -s unit b print' % image
         part_data = getoutput(cmd)
@@ -173,9 +184,6 @@ 
     def deploy_linaro_rootfs(self, rootfs):
         client = self.client
         logging.info("Deploying linaro image")
-        client.run_cmd_master('umount /dev/disk/by-label/testrootfs')
-        client.run_cmd_master(
-            'mkfs.ext3 -q /dev/disk/by-label/testrootfs -L testrootfs')
         client.run_cmd_master('udevadm trigger')
         client.run_cmd_master('mkdir -p /mnt/root')
         client.run_cmd_master('mount /dev/disk/by-label/testrootfs /mnt/root')
@@ -199,9 +207,6 @@ 
     def deploy_linaro_bootfs(self, bootfs):
         client = self.client
         logging.info("Deploying linaro bootfs")
-        client.run_cmd_master('umount /dev/disk/by-label/testboot')
-        client.run_cmd_master(
-            'mkfs.vfat /dev/disk/by-label/testboot -n testboot')
         client.run_cmd_master('udevadm trigger')
         client.run_cmd_master('mkdir -p /mnt/boot')
         client.run_cmd_master('mount /dev/disk/by-label/testboot /mnt/boot')

=== modified file 'lava_dispatcher/actions/launch_control.py'
--- lava_dispatcher/actions/launch_control.py	2011-10-10 10:19:45 +0000
+++ lava_dispatcher/actions/launch_control.py	2011-10-13 09:28:22 +0000
@@ -113,13 +113,19 @@ 
         client.run_cmd_master('mkdir -p /mnt/root')
         client.run_cmd_master(
             'mount /dev/disk/by-label/%s /mnt/root' % result_disk)
+        # Clean results directory on master image
+        client.run_cmd_master(
+            'rm -rf /tmp/lava_results.tgz /tmp/%s' % self.context.lava_result_dir)
         client.run_cmd_master('mkdir -p /tmp/%s' % self.context.lava_result_dir)
         client.run_cmd_master(
             'cp /mnt/root/%s/*.bundle /tmp/%s' % (self.context.lava_result_dir,
                 self.context.lava_result_dir))
+        # Clean result bundle on test image
+        client.run_cmd_master(
+            'rm -f /mnt/root/%s/*.bundle' % (self.context.lava_result_dir))
         client.run_cmd_master('umount /mnt/root')
 
-        #Create tarball of all results
+        # Create tarball of all results
         logging.info("Creating lava results tarball")
         client.run_cmd_master('cd /tmp')
         client.run_cmd_master(