]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/testimage.bbclass: use a copy of rootfs for tests
authorStefan Stanacar <stefanx.stanacar@intel.com>
Fri, 12 Jul 2013 09:15:19 +0000 (12:15 +0300)
committerSaul Wold <sgw@linux.intel.com>
Mon, 15 Jul 2013 17:29:27 +0000 (10:29 -0700)
Make a copy of the rootfs and test that.
We can now drop the snapshot option.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/testimage.bbclass
meta/lib/oeqa/utils/qemurunner.py

index 22f0a9269dc2fd0d2ef20ef8d9b9d5d43e6d8cf3..940520ffd6b734c0481c975205614ab5d1ca83f1 100644 (file)
@@ -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)
index ec9298863a4c1c987111222b580d671dba6e7ebd..1051b2b3d83e2c7238e638fca9756bc881eec4d8 100644 (file)
@@ -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