diff options
author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2022-02-14 16:45:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-16 09:46:29 +0000 |
commit | ba2bb923314d12ab3b94e608d59be0fb212cb05a (patch) | |
tree | ba358a6dee0bb68ccfedc29f2d016ccd2b05fe15 /meta/lib/oeqa/selftest/cases/wic.py | |
parent | b709e926d3a3a50b4f8c016ba1f17b0f9cdb3118 (diff) | |
download | poky-ba2bb923314d12ab3b94e608d59be0fb212cb05a.tar.gz |
selftest: wic: Add rawcopy plugin unpack test
(From OE-Core rev: 0e4a030948707ef74f9c977d2d02d9f92c119f7e)
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.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.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 96b3e1b6a5..a021f8d84b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -1065,13 +1065,14 @@ class Wic2(WicTestCase): | |||
1065 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 1065 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |
1066 | self.assertEqual(output, '2') | 1066 | self.assertEqual(output, '2') |
1067 | 1067 | ||
1068 | def test_rawcopy_plugin(self): | 1068 | def _rawcopy_plugin(self, fstype): |
1069 | """Test rawcopy plugin""" | 1069 | """Test rawcopy plugin""" |
1070 | img = 'core-image-minimal' | 1070 | img = 'core-image-minimal' |
1071 | machine = get_bb_var('MACHINE', img) | 1071 | machine = get_bb_var('MACHINE', img) |
1072 | params = ',unpack' if fstype.endswith('.gz') else '' | ||
1072 | with NamedTemporaryFile("w", suffix=".wks") as wks: | 1073 | with NamedTemporaryFile("w", suffix=".wks") as wks: |
1073 | wks.write('part / --source rawcopy --sourceparams="file=%s-%s.ext4"\n'\ | 1074 | wks.write('part / --source rawcopy --sourceparams="file=%s-%s.%s%s"\n'\ |
1074 | % (img, machine)) | 1075 | % (img, machine, fstype, params)) |
1075 | wks.flush() | 1076 | wks.flush() |
1076 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | 1077 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) |
1077 | runCmd(cmd) | 1078 | runCmd(cmd) |
@@ -1079,6 +1080,17 @@ class Wic2(WicTestCase): | |||
1079 | out = glob(self.resultdir + "%s-*direct" % wksname) | 1080 | out = glob(self.resultdir + "%s-*direct" % wksname) |
1080 | self.assertEqual(1, len(out)) | 1081 | self.assertEqual(1, len(out)) |
1081 | 1082 | ||
1083 | def test_rawcopy_plugin(self): | ||
1084 | self._rawcopy_plugin('ext4') | ||
1085 | |||
1086 | def test_rawcopy_plugin_unpack(self): | ||
1087 | fstype = 'ext4.gz' | ||
1088 | config = 'IMAGE_FSTYPES = "%s"\n' % fstype | ||
1089 | self.append_config(config) | ||
1090 | self.assertEqual(0, bitbake('core-image-minimal').status) | ||
1091 | self.remove_config(config) | ||
1092 | self._rawcopy_plugin(fstype) | ||
1093 | |||
1082 | def test_empty_plugin(self): | 1094 | def test_empty_plugin(self): |
1083 | """Test empty plugin""" | 1095 | """Test empty plugin""" |
1084 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' | 1096 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' |