summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:24:01 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:06 -0600
commit27145fd3a836173390c2d2adcd267fa3005b7fbe (patch)
treea032e5f9f46527d4652893cd8f388f3c82214384 /tools/binman/ftest.py
parent95a0f3c6919e5586c23e41df46d7d41e401f13bb (diff)
binman: Place Intel descriptor at image start
The Intel descriptor must always appear at the start of an (x86) image, so it is supposed to position itself there always. However there is no explicit test for this. Add one and fix a bug introduced by the recent change to adjust Entry to read the node in a separate call. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 11155ced70..d1ecd65c2c 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -2975,6 +2975,15 @@ class TestFunctional(unittest.TestCase):
self.assertEqual(U_BOOT_DATA, data[2:2 + len(U_BOOT_DATA)])
self.assertEqual(b'a\0', data[-2:])
+ def testDescriptorOffset(self):
+ """Test that the Intel descriptor is always placed at at the start"""
+ data = self._DoReadFileDtb('141_descriptor_offset.dts')
+ image = control.images['image']
+ entries = image.GetEntries()
+ desc = entries['intel-descriptor']
+ self.assertEqual(0xff800000, desc.offset);
+ self.assertEqual(0xff800000, desc.image_pos);
+
if __name__ == "__main__":
unittest.main()