summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 3d556535e07..8225216fbec 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -7310,6 +7310,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
tools.to_bytes(''.join(node.props['key'].value)))
self.assertNotIn('key-source', node.props)
+ def testKeyNameHintIsPathSplPubkeyDtb(self):
+ """Test that binman errors out on key-name-hint being a path"""
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFile('348_key_name_hint_dir_spl_pubkey_dtb.dts')
+ self.assertIn(
+ 'Node \'/binman/u-boot-spl-pubkey-dtb\': \'keys/key\' is a path not a filename',
+ str(e.exception))
def testSplPubkeyDtb(self):
"""Test u_boot_spl_pubkey_dtb etype"""
@@ -7983,6 +7990,24 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
entry_args=entry_args,
extra_indirs=[test_subdir])[0]
+ def testKeyNameHintIsPathSimpleFit(self):
+ """Test that binman errors out on key-name-hint being a path"""
+ if not elf.ELF_TOOLS:
+ self.skipTest('Python elftools not available')
+ entry_args = {
+ 'of-list': 'test-fdt1',
+ 'default-dt': 'test-fdt1',
+ 'atf-bl31-path': 'bl31.elf',
+ }
+ test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR)
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFileDtb(
+ '347_key_name_hint_dir_fit_signature.dts',
+ entry_args=entry_args,
+ extra_indirs=[test_subdir])
+ self.assertIn(
+ 'Node \'/binman/fit\': \'keys/rsa2048\' is a path not a filename',
+ str(e.exception))
def testSimpleFitEncryptedData(self):
"""Test an image with a FIT containing data to be encrypted"""