summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com>2020-10-21 16:55:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-22 12:56:52 +0100
commit1f8bdaa746c6e7efc07789256d5c050780c81f4c (patch)
tree7b4fa58cd8f458db32e165065fba8dcc423ba7f6
parent5a0237ad40457bbaedcc3f0e6c130612981eece3 (diff)
downloadopenembedded-core-1f8bdaa746c6e7efc07789256d5c050780c81f4c.tar.gz
imagefeatures: New test case, test_empty_image, added
An empty image build file exists under the meta-selftest folder, test-empty-image.bb, which builds an image with no additional packages. However, there were no further selftest created to verify its emptiness This change consists of the selftest related to the said image to verify its emptiness and the 'import glob' moved as global import instead of local import. The expected outcome of the test should be TRUE or 1 if the .manifest file content is empty. [YOCTO #8455] Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index f7a2533746..415e0315fc 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -5,6 +5,7 @@
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.sshcontrol import SSHControl
+import glob
import os
import json
@@ -347,7 +348,7 @@ UBOOT_ENTRYPOINT = "0x80080000"
Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Yeoh Ee Peng <ee.peng.yeoh@intel.com>
"""
- import glob
+
image_name = 'core-image-minimal'
features = 'IMAGE_GEN_DEBUGFS = "1"\n'
features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
@@ -368,3 +369,12 @@ UBOOT_ENTRYPOINT = "0x80080000"
for t in dbg_symbols_targets:
result = runCmd('objdump --syms %s | grep debug' % t)
self.assertTrue("debug" in result.output, msg='Failed to find debug symbol: %s' % result.output)
+
+ def test_empty_image(self):
+ """Test creation of image with no packages"""
+ bitbake('test-empty-image')
+ res_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+ images = os.path.join(res_dir, "test-empty-image-*.manifest")
+ result = glob.glob(images)
+ with open(result[1],"r") as f:
+ self.assertEqual(len(f.read().strip()),0)