diff options
| -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' |
