summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 680f99d381..44442e402d 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -215,6 +215,47 @@ class Wic(WicTestCase):
215 found, "The kernel image '{}' was not found in the boot partition".format(kimgtype) 215 found, "The kernel image '{}' was not found in the boot partition".format(kimgtype)
216 ) 216 )
217 217
218 @skipIfNotArch(['x86_64'])
219 def test_grub_install_pcbios(self):
220 """
221 Test the installation of the grub modules + config
222 into the boot directory in the resulting wic image.
223 """
224
225 # create a temporary file for the WKS content
226 with NamedTemporaryFile("w", suffix=".wks") as wks:
227 wks.write(
228 'part --source bootimg_pcbios --sourceparams="loader-bios=grub" '
229 '--offset 1024 --fixed-size 78M --label boot --active\n'
230 'bootloader --ptable msdos --source bootimg_pcbios\n'
231 )
232 wks.flush()
233 # create a temporary directory to extract the disk image to
234 with TemporaryDirectory() as tmpdir:
235 img = "core-image-minimal"
236 config = 'DEPENDS:pn-%s += "grub-native grub"' % (img)
237
238 self.append_config(config)
239 bitbake(img)
240 self.remove_config(config)
241
242 cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
243 runCmd(cmd)
244
245 wksname = os.path.splitext(os.path.basename(wks.name))[0]
246 out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
247 self.assertEqual(1, len(out))
248
249 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
250
251 # Check if grub.cfg is installed
252 result = runCmd("wic ls %s:1/boot/grub -n %s" % (out[0], sysroot))
253 self.assertIn('grub', result.output)
254
255 # Check if normal.mod is installed
256 result = runCmd("wic ls %s:1/boot/grub/i386-pc -n %s" % (out[0], sysroot))
257 self.assertIn('normal', result.output)
258
218 def test_build_image_name(self): 259 def test_build_image_name(self):
219 """Test wic create wictestdisk --image-name=core-image-minimal""" 260 """Test wic create wictestdisk --image-name=core-image-minimal"""
220 cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir 261 cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir