binman: test: Move vendor-specific test files to test/vendor/

Move about 20 test files for vendor-specific platform support (TI, NXP
i.MX, Renesas R-Car, Rockchip, PowerPC MPC85xx) into a vendor/
subdirectory. Drop the numeric prefixes and update all references.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2026-03-06 11:12:42 -07:00
parent 90a2b8c53d
commit 9c17d547c4
21 changed files with 28 additions and 28 deletions

View File

@@ -457,7 +457,7 @@ can, which contains the new etype. Put it in a numbered file in
``tool/binman/test`` so that it comes last. All the numbers are unique and there
are no gaps.
Example from ``tools/binman/test/339_nxp_imx8.dts``:
Example from ``tools/binman/test/vendor/nxp_imx8.dts``:
.. code-block:: devicetree
@@ -493,7 +493,7 @@ Then create your test by adding a new function at the end of ``ftest.py``:
def testNxpImx8Image(self):
"""Test that binman can produce an iMX8 image"""
self._DoTestFile('339_nxp_imx8.dts')
self._DoTestFile('vendor/nxp_imx8.dts')
This uses the test file that you created. It doesn't check anything, it just
runs the image description through binman.
@@ -517,7 +517,7 @@ The next step is to update it to actually check the output:
def testNxpImx8Image(self):
"""Test that binman can produce an iMX8 image"""
data = self._DoReadFile('339_nxp_imx8.dts')
data = self._DoReadFile('vendor/nxp_imx8.dts')
print('data', len(data))
The ``_DoReadFile()`` function is documented in the code. It returns the image
@@ -573,7 +573,7 @@ In the above example, here are some possible steps:
def testNxpImx8ImageMkimageMissing(self):
"""Test that binman can produce an iMX8 image"""
with terminal.capture() as (_, stderr):
self._DoTestFile('339_nxp_imx8.dts',
self._DoTestFile('vendor/nxp_imx8.dts',
force_missing_bintools='mkimage')
err = stderr.getvalue()
self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage")
@@ -610,7 +610,7 @@ In the above example, here are some possible steps:
Entry_section.SetImagePos(self, image_pos)
The solution is to add an entry, e.g. in ``340_nxp_imx8_non_empty.dts``:
The solution is to add an entry, e.g. in ``vendor/nxp_imx8_non_empty.dts``:
.. code-block:: devicetree
@@ -641,7 +641,7 @@ In the above example, here are some possible steps:
def testNxpImx8ImageNonEmpty(self):
"""Test that binman can produce an iMX8 image with something in it"""
data = self._DoReadFile('340_nxp_imx8_non_empty.dts')
data = self._DoReadFile('vendor/nxp_imx8_non_empty.dts')
# check data here
With that, the second red bit goes away, because the for() loop is now used.

View File

@@ -1255,7 +1255,7 @@ class TestFunctional(unittest.TestCase):
def testPackPowerpcMpc85xxBootpgResetvec(self):
"""Test that an image with powerpc-mpc85xx-bootpg-resetvec can be
created"""
data = self._DoReadFile('150_powerpc_mpc85xx_bootpg_resetvec.dts')
data = self._DoReadFile('vendor/powerpc_mpc85xx_bootpg_resetvec.dts')
self.assertEqual(PPC_MPC85XX_BR_DATA, data[:len(PPC_MPC85XX_BR_DATA)])
def _RunMicrocodeTest(self, dts_fname, nodtb_data, ucode_second=False):
@@ -2130,7 +2130,7 @@ class TestFunctional(unittest.TestCase):
# Unfortunately, compiling a source file always results in a file
# called source.dtb (see fdt_util.EnsureCompiled()). The test
# source file (e.g. test/075_fdt_update_all.dts) thus does not enter
# source file (e.g. test/fdt/fdt_update_all.dts) thus does not enter
# binman as a file called u-boot.dtb. To fix this, copy the file
# over to the expected place.
start = 0
@@ -5578,7 +5578,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testPackTiDm(self):
"""Test that an image with a TI DM binary can be created"""
data = self._DoReadFile('225_ti_dm.dts')
data = self._DoReadFile('vendor/ti_dm.dts')
self.assertEqual(TI_DM_DATA, data[:len(TI_DM_DATA)])
def testPackBl1(self):
@@ -5588,12 +5588,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testRenesasRCarGen4SA0Image(self):
"""Test that binman can produce an Renesas R-Car Gen4 SA0 image"""
self._DoTestFile('348_renesas_rcar4_sa0.dts')
self._DoTestFile('vendor/renesas_rcar4_sa0.dts')
def testRenesasRCarGen4SA0ImageSize(self):
"""Test that binman can not produce large Renesas R-Car Gen4 SA0 image"""
with self.assertRaises(ValueError) as exc:
self._DoTestFile('349_renesas_rcar4_sa0_size.dts')
self._DoTestFile('vendor/renesas_rcar4_sa0_size.dts')
self.assertIn("Node '/binman/renesas-rcar4-sa0': SRAM data longer than 966656 Bytes",
str(exc.exception))
@@ -6885,7 +6885,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testPackRockchipTpl(self):
"""Test that an image with a Rockchip TPL binary can be created"""
data = self._DoReadFile('291_rockchip_tpl.dts')
data = self._DoReadFile('vendor/rockchip_tpl.dts')
self.assertEqual(ROCKCHIP_TPL_DATA, data[:len(ROCKCHIP_TPL_DATA)])
def testMkimageMissingBlobMultiple(self):
@@ -7175,25 +7175,25 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testTIBoardConfig(self):
"""Test that a schema validated board config file can be generated"""
data = self._DoReadFile('293_ti_board_cfg.dts')
data = self._DoReadFile('vendor/ti_board_cfg.dts')
self.assertEqual(TI_BOARD_CONFIG_DATA, data)
def testTIBoardConfigLint(self):
"""Test that an incorrectly linted config file would generate error"""
with self.assertRaises(ValueError) as e:
data = self._DoReadFile('323_ti_board_cfg_phony.dts')
data = self._DoReadFile('vendor/ti_board_cfg_phony.dts')
self.assertIn("Yamllint error", str(e.exception))
def testTIBoardConfigCombined(self):
"""Test that a schema validated combined board config file can be generated"""
data = self._DoReadFile('294_ti_board_cfg_combined.dts')
data = self._DoReadFile('vendor/ti_board_cfg_combined.dts')
configlen_noheader = TI_BOARD_CONFIG_DATA * 4
self.assertGreater(data, configlen_noheader)
def testTIBoardConfigNoDataType(self):
"""Test that error is thrown when data type is not supported"""
with self.assertRaises(ValueError) as e:
data = self._DoReadFile('295_ti_board_cfg_no_type.dts')
data = self._DoReadFile('vendor/ti_board_cfg_no_type.dts')
self.assertIn("Schema validation error", str(e.exception))
def testPackTiSecure(self):
@@ -7202,7 +7202,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
entry_args = {
'keyfile': keyfile,
}
data = self._DoReadFileDtb('296_ti_secure.dts',
data = self._DoReadFileDtb('vendor/ti_secure.dts',
entry_args=entry_args)[0]
self.assertGreater(len(data), len(TI_UNSECURE_DATA))
@@ -7212,9 +7212,9 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
entry_args = {
'keyfile': keyfile,
}
data_no_firewall = self._DoReadFileDtb('296_ti_secure.dts',
data_no_firewall = self._DoReadFileDtb('vendor/ti_secure.dts',
entry_args=entry_args)[0]
data_firewall = self._DoReadFileDtb('324_ti_secure_firewall.dts',
data_firewall = self._DoReadFileDtb('vendor/ti_secure_firewall.dts',
entry_args=entry_args)[0]
self.assertGreater(len(data_firewall),len(data_no_firewall))
@@ -7225,7 +7225,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
'keyfile': keyfile,
}
with self.assertRaises(ValueError) as e:
data_firewall = self._DoReadFileDtb('325_ti_secure_firewall_missing_property.dts',
data_firewall = self._DoReadFileDtb('vendor/ti_secure_firewall_missing_property.dts',
entry_args=entry_args)[0]
self.assertRegex(str(e.exception), "Node '/binman/ti-secure': Subnode 'firewall-0-2' is missing properties: id,region")
@@ -7237,7 +7237,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
'keyfile': keyfile,
}
with terminal.capture() as (_, stderr):
self._DoTestFile('296_ti_secure.dts',
self._DoTestFile('vendor/ti_secure.dts',
force_missing_bintools='openssl',
entry_args=entry_args)
err = stderr.getvalue()
@@ -7249,11 +7249,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
entry_args = {
'keyfile': keyfile,
}
data = self._DoReadFileDtb('297_ti_secure_rom.dts',
data = self._DoReadFileDtb('vendor/ti_secure_rom.dts',
entry_args=entry_args)[0]
data_a = self._DoReadFileDtb('299_ti_secure_rom_a.dts',
data_a = self._DoReadFileDtb('vendor/ti_secure_rom_a.dts',
entry_args=entry_args)[0]
data_b = self._DoReadFileDtb('300_ti_secure_rom_b.dts',
data_b = self._DoReadFileDtb('vendor/ti_secure_rom_b.dts',
entry_args=entry_args)[0]
self.assertGreater(len(data), len(TI_UNSECURE_DATA))
self.assertGreater(len(data_a), len(TI_UNSECURE_DATA))
@@ -7265,7 +7265,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
entry_args = {
'keyfile': keyfile,
}
data = self._DoReadFileDtb('298_ti_secure_rom_combined.dts',
data = self._DoReadFileDtb('vendor/ti_secure_rom_combined.dts',
entry_args=entry_args)[0]
self.assertGreater(len(data), len(TI_UNSECURE_DATA))
@@ -7897,11 +7897,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
def testNxpImx8Image(self):
"""Test that binman can produce an iMX8 image"""
self._DoTestFile('339_nxp_imx8.dts')
self._DoTestFile('vendor/nxp_imx8.dts')
def testNxpHeaderDdrfw(self):
"""Test that binman can add a header to DDR PHY firmware images"""
data = self._DoReadFile('346_nxp_ddrfw_imx95.dts')
data = self._DoReadFile('vendor/nxp_ddrfw_imx95.dts')
self.assertEqual(len(IMX_LPDDR_IMEM_DATA).to_bytes(4, 'little') +
len(IMX_LPDDR_DMEM_DATA).to_bytes(4, 'little') +
IMX_LPDDR_IMEM_DATA + IMX_LPDDR_DMEM_DATA, data)
@@ -7916,7 +7916,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
with open(container_path, 'w') as f:
f.write(bytes([0x87]).decode('latin1') * 32768)
with terminal.capture():
self._DoTestFile('350_nxp_imx95.dts', output_dir=testdir)
self._DoTestFile('vendor/nxp_imx95.dts', output_dir=testdir)
def testFitSignSimple(self):
"""Test that image with FIT and signature nodes can be signed"""