From 62d2388401a5c372c199ab081f5b6498e342530f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:35 -0700 Subject: binman: test: Move blob test files to test/blob/ Move about a dozen test files for blob, blob-ext, blob-ext-list, fake-blob, and blob-symbol entries into a blob/ subdirectory. Drop the numeric prefixes and the redundant blob_ filename prefix, and update all references. Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- tools/binman/ftest.py | 34 ++++++++++++------------- tools/binman/test/023_blob.dts | 12 --------- tools/binman/test/068_blob_named_by_arg.dts | 12 --------- tools/binman/test/157_blob_ext.dts | 14 ---------- tools/binman/test/158_blob_ext_missing.dts | 16 ------------ tools/binman/test/159_blob_ext_missing_sect.dts | 23 ----------------- tools/binman/test/173_missing_blob.dts | 14 ---------- tools/binman/test/215_blob_ext_list.dts | 14 ---------- tools/binman/test/216_blob_ext_list_missing.dts | 14 ---------- tools/binman/test/217_fake_blob.dts | 14 ---------- tools/binman/test/218_blob_ext_list_fake.dts | 14 ---------- tools/binman/test/266_blob_ext_opt.dts | 21 --------------- tools/binman/test/273_blob_symbol.dts | 24 ----------------- tools/binman/test/blob/blob.dts | 12 +++++++++ tools/binman/test/blob/ext.dts | 14 ++++++++++ tools/binman/test/blob/ext_list.dts | 14 ++++++++++ tools/binman/test/blob/ext_list_fake.dts | 14 ++++++++++ tools/binman/test/blob/ext_list_missing.dts | 14 ++++++++++ tools/binman/test/blob/ext_missing.dts | 16 ++++++++++++ tools/binman/test/blob/ext_missing_sect.dts | 23 +++++++++++++++++ tools/binman/test/blob/ext_opt.dts | 21 +++++++++++++++ tools/binman/test/blob/fake.dts | 14 ++++++++++ tools/binman/test/blob/missing.dts | 14 ++++++++++ tools/binman/test/blob/named_by_arg.dts | 12 +++++++++ tools/binman/test/blob/symbol.dts | 24 +++++++++++++++++ 25 files changed, 209 insertions(+), 209 deletions(-) delete mode 100644 tools/binman/test/023_blob.dts delete mode 100644 tools/binman/test/068_blob_named_by_arg.dts delete mode 100644 tools/binman/test/157_blob_ext.dts delete mode 100644 tools/binman/test/158_blob_ext_missing.dts delete mode 100644 tools/binman/test/159_blob_ext_missing_sect.dts delete mode 100644 tools/binman/test/173_missing_blob.dts delete mode 100644 tools/binman/test/215_blob_ext_list.dts delete mode 100644 tools/binman/test/216_blob_ext_list_missing.dts delete mode 100644 tools/binman/test/217_fake_blob.dts delete mode 100644 tools/binman/test/218_blob_ext_list_fake.dts delete mode 100644 tools/binman/test/266_blob_ext_opt.dts delete mode 100644 tools/binman/test/273_blob_symbol.dts create mode 100644 tools/binman/test/blob/blob.dts create mode 100644 tools/binman/test/blob/ext.dts create mode 100644 tools/binman/test/blob/ext_list.dts create mode 100644 tools/binman/test/blob/ext_list_fake.dts create mode 100644 tools/binman/test/blob/ext_list_missing.dts create mode 100644 tools/binman/test/blob/ext_missing.dts create mode 100644 tools/binman/test/blob/ext_missing_sect.dts create mode 100644 tools/binman/test/blob/ext_opt.dts create mode 100644 tools/binman/test/blob/fake.dts create mode 100644 tools/binman/test/blob/missing.dts create mode 100644 tools/binman/test/blob/named_by_arg.dts create mode 100644 tools/binman/test/blob/symbol.dts (limited to 'tools') diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 8e37c0bd19e..612a1bdb8cb 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1157,7 +1157,7 @@ class TestFunctional(unittest.TestCase): def testBlobFilename(self): """Test that generic blobs can be provided by filename""" - data = self._DoReadFile('023_blob.dts') + data = self._DoReadFile('blob/blob.dts') self.assertEqual(BLOB_DATA, data) def testPackSorted(self): @@ -1866,7 +1866,7 @@ class TestFunctional(unittest.TestCase): entry_args = { 'cros-ec-rw-path': 'ecrw.bin', } - self._DoReadFileDtb('068_blob_named_by_arg.dts', entry_args=entry_args) + self._DoReadFileDtb('blob/named_by_arg.dts', entry_args=entry_args) def testFill(self): """Test for an fill entry type""" @@ -3884,20 +3884,20 @@ class TestFunctional(unittest.TestCase): def testExtblob(self): """Test an image with an external blob""" - data = self._DoReadFile('157_blob_ext.dts') + data = self._DoReadFile('blob/ext.dts') self.assertEqual(REFCODE_DATA, data) def testExtblobMissing(self): """Test an image with a missing external blob""" with self.assertRaises(ValueError) as e: - self._DoReadFile('158_blob_ext_missing.dts') + self._DoReadFile('blob/ext_missing.dts') self.assertIn("Filename 'missing-file' not found in input path", str(e.exception)) def testExtblobMissingOk(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - ret = self._DoTestFile('158_blob_ext_missing.dts', + ret = self._DoTestFile('blob/ext_missing.dts', allow_missing=True) self.assertEqual(103, ret) err = stderr.getvalue() @@ -3908,7 +3908,7 @@ class TestFunctional(unittest.TestCase): def testExtblobMissingOkFlag(self): """Test an image with an missing external blob allowed with -W""" with terminal.capture() as (stdout, stderr): - ret = self._DoTestFile('158_blob_ext_missing.dts', + ret = self._DoTestFile('blob/ext_missing.dts', allow_missing=True, ignore_missing=True) self.assertEqual(0, ret) err = stderr.getvalue() @@ -3919,7 +3919,7 @@ class TestFunctional(unittest.TestCase): def testExtblobMissingOkSect(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('159_blob_ext_missing_sect.dts', + self._DoTestFile('blob/ext_missing_sect.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: blob-ext blob-ext2") @@ -4241,7 +4241,7 @@ class TestFunctional(unittest.TestCase): def testBlobNamedByArgMissing(self): """Test handling of a missing entry arg""" with self.assertRaises(ValueError) as e: - self._DoReadFile('068_blob_named_by_arg.dts') + self._DoReadFile('blob/named_by_arg.dts') self.assertIn("Missing required properties/entry args: cros-ec-rw-path", str(e.exception)) @@ -4415,7 +4415,7 @@ class TestFunctional(unittest.TestCase): def testMissingBlob(self): """Test handling of a blob containing a missing file""" with self.assertRaises(ValueError) as e: - self._DoTestFile('173_missing_blob.dts', allow_missing=True) + self._DoTestFile('blob/missing.dts', allow_missing=True) self.assertIn("Filename 'missing' not found in input path", str(e.exception)) @@ -5212,14 +5212,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobList(self): """Test an image with an external blob list""" - data = self._DoReadFileDtb('215_blob_ext_list.dts', + data = self._DoReadFileDtb('blob/ext_list.dts', allow_fake_blobs=False) self.assertEqual(REFCODE_DATA + FSP_M_DATA, data[0]) def testExtblobListMissing(self): """Test an image with a missing external blob""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('216_blob_ext_list_missing.dts', + self._DoReadFileDtb('blob/ext_list_missing.dts', allow_fake_blobs=False) self.assertIn("Filename 'missing-file' not found in input path", str(e.exception)) @@ -5227,7 +5227,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobListMissingOk(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('216_blob_ext_list_missing.dts', + self._DoTestFile('blob/ext_list_missing.dts', allow_missing=True, allow_fake_blobs=False) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: blob-ext") @@ -5441,7 +5441,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFakeBlob(self): """Test handling of faking an external blob""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('217_fake_blob.dts', allow_missing=True, + self._DoTestFile('blob/fake.dts', allow_missing=True, allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex( @@ -5451,7 +5451,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobListFaked(self): """Test an extblob with missing external blob that are faked""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('216_blob_ext_list_missing.dts', + self._DoTestFile('blob/ext_list_missing.dts', allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*faked.*: blob-ext-list") @@ -6560,7 +6560,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobMissingOptional(self): """Test an image with an external blob that is optional""" with terminal.capture() as (stdout, stderr): - data = self._DoReadFileDtb('266_blob_ext_opt.dts', + data = self._DoReadFileDtb('blob/ext_opt.dts', allow_fake_blobs=False)[0] self.assertEqual(REFCODE_DATA, data) self.assertNotIn(MISSING_DATA, data) @@ -6568,7 +6568,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobFakedOptional(self): """Test an image with an external blob that is optional""" with terminal.capture() as (stdout, stderr): - data = self._DoReadFile('266_blob_ext_opt.dts') + data = self._DoReadFile('blob/ext_opt.dts') self.assertEqual(REFCODE_DATA, data) err = stderr.getvalue() self.assertRegex( @@ -6659,7 +6659,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap TestFunctional._MakeInputFile('blob_syms.bin', tools.read_file(self.ElfTestFile('blob_syms.bin'))) - data = self._DoReadFile('273_blob_symbol.dts') + data = self._DoReadFile('blob/symbol.dts') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) addr = elf.GetSymbolAddress(elf_fname, '__my_start_sym') diff --git a/tools/binman/test/023_blob.dts b/tools/binman/test/023_blob.dts deleted file mode 100644 index 7dcff69666a..00000000000 --- a/tools/binman/test/023_blob.dts +++ /dev/null @@ -1,12 +0,0 @@ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob { - filename = "blobfile"; - }; - }; -}; diff --git a/tools/binman/test/068_blob_named_by_arg.dts b/tools/binman/test/068_blob_named_by_arg.dts deleted file mode 100644 index e129f843cd5..00000000000 --- a/tools/binman/test/068_blob_named_by_arg.dts +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - cros-ec-rw { - }; - }; -}; diff --git a/tools/binman/test/157_blob_ext.dts b/tools/binman/test/157_blob_ext.dts deleted file mode 100644 index 8afdd5339e5..00000000000 --- a/tools/binman/test/157_blob_ext.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob-ext { - filename = "refcode.bin"; - }; - }; -}; diff --git a/tools/binman/test/158_blob_ext_missing.dts b/tools/binman/test/158_blob_ext_missing.dts deleted file mode 100644 index d315e5592e1..00000000000 --- a/tools/binman/test/158_blob_ext_missing.dts +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - size = <0x80>; - - blob-ext { - filename = "missing-file"; - }; - }; -}; diff --git a/tools/binman/test/159_blob_ext_missing_sect.dts b/tools/binman/test/159_blob_ext_missing_sect.dts deleted file mode 100644 index 5f14c541381..00000000000 --- a/tools/binman/test/159_blob_ext_missing_sect.dts +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - size = <0x80>; - - section { - blob-ext { - filename = "missing-file"; - }; - }; - - blob-ext2 { - type = "blob-ext"; - filename = "missing-file2"; - }; - }; -}; diff --git a/tools/binman/test/173_missing_blob.dts b/tools/binman/test/173_missing_blob.dts deleted file mode 100644 index ffb655a1cb4..00000000000 --- a/tools/binman/test/173_missing_blob.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob { - filename = "missing"; - }; - }; -}; diff --git a/tools/binman/test/215_blob_ext_list.dts b/tools/binman/test/215_blob_ext_list.dts deleted file mode 100644 index aad2f0300d3..00000000000 --- a/tools/binman/test/215_blob_ext_list.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob-ext-list { - filenames = "refcode.bin", "fsp_m.bin"; - }; - }; -}; diff --git a/tools/binman/test/216_blob_ext_list_missing.dts b/tools/binman/test/216_blob_ext_list_missing.dts deleted file mode 100644 index c02c335c760..00000000000 --- a/tools/binman/test/216_blob_ext_list_missing.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob-ext-list { - filenames = "refcode.bin", "missing-file"; - }; - }; -}; diff --git a/tools/binman/test/217_fake_blob.dts b/tools/binman/test/217_fake_blob.dts deleted file mode 100644 index 22cf67f4f83..00000000000 --- a/tools/binman/test/217_fake_blob.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob-ext { - filename = "binman_faking_test_blob"; - }; - }; -}; diff --git a/tools/binman/test/218_blob_ext_list_fake.dts b/tools/binman/test/218_blob_ext_list_fake.dts deleted file mode 100644 index 54ee54fdaab..00000000000 --- a/tools/binman/test/218_blob_ext_list_fake.dts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob-ext-list { - filenames = "refcode.bin", "fake-file"; - }; - }; -}; diff --git a/tools/binman/test/266_blob_ext_opt.dts b/tools/binman/test/266_blob_ext_opt.dts deleted file mode 100644 index 717153152ce..00000000000 --- a/tools/binman/test/266_blob_ext_opt.dts +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - ok { - type = "blob-ext"; - filename = "refcode.bin"; - }; - - missing { - type = "blob-ext"; - filename = "missing.bin"; - optional; - }; - }; -}; diff --git a/tools/binman/test/273_blob_symbol.dts b/tools/binman/test/273_blob_symbol.dts deleted file mode 100644 index 87b0aba2120..00000000000 --- a/tools/binman/test/273_blob_symbol.dts +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - blob { - filename = "blob_syms.bin"; - write-symbols; - elf-filename = "blob_syms"; - elf-base-sym = "__my_start_sym"; - }; - - inset { - type = "null"; - offset = <4>; - size = <8>; - overlap; - }; - }; -}; diff --git a/tools/binman/test/blob/blob.dts b/tools/binman/test/blob/blob.dts new file mode 100644 index 00000000000..7dcff69666a --- /dev/null +++ b/tools/binman/test/blob/blob.dts @@ -0,0 +1,12 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "blobfile"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext.dts b/tools/binman/test/blob/ext.dts new file mode 100644 index 00000000000..8afdd5339e5 --- /dev/null +++ b/tools/binman/test/blob/ext.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext { + filename = "refcode.bin"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_list.dts b/tools/binman/test/blob/ext_list.dts new file mode 100644 index 00000000000..aad2f0300d3 --- /dev/null +++ b/tools/binman/test/blob/ext_list.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext-list { + filenames = "refcode.bin", "fsp_m.bin"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_list_fake.dts b/tools/binman/test/blob/ext_list_fake.dts new file mode 100644 index 00000000000..54ee54fdaab --- /dev/null +++ b/tools/binman/test/blob/ext_list_fake.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext-list { + filenames = "refcode.bin", "fake-file"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_list_missing.dts b/tools/binman/test/blob/ext_list_missing.dts new file mode 100644 index 00000000000..c02c335c760 --- /dev/null +++ b/tools/binman/test/blob/ext_list_missing.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext-list { + filenames = "refcode.bin", "missing-file"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_missing.dts b/tools/binman/test/blob/ext_missing.dts new file mode 100644 index 00000000000..d315e5592e1 --- /dev/null +++ b/tools/binman/test/blob/ext_missing.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <0x80>; + + blob-ext { + filename = "missing-file"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_missing_sect.dts b/tools/binman/test/blob/ext_missing_sect.dts new file mode 100644 index 00000000000..5f14c541381 --- /dev/null +++ b/tools/binman/test/blob/ext_missing_sect.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <0x80>; + + section { + blob-ext { + filename = "missing-file"; + }; + }; + + blob-ext2 { + type = "blob-ext"; + filename = "missing-file2"; + }; + }; +}; diff --git a/tools/binman/test/blob/ext_opt.dts b/tools/binman/test/blob/ext_opt.dts new file mode 100644 index 00000000000..717153152ce --- /dev/null +++ b/tools/binman/test/blob/ext_opt.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + ok { + type = "blob-ext"; + filename = "refcode.bin"; + }; + + missing { + type = "blob-ext"; + filename = "missing.bin"; + optional; + }; + }; +}; diff --git a/tools/binman/test/blob/fake.dts b/tools/binman/test/blob/fake.dts new file mode 100644 index 00000000000..22cf67f4f83 --- /dev/null +++ b/tools/binman/test/blob/fake.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext { + filename = "binman_faking_test_blob"; + }; + }; +}; diff --git a/tools/binman/test/blob/missing.dts b/tools/binman/test/blob/missing.dts new file mode 100644 index 00000000000..ffb655a1cb4 --- /dev/null +++ b/tools/binman/test/blob/missing.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "missing"; + }; + }; +}; diff --git a/tools/binman/test/blob/named_by_arg.dts b/tools/binman/test/blob/named_by_arg.dts new file mode 100644 index 00000000000..e129f843cd5 --- /dev/null +++ b/tools/binman/test/blob/named_by_arg.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + cros-ec-rw { + }; + }; +}; diff --git a/tools/binman/test/blob/symbol.dts b/tools/binman/test/blob/symbol.dts new file mode 100644 index 00000000000..87b0aba2120 --- /dev/null +++ b/tools/binman/test/blob/symbol.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "blob_syms.bin"; + write-symbols; + elf-filename = "blob_syms"; + elf-base-sym = "__my_start_sym"; + }; + + inset { + type = "null"; + offset = <4>; + size = <8>; + overlap; + }; + }; +}; -- cgit v1.2.3