diff options
author | Simon Glass <sjg@chromium.org> | 2018-07-17 13:25:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-08-01 16:30:48 -0600 |
commit | 3af8e49ceff044021725fc547b19ebac22d0b0f7 (patch) | |
tree | e0d82e9e4a9e94f1ffe36da7fa4ba78a4da213c7 /tools/binman/ftest.py | |
parent | ec127af0429ad6f9818297f9c3ee77edb2154182 (diff) |
binman: Add an entry filled with a repeating byte
It is sometimes useful to have an area of the image which is all zeroes,
or all 0xff. This can often be achieved by padding the size of an an
existing entry and setting the pad byte for an entry or image.
But it is useful to have an explicit means of adding blocks of repeating
data to the image. Add a 'fill' entry type to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 5428ee651a7..4e467145d71 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1235,6 +1235,19 @@ class TestFunctional(unittest.TestCase): data, _, _, _ = self._DoReadFileDtb('68_blob_named_by_arg.dts', entry_args=entry_args) + def testFill(self): + """Test for an fill entry type""" + data = self._DoReadFile('69_fill.dts') + expected = 8 * chr(0xff) + 8 * chr(0) + self.assertEqual(expected, data) + + def testFillNoSize(self): + """Test for an fill entry type with no size""" + with self.assertRaises(ValueError) as e: + self._DoReadFile('70_fill_no_size.dts') + self.assertIn("'fill' entry must have a size property", + str(e.exception)) + if __name__ == "__main__": unittest.main() |