mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
b709e926d3
commit
ba2bb92331
|
@ -1065,13 +1065,14 @@ class Wic2(WicTestCase):
|
||||||
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
||||||
self.assertEqual(output, '2')
|
self.assertEqual(output, '2')
|
||||||
|
|
||||||
def test_rawcopy_plugin(self):
|
def _rawcopy_plugin(self, fstype):
|
||||||
"""Test rawcopy plugin"""
|
"""Test rawcopy plugin"""
|
||||||
img = 'core-image-minimal'
|
img = 'core-image-minimal'
|
||||||
machine = get_bb_var('MACHINE', img)
|
machine = get_bb_var('MACHINE', img)
|
||||||
|
params = ',unpack' if fstype.endswith('.gz') else ''
|
||||||
with NamedTemporaryFile("w", suffix=".wks") as wks:
|
with NamedTemporaryFile("w", suffix=".wks") as wks:
|
||||||
wks.write('part / --source rawcopy --sourceparams="file=%s-%s.ext4"\n'\
|
wks.write('part / --source rawcopy --sourceparams="file=%s-%s.%s%s"\n'\
|
||||||
% (img, machine))
|
% (img, machine, fstype, params))
|
||||||
wks.flush()
|
wks.flush()
|
||||||
cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
|
cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
|
||||||
runCmd(cmd)
|
runCmd(cmd)
|
||||||
|
@ -1079,6 +1080,17 @@ class Wic2(WicTestCase):
|
||||||
out = glob(self.resultdir + "%s-*direct" % wksname)
|
out = glob(self.resultdir + "%s-*direct" % wksname)
|
||||||
self.assertEqual(1, len(out))
|
self.assertEqual(1, len(out))
|
||||||
|
|
||||||
|
def test_rawcopy_plugin(self):
|
||||||
|
self._rawcopy_plugin('ext4')
|
||||||
|
|
||||||
|
def test_rawcopy_plugin_unpack(self):
|
||||||
|
fstype = 'ext4.gz'
|
||||||
|
config = 'IMAGE_FSTYPES = "%s"\n' % fstype
|
||||||
|
self.append_config(config)
|
||||||
|
self.assertEqual(0, bitbake('core-image-minimal').status)
|
||||||
|
self.remove_config(config)
|
||||||
|
self._rawcopy_plugin(fstype)
|
||||||
|
|
||||||
def test_empty_plugin(self):
|
def test_empty_plugin(self):
|
||||||
"""Test empty plugin"""
|
"""Test empty plugin"""
|
||||||
config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n'
|
config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user