]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: Use snapshot instead of copying the rootfs image
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Sep 2016 13:44:41 +0000 (14:44 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Sep 2016 11:06:54 +0000 (12:06 +0100)
Rather than copying images, use the snapshot option to qemu. This fixes a regression
caused by the recent runqemu changes where the wrong images were being testes since
the image is copied without the qemuboot.conf file. This means the latest image is
found by runqemu rather than the specified one, leading to various confused testing
results.

It could be fixed by copying more files but use snapshot mode instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/targetcontrol.py
meta/lib/oeqa/utils/qemurunner.py

index 3209ef0430482d0d55ef9f04ab33fb43f5d6d14e..24669f461dabc6faf2c2ebbdba91c21d61285041 100644 (file)
@@ -119,8 +119,7 @@ class QemuTarget(BaseTarget):
 
         self.image_fstype = self.get_image_fstype(d)
         self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
-        self.origrootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),  d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
-        self.rootfs = os.path.join(self.testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.' + self.image_fstype)
+        self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),  d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
         self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
         dump_target_cmds = d.getVar("testimage_dump_target", True)
         dump_host_cmds = d.getVar("testimage_dump_host", True)
@@ -166,11 +165,7 @@ class QemuTarget(BaseTarget):
         self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
 
     def deploy(self):
-        try:
-            bb.utils.mkdirhier(self.testdir)
-            shutil.copyfile(self.origrootfs, self.rootfs)
-        except Exception as e:
-            bb.fatal("Error copying rootfs: %s" % e)
+        bb.utils.mkdirhier(self.testdir)
 
         qemuloglink = os.path.join(self.testdir, "qemu_boot_log")
         if os.path.islink(qemuloglink):
index 2158d69400de3c98e8170ce6c0f1edce00cd18ee..9783ff88a5c388a313abbb5ac0ae7c6be5c30f59 100644 (file)
@@ -134,7 +134,7 @@ class QemuRunner:
         self.origchldhandler = signal.getsignal(signal.SIGCHLD)
         signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
 
-        launch_cmd = 'runqemu '
+        launch_cmd = 'runqemu snapshot '
         if self.use_kvm:
             logger.info('Using kvm for runqemu')
             launch_cmd += 'kvm '