diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-06-09 12:16:31 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-06 14:15:22 +0100 |
commit | c52e34c2bfd20df3448d8b8cfe938935905c2bf0 (patch) | |
tree | 93c014185c8af01d018ef3f8ce8e8bc978f99f59 /meta/lib | |
parent | 343a7e2c61f97507d0a80ea54fb7457e28ce77e0 (diff) | |
download | poky-c52e34c2bfd20df3448d8b8cfe938935905c2bf0.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: 62a7a10c31bcf133cbd99d4de928f15a30e45ab1)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 87722a92c18f94917c8f70afc8cd0763462a5c25)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 15 |
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 6d4068a527..a166d3f614 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -757,6 +757,21 @@ class Wic2(WicTestCase): | |||
757 | p, _ = self._get_wic_partitions(tempf.name, ignore_status=True) | 757 | p, _ = self._get_wic_partitions(tempf.name, ignore_status=True) |
758 | self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output) | 758 | self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output) |
759 | 759 | ||
760 | def test_extra_space(self): | ||
761 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") | ||
762 | |||
763 | with NamedTemporaryFile("w", suffix=".wks") as tempf: | ||
764 | tempf.write("bootloader --ptable gpt\n" \ | ||
765 | "part / --source rootfs --ondisk hda --extra-space 200M --fstype=ext4\n") | ||
766 | tempf.flush() | ||
767 | |||
768 | _, partlns = self._get_wic_partitions(tempf.name, native_sysroot) | ||
769 | self.assertEqual(len(partlns), 1) | ||
770 | size = partlns[0].split(':')[3] | ||
771 | self.assertRegex(size, r'^[0-9]+kiB$') | ||
772 | size = int(size[:-3]) | ||
773 | self.assertGreaterEqual(size, 204800) | ||
774 | |||
760 | @only_for_arch(['i586', 'i686', 'x86_64']) | 775 | @only_for_arch(['i586', 'i686', 'x86_64']) |
761 | def test_rawcopy_plugin_qemu(self): | 776 | def test_rawcopy_plugin_qemu(self): |
762 | """Test rawcopy plugin in qemu""" | 777 | """Test rawcopy plugin in qemu""" |