oe-selftest: fitimage: Add tests for KERNEL_DTBVENDORED
PATCH 1/1 oe-selftest: fitimage: Add tests for KERNEL_DTBVENDORED
From: Ryan Eatmon <[email protected]>
The recent changes to fixing KERNEL_DTBVENDORED support and then adding the same mapping for FIT_CONF_DEFAULT_DTB exposed that we were missing tests for these two cases.
Signed-off-by Ryan Eatmon <[email protected]>
Signed-off-by Mathieu Dubois-Briand <[email protected]>
Signed-off-by Richard Purdie <[email protected]>
(cherry picked from commit de2e11e63624f86583875163e66f63ea7457c121)
Signed-off-by Marek Vasut <[email protected]>
---
OE wrynose backport required the following modifications:
- Replace self._get_machine_or_skip() and FitImageTestCase._config_add_machine_settings() with manually generated beagle config. Beagle is valid since it does have 'ti' vendor prefix.
- Drop self._gen_atf_tee_dummy_images() which is unnecessary for the test.
--- meta/lib/oeqa/selftest/cases/fitimage.py | 55 +++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-)
meta/lib/oeqa/selftest/cases/fitimage.py +53 -2
@@ -183,6 +183,16 @@ class FitImageTestCase(OESelftestTestCase): pass return a_comment + @staticmethod + def _apply_dtbvendored(bb_vars,dtb): + """ This is (and should remain) the same logic that is in kernel-fit-image.bbclass + """ + if bb_vars.get('KERNEL_DTBVENDORED') != "1": + mapped_name = os.path.basename(dtb) + else: + mapped_name = dtb.replace('/', '_') + return mapped_name + @staticmethod def _get_dtb_files(bb_vars): """Return a list of devicetree names
@@ -195,7 +205,7 @@ class FitImageTestCase(OESelftestTestCase): all_dtbs = [] dtb_symlinks = [] if kernel_devicetree: - all_dtbs += [os.path.basename(dtb) for dtb in kernel_devicetree.split()] + all_dtbs += [FitImageTestCase._apply_dtbvendored(bb_vars, dtb) for dtb in kernel_devicetree.split()] # Support only the test recipe which provides 1 devicetree and 1 devicetree overlay pref_prov_dtb = bb_vars.get('PREFERRED_PROVIDER_virtual/dtb') if pref_prov_dtb == "bbb-dtbs-as-ext":
@@ -437,6 +447,7 @@ class KernelFitImageBase(FitImageTestCase): 'INITRAMFS_IMAGE', 'KERNEL_DEPLOYSUBDIR', 'KERNEL_DEVICETREE', + 'KERNEL_DTBVENDORED', 'KERNEL_FIT_LINK_NAME', 'MACHINE', 'PREFERRED_PROVIDER_virtual/dtb',
@@ -653,7 +664,7 @@ class KernelFitImageBase(FitImageTestCase): fit_conf_default_dtb = bb_vars.get('FIT_CONF_DEFAULT_DTB') if fit_conf_default_dtb: fit_conf_prefix = bb_vars.get('FIT_CONF_PREFIX', "conf-") - its_field_check.append('default = "' + fit_conf_prefix + fit_conf_default_dtb + '";') + its_field_check.append('default = "' + fit_conf_prefix + self._apply_dtbvendored(bb_vars, fit_conf_default_dtb) + '";') # configuration nodes (one per DTB and also one per symlink) dtb_files, dtb_symlinks = FitImageTestCase._get_dtb_files(bb_vars)
@@ -1142,6 +1153,46 @@ FIT_HASH_ALG = "sha256" self._gen_signing_key(bb_vars) self._test_fitimage(bb_vars) + def test_vendored_dtb_without_kernel_dtbvendored(self): + """ + Summary: Check if FIT image and Image Tree Source (its) are created correctly with KERNEL_DTBVENDORED turned off. + Expected: 1) its and FIT image are built successfully + 2) Dumping the FIT image indicates the devicetree overlay + """ + + config = """ +MACHINE:forcevariable = "beaglebone-yocto" +UBOOT_MACHINE = "am335x_evm_defconfig" +UBOOT_ARCH = "arm" +UBOOT_DTB_BINARY = "u-boot.dtb" +KERNEL_DTBVENDORED = "0" +""" + config = self._config_add_kernel_classes(config) + config = self._config_add_uboot_env(config) + self.write_config(config) + bb_vars = self._fit_get_bb_vars() + self._test_fitimage(bb_vars) + + def test_vendored_dtb_with_kernel_dtbvendored(self): + """ + Summary: Check if FIT image and Image Tree Source (its) are created correctly with KERNEL_DTBVENDORED turned on. + Expected: 1) its and FIT image are built successfully + 2) Dumping the FIT image indicates the devicetree overlay + """ + + config = """ +MACHINE:forcevariable = "beaglebone-yocto" +UBOOT_MACHINE = "am335x_evm_defconfig" +UBOOT_ARCH = "arm" +UBOOT_DTB_BINARY = "u-boot.dtb" +KERNEL_DTBVENDORED = "1" +""" + config = self._config_add_kernel_classes(config) + config = self._config_add_uboot_env(config) + self.write_config(config) + bb_vars = self._fit_get_bb_vars() + self._test_fitimage(bb_vars) + class FitImagePyTests(KernelFitImageBase): """Test cases for the fitimage.py module without calling bitbake"""
Signature · 1 line
2.53.0