summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-06-09 12:16:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-12 08:25:04 +0100
commit4f3aca1a5660f8d4bc4342ba2838009a90647003 (patch)
tree3f8f7bfb1049d9dd79fb2dada23239a72d53781b /meta/lib/oeqa
parent37fffeb81fad048202f88b0d67dba78af27b10bb (diff)
downloadpoky-4f3aca1a5660f8d4bc4342ba2838009a90647003.tar.gz
wic: Fix --extra-space argument handling
467f84e12b ("wic: Add --offset argument for partitions") broke the --extra-space argument handling in wic. Fix the option and add a unit test for the argument. (From OE-Core rev: 87722a92c18f94917c8f70afc8cd0763462a5c25) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 9e7be6168e..8b58285c32 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -908,6 +908,21 @@ class Wic2(WicTestCase):
908 p, _ = self._get_wic_partitions(tempf.name, ignore_status=True) 908 p, _ = self._get_wic_partitions(tempf.name, ignore_status=True)
909 self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output) 909 self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output)
910 910
911 def test_extra_space(self):
912 native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
913
914 with NamedTemporaryFile("w", suffix=".wks") as tempf:
915 tempf.write("bootloader --ptable gpt\n" \
916 "part / --source rootfs --ondisk hda --extra-space 200M --fstype=ext4\n")
917 tempf.flush()
918
919 _, partlns = self._get_wic_partitions(tempf.name, native_sysroot)
920 self.assertEqual(len(partlns), 1)
921 size = partlns[0].split(':')[3]
922 self.assertRegex(size, r'^[0-9]+kiB$')
923 size = int(size[:-3])
924 self.assertGreaterEqual(size, 204800)
925
911 @only_for_arch(['i586', 'i686', 'x86_64']) 926 @only_for_arch(['i586', 'i686', 'x86_64'])
912 def test_rawcopy_plugin_qemu(self): 927 def test_rawcopy_plugin_qemu(self):
913 """Test rawcopy plugin in qemu""" 928 """Test rawcopy plugin in qemu"""