diff options
author | Tom Rini <trini@konsulko.com> | 2023-08-02 17:33:09 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-02 17:33:09 -0400 |
commit | 35e6c89b76fcdad101e0a706e4706ac11cb8642d (patch) | |
tree | 26db2605eaac51131a79230267f21332dee797a4 /tools/binman/elf_test.py | |
parent | 38dedebc547f795efc3daad17f7c013c515e1285 (diff) | |
parent | 288ae53cb73605500b7fc01e5919753c878466be (diff) |
Merge tag 'dm-pull-2aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm
binman fixes for options, etc.
binman template fixes / tweaks
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r-- | tools/binman/elf_test.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index cc95b424b33..e3dee79d065 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -255,8 +255,20 @@ class TestElf(unittest.TestCase): fname = self.ElfTestFile('embed_data') with self.assertRaises(ValueError) as e: elf.GetSymbolFileOffset(fname, ['embed_start', 'embed_end']) - self.assertIn("Python: No module named 'elftools'", - str(e.exception)) + with self.assertRaises(ValueError) as e: + elf.DecodeElf(tools.read_file(fname), 0xdeadbeef) + with self.assertRaises(ValueError) as e: + elf.GetFileOffset(fname, 0xdeadbeef) + with self.assertRaises(ValueError) as e: + elf.GetSymbolFromAddress(fname, 0xdeadbeef) + with self.assertRaises(ValueError) as e: + entry = FakeEntry(10) + section = FakeSection() + elf.LookupAndWriteSymbols(fname, entry, section, True) + + self.assertIn( + "Section 'section_path': entry 'entry_path': Cannot write symbols to an ELF file without Python elftools", + str(e.exception)) finally: elf.ELF_TOOLS = old_val |