summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/wic.py
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2020-12-08 11:42:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-15 22:51:56 +0000
commit75b74f6b8d8eb69dd5e15e71243dea5c34ab36c9 (patch)
tree22ec7a400e672f9c598e4021d730a4f13c63c5e3 /meta/lib/oeqa/selftest/cases/wic.py
parent3cc6465464574ccf6308d0ba6b8b90cb64de1937 (diff)
downloadpoky-75b74f6b8d8eb69dd5e15e71243dea5c34ab36c9.tar.gz
wic: Introduce empty plugin to create unformatted empty partitions
The empty wic plugin is used to create unformatted empty partitions for wic images. To use it you must pass "empty" as argument for the "--source" parameter in the wks file. For example: part foo --source empty --ondisk sda --size="1024" --align 1024 Also adds a selftest for this plugin where the 'Fstype' column from 'wic ls' should be empty for the second partition as listed in test_empty_plugin.wks. (From OE-Core rev: 77d174fc80663403ef76c5b808aafc1117d3545c) Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/wic.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 714637ec1e..091f0ab47c 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -990,6 +990,26 @@ class Wic2(WicTestCase):
990 out = glob(self.resultdir + "%s-*direct" % wksname) 990 out = glob(self.resultdir + "%s-*direct" % wksname)
991 self.assertEqual(1, len(out)) 991 self.assertEqual(1, len(out))
992 992
993 def test_empty_plugin(self):
994 """Test empty plugin"""
995 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n'
996 self.append_config(config)
997 self.assertEqual(0, bitbake('core-image-minimal').status)
998 self.remove_config(config)
999
1000 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
1001 deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
1002 machine = bb_vars['MACHINE']
1003 image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine)
1004 self.assertEqual(True, os.path.exists(image_path))
1005
1006 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
1007
1008 # Fstype column from 'wic ls' should be empty for the second partition
1009 # as listed in test_empty_plugin.wks
1010 result = runCmd("wic ls %s -n %s | awk -F ' ' '{print $1 \" \" $5}' | grep '^2' | wc -w" % (image_path, sysroot))
1011 self.assertEqual('1', result.output)
1012
993 @only_for_arch(['i586', 'i686', 'x86_64']) 1013 @only_for_arch(['i586', 'i686', 'x86_64'])
994 def test_biosplusefi_plugin_qemu(self): 1014 def test_biosplusefi_plugin_qemu(self):
995 """Test biosplusefi plugin in qemu""" 1015 """Test biosplusefi plugin in qemu"""