Browse Source

binman: Add a test for Intel reference code

Unfortunately the test was not included in the original implementation.
Add one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 3 years ago
parent
commit
3ae192c2a4
2 changed files with 21 additions and 0 deletions
  1. 7 0
      tools/binman/ftest.py
  2. 14 0
      tools/binman/test/100_intel_refcode.dts

+ 7 - 0
tools/binman/ftest.py

@@ -60,6 +60,7 @@ VBLOCK_DATA           = 'vblk'
60 60
 FILES_DATA            = ("sorry I'm late\nOh, don't bother apologising, I'm " +
61 61
                          "sorry you're alive\n")
62 62
 COMPRESS_DATA         = 'data to compress'
63
+REFCODE_DATA          = 'refcode'
63 64
 
64 65
 
65 66
 class TestFunctional(unittest.TestCase):
@@ -115,6 +116,7 @@ class TestFunctional(unittest.TestCase):
115 116
         TestFunctional._MakeInputFile('ecrw.bin', CROS_EC_RW_DATA)
116 117
         TestFunctional._MakeInputDir('devkeys')
117 118
         TestFunctional._MakeInputFile('bmpblk.bin', BMPBLK_DATA)
119
+        TestFunctional._MakeInputFile('refcode.bin', REFCODE_DATA)
118 120
 
119 121
         # ELF file with a '_dt_ucode_base_size' symbol
120 122
         with open(self.TestFile('u_boot_ucode_ptr')) as fd:
@@ -1764,6 +1766,11 @@ class TestFunctional(unittest.TestCase):
1764 1766
 <none>     00000003  00000004  u-boot-align
1765 1767
 ''', map_data)
1766 1768
 
1769
+    def testPacRefCode(self):
1770
+        """Test that an image with an Intel Reference code binary works"""
1771
+        data = self._DoReadFile('100_intel_refcode.dts')
1772
+        self.assertEqual(REFCODE_DATA, data[:len(REFCODE_DATA)])
1773
+
1767 1774
 
1768 1775
 if __name__ == "__main__":
1769 1776
     unittest.main()

+ 14 - 0
tools/binman/test/100_intel_refcode.dts

@@ -0,0 +1,14 @@
1
+/dts-v1/;
2
+
3
+/ {
4
+	#address-cells = <1>;
5
+	#size-cells = <1>;
6
+
7
+	binman {
8
+		size = <16>;
9
+
10
+		intel-refcode {
11
+			filename = "refcode.bin";
12
+		};
13
+	};
14
+};