summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-24 07:22:54 -0600
committerSimon Glass <sjg@chromium.org>2019-10-15 08:40:02 -0600
commitf514d8f23de4aada7e6f9f4d9de731b43912a77a (patch)
treea50719170ba87a13a437d145ea08cae932ba1cd6 /tools/binman/ftest.py
parent53e22bf38c202d5ef3bc092d55095c672994a15b (diff)
binman: Use the Makefile for u_boot_ucode_ptr
Remove this file from git and instead build it using the Makefile. Update tools.GetInputFilename() to support reading files from an absolute path, so that we can read the Elf test files easily. Also make sure that the temp directory is report in ELF tests as this was commented out. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index fad62bb04fc..e7ade0fddf9 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -152,8 +152,8 @@ class TestFunctional(unittest.TestCase):
elf_test.BuildElfTestFiles(cls._elf_testdir)
# ELF file with a '_dt_ucode_base_size' symbol
- with open(cls.TestFile('u_boot_ucode_ptr'), 'rb') as fd:
- TestFunctional._MakeInputFile('u-boot', fd.read())
+ TestFunctional._MakeInputFile('u-boot',
+ tools.ReadFile(cls.ElfTestFile('u_boot_ucode_ptr')))
# Intel flash descriptor file
with open(cls.TestFile('descriptor.bin'), 'rb') as fd:
@@ -489,7 +489,7 @@ class TestFunctional(unittest.TestCase):
Filename of ELF file to use as SPL
"""
# TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile()
- if src_fname in ['bss_data']:
+ if src_fname in ['bss_data', 'u_boot_ucode_ptr']:
fname = cls.ElfTestFile(src_fname)
else:
fname = cls.TestFile(src_fname)
@@ -1101,8 +1101,8 @@ class TestFunctional(unittest.TestCase):
finally:
# Put the original file back
- with open(self.TestFile('u_boot_ucode_ptr'), 'rb') as fd:
- TestFunctional._MakeInputFile('u-boot', fd.read())
+ TestFunctional._MakeInputFile('u-boot',
+ tools.ReadFile(self.ElfTestFile('u_boot_ucode_ptr')))
def testMicrocodeNotInImage(self):
"""Test that microcode must be placed within the image"""
@@ -1818,8 +1818,8 @@ class TestFunctional(unittest.TestCase):
u-boot-tpl.dtb with the microcode removed
the microcode
"""
- with open(self.TestFile('u_boot_ucode_ptr'), 'rb') as fd:
- TestFunctional._MakeInputFile('tpl/u-boot-tpl', fd.read())
+ TestFunctional._MakeInputFile('tpl/u-boot-tpl',
+ tools.ReadFile(self.ElfTestFile('u_boot_ucode_ptr')))
first, pos_and_size = self._RunMicrocodeTest('093_x86_tpl_ucode.dts',
U_BOOT_TPL_NODTB_DATA)
self.assertEqual(b'tplnodtb with microc' + pos_and_size +