From 14ee7213ec63e55d202337ec3a08c7ba88ab638e Mon Sep 17 00:00:00 2001 From: Stefan Stanacar Date: Fri, 12 Jul 2013 12:15:19 +0300 Subject: [PATCH] classes/testimage.bbclass: use a copy of rootfs for tests Make a copy of the rootfs and test that. We can now drop the snapshot option. (From OE-Core rev: ba58f1fe8fb7a0e3ff9320dfc108235d484da6a1) Signed-off-by: Stefan Stanacar Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/classes/testimage.bbclass | 9 ++++++++- meta/lib/oeqa/utils/qemurunner.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 22f0a92..940520f 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass @@ -22,6 +22,7 @@ def testimage_main(d): import os import oeqa.runtime import re + import shutil from oeqa.oetest import runTests from oeqa.utils.sshcontrol import SSHControl from oeqa.utils.qemurunner import QemuRunner @@ -61,7 +62,13 @@ def testimage_main(d): # and boot each supported fs type machine=d.getVar("MACHINE", True) #will handle fs type eventually, stick with ext3 for now - rootfs=d.getVar("DEPLOY_DIR_IMAGE", True) + '/' + d.getVar("IMAGE_BASENAME",True) + '-' + machine + '.ext3' + #make a copy of the original rootfs and use that for tests + origrootfs=os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME",True) + '.ext3') + rootfs=os.path.join(testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.ext3') + try: + shutil.copyfile(origrootfs, rootfs) + except Exception as e: + bb.fatal("Error copying rootfs: %s" % e) qemu = QemuRunner(machine, rootfs) qemu.tmpdir = d.getVar("TMPDIR", True) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index ec92988..1051b2b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -18,7 +18,7 @@ class QemuRunner: self.rootfs = rootfs self.streampath = '/tmp/qemuconnection.%s' % os.getpid() - self.qemuparams = 'bootparams="console=ttyS0" qemuparams="-snapshot -serial unix:%s,server,nowait"' % self.streampath + self.qemuparams = 'bootparams="console=ttyS0" qemuparams="-serial unix:%s,server,nowait"' % self.streampath self.qemupid = None self.ip = None -- 2.7.4