summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index dea519e6df..f7a2533746 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -263,6 +263,80 @@ PNBLACKLIST[busybox] = "Don't build this"
263 263
264 bitbake("--graphviz core-image-sato") 264 bitbake("--graphviz core-image-sato")
265 265
266 def test_fit_image(self):
267 """
268 Summary: Check if FIT image and Image Tree Source (its) are built
269 and the Image Tree Source has the correct fields.
270 Expected: 1. fitImage and fitImage-its can be built
271 2. The type, load address, entrypoint address and
272 default values of kernel and ramdisk are as expected
273 in the Image Tree Source. Not all the fields are tested,
274 only the key fields that wont vary between different
275 architectures.
276 Product: oe-core
277 Author: Usama Arif <usama.arif@arm.com>
278 """
279 config = """
280# Enable creation of fitImage
281KERNEL_IMAGETYPE = "Image"
282KERNEL_IMAGETYPES += " fitImage "
283KERNEL_CLASSES = " kernel-fitimage "
284
285# RAM disk variables including load address and entrypoint for kernel and RAM disk
286IMAGE_FSTYPES += "cpio.gz"
287INITRAMFS_IMAGE = "core-image-minimal"
288UBOOT_RD_LOADADDRESS = "0x88000000"
289UBOOT_RD_ENTRYPOINT = "0x88000000"
290UBOOT_LOADADDRESS = "0x80080000"
291UBOOT_ENTRYPOINT = "0x80080000"
292"""
293 self.write_config(config)
294
295 # fitImage is created as part of linux recipe
296 bitbake("virtual/kernel")
297
298 image_type = "core-image-minimal"
299 deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
300 machine = get_bb_var('MACHINE')
301 fitimage_its_path = os.path.join(deploy_dir_image,
302 "fitImage-its-%s-%s-%s" % (image_type, machine, machine))
303 fitimage_path = os.path.join(deploy_dir_image,
304 "fitImage-%s-%s-%s" % (image_type, machine, machine))
305
306 self.assertTrue(os.path.exists(fitimage_its_path),
307 "%s image tree source doesn't exist" % (fitimage_its_path))
308 self.assertTrue(os.path.exists(fitimage_path),
309 "%s FIT image doesn't exist" % (fitimage_path))
310
311 # Check that the type, load address, entrypoint address and default
312 # values for kernel and ramdisk in Image Tree Source are as expected.
313 # The order of fields in the below array is important. Not all the
314 # fields are tested, only the key fields that wont vary between
315 # different architectures.
316 its_field_check = ['type = "kernel";',
317 'load = <0x80080000>;',
318 'entry = <0x80080000>;',
319 'type = "ramdisk";',
320 'load = <0x88000000>;',
321 'entry = <0x88000000>;',
322 'default = "conf@1";',
323 'kernel = "kernel@1";',
324 'ramdisk = "ramdisk@1";'
325 ]
326
327 with open(fitimage_its_path) as its_file:
328 field_index = 0
329 for line in its_file:
330 if field_index == len(its_field_check):
331 break
332 if its_field_check[field_index] in line:
333 field_index +=1
334
335 if field_index != len(its_field_check): # if its equal, the test passed
336 self.assertTrue(field_index == len(its_field_check),
337 "Fields in Image Tree Source File %s did not match, error in finding %s"
338 % (fitimage_its_path, its_field_check[field_index]))
339
266 def test_image_gen_debugfs(self): 340 def test_image_gen_debugfs(self):
267 """ 341 """
268 Summary: Check debugfs generation 342 Summary: Check debugfs generation