summaryrefslogtreecommitdiffstats
path: root/meta/lib
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-26 22:08:36 +0000
commitfe15f9983b180a927681260a4c4bb6c878595a1f (patch)
tree655520a5efa2e24298d8e17900cbc8e1f18358a3 /meta/lib
parent73fe05a48c9ac5038bd342c08db1e7d81fc9f8ec (diff)
downloadpoky-fe15f9983b180a927681260a4c4bb6c878595a1f.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] (From OE-Core rev: 1f8bdaa746c6e7efc07789256d5c050780c81f4c) Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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 @@
5from oeqa.selftest.case import OESelftestTestCase 5from oeqa.selftest.case import OESelftestTestCase
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu 6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
7from oeqa.utils.sshcontrol import SSHControl 7from oeqa.utils.sshcontrol import SSHControl
8import glob
8import os 9import os
9import json 10import json
10 11
@@ -347,7 +348,7 @@ UBOOT_ENTRYPOINT = "0x80080000"
347 Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com> 348 Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
348 Yeoh Ee Peng <ee.peng.yeoh@intel.com> 349 Yeoh Ee Peng <ee.peng.yeoh@intel.com>
349 """ 350 """
350 import glob 351
351 image_name = 'core-image-minimal' 352 image_name = 'core-image-minimal'
352 features = 'IMAGE_GEN_DEBUGFS = "1"\n' 353 features = 'IMAGE_GEN_DEBUGFS = "1"\n'
353 features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n' 354 features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
@@ -368,3 +369,12 @@ UBOOT_ENTRYPOINT = "0x80080000"
368 for t in dbg_symbols_targets: 369 for t in dbg_symbols_targets:
369 result = runCmd('objdump --syms %s | grep debug' % t) 370 result = runCmd('objdump --syms %s | grep debug' % t)
370 self.assertTrue("debug" in result.output, msg='Failed to find debug symbol: %s' % result.output) 371 self.assertTrue("debug" in result.output, msg='Failed to find debug symbol: %s' % result.output)
372
373 def test_empty_image(self):
374 """Test creation of image with no packages"""
375 bitbake('test-empty-image')
376 res_dir = get_bb_var('DEPLOY_DIR_IMAGE')
377 images = os.path.join(res_dir, "test-empty-image-*.manifest")
378 result = glob.glob(images)
379 with open(result[1],"r") as f:
380 self.assertEqual(len(f.read().strip()),0)