Lines Matching +full:- +full:e
5 # SPDX-License-Identifier: GPL-2.0+
9 # python -m unittest func_test.TestFunctional.testHelp
53 In some cases a 'real' file must be used - these are also supplied in
66 TestFunctional._MakeInputFile('u-boot.bin', U_BOOT_DATA)
67 TestFunctional._MakeInputFile('u-boot.img', U_BOOT_IMG_DATA)
68 TestFunctional._MakeInputFile('spl/u-boot-spl.bin', U_BOOT_SPL_DATA)
72 TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
73 TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA)
74 TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA)
81 TestFunctional._MakeInputFile('u-boot', fd.read())
126 options.pager = 'binman-invalid-pager'
137 fname: Device tree source filename to use (e.g. 05_simple.dts)
139 return self._DoBinman('-p', '-I', self._indir,
140 '-d', self.TestFile(fname))
142 def _SetupDtb(self, fname, outfile='u-boot.dtb'):
143 """Set up a new test device-tree file
171 Raises an assertion failure if binman returns a non-zero exit code.
174 fname: Device tree source filename to use (e.g. 05_simple.dts)
176 the u-boot-dtb entry. Normally this is not needed and the
186 # Use the compiled test file as the u-boot-dtb input
203 TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
206 """Helper function which discards the device-tree binary"""
267 result = self._RunBinman('-h')
270 """Test that the full help is displayed with -H"""
271 result = self._RunBinman('-H')
278 """Test that the full help is displayed with -H"""
281 result = self._DoBinman('-H')
287 """Test that the basic help is displayed with -h"""
288 result = self._RunBinman('-h')
296 self._SetupDtb('05_simple.dts', 'sandbox/u-boot.dtb')
297 TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA)
298 result = self._DoBinman('-b', 'sandbox')
303 with self.assertRaises(ValueError) as e:
305 self.assertIn("Must provide a board to process (use -b <board>)",
306 str(e.exception))
310 with self.assertRaises(Exception) as e:
311 self._RunBinman('-d', 'missing_file')
314 'No such file or directory'], str(e.exception))
320 will come from the device-tree compiler (dtc).
322 with self.assertRaises(Exception) as e:
323 self._RunBinman('-d', self.TestFile('01_invalid.dts'))
325 str(e.exception))
329 with self.assertRaises(Exception) as e:
330 self._DoBinman('-d', self.TestFile('02_missing_node.dts'))
331 self.assertIn("does not have a 'binman' node", str(e.exception))
334 """Test that an empty binman node works OK (i.e. does nothing)"""
335 result = self._RunBinman('-d', self.TestFile('03_empty.dts'))
341 with self.assertRaises(Exception) as e:
342 result = self._RunBinman('-d',
344 #print e.exception
345 self.assertIn("Unknown entry type 'not-a-valid-type' in node "
346 "'/binman/not-a-valid-type'", str(e.exception))
381 with self.assertRaises(ValueError) as e:
383 self.assertIn("Node '/binman/u-boot': Alignment 23 must be a power "
384 "of two", str(e.exception))
395 # First u-boot
396 self.assertIn('u-boot', entries)
397 entry = entries['u-boot']
401 # Second u-boot, aligned to 16-byte boundary
402 self.assertIn('u-boot-align', entries)
403 entry = entries['u-boot-align']
407 # Third u-boot, size 23 bytes
408 self.assertIn('u-boot-size', entries)
409 entry = entries['u-boot-size']
414 # Fourth u-boot, placed immediate after the above
415 self.assertIn('u-boot-next', entries)
416 entry = entries['u-boot-next']
420 # Fifth u-boot, placed at a fixed position
421 self.assertIn('u-boot-fixed', entries)
422 entry = entries['u-boot-fixed']
438 # First u-boot with padding before and after
439 self.assertIn('u-boot', entries)
440 entry = entries['u-boot']
445 # Second u-boot has an aligned size, but it has no effect
446 self.assertIn('u-boot-align-size-nop', entries)
447 entry = entries['u-boot-align-size-nop']
451 # Third u-boot has an aligned size too
452 self.assertIn('u-boot-align-size', entries)
453 entry = entries['u-boot-align-size']
457 # Fourth u-boot has an aligned end
458 self.assertIn('u-boot-align-end', entries)
459 entry = entries['u-boot-align-end']
463 # Fifth u-boot immediately afterwards
464 self.assertIn('u-boot-align-both', entries)
465 entry = entries['u-boot-align-both']
474 with self.assertRaises(ValueError) as e:
476 self.assertIn("Node '/binman/u-boot': Alignment 5 must be a power "
477 "of two", str(e.exception))
481 with self.assertRaises(ValueError) as e:
483 self.assertIn("Node '/binman/u-boot': Alignment size 55 must be a "
484 "power of two", str(e.exception))
488 with self.assertRaises(ValueError) as e:
490 self.assertIn("Node '/binman/u-boot': Position 0x5 (5) does not match "
491 "align 0x4 (4)", str(e.exception))
495 with self.assertRaises(ValueError) as e:
497 self.assertIn("Node '/binman/u-boot': Size 0x5 (5) does not match "
498 "align-size 0x4 (4)", str(e.exception))
502 with self.assertRaises(ValueError) as e:
504 self.assertIn("Node '/binman/u-boot-align': Position 0x3 (3) overlaps "
505 "with previous entry '/binman/u-boot' ending at 0x4 (4)",
506 str(e.exception))
510 with self.assertRaises(ValueError) as e:
512 self.assertIn("Node '/binman/u-boot': Entry contents size is 0x4 (4) "
513 "but entry size is 0x3 (3)", str(e.exception))
517 with self.assertRaises(ValueError) as e:
520 "size 0x3 (3)", str(e.exception))
540 with self.assertRaises(ValueError) as e:
543 "align-size 0x8 (8)", str(e.exception))
547 with self.assertRaises(ValueError) as e:
550 "two", str(e.exception))
562 fname = tools.GetOutputFilename('test-name')
566 fname = tools.GetOutputFilename('test-name.xx')
582 with self.assertRaises(ValueError) as e:
584 self.assertIn("Node '/binman/u-boot-spl': Position 0x0 (0) overlaps "
585 "with previous entry '/binman/u-boot' ending at 0x4 (4)",
586 str(e.exception))
589 """Test that a device tree can be added to U-Boot"""
594 """Test that the end-at-4gb property requires a size property"""
595 with self.assertRaises(ValueError) as e:
598 "using end-at-4gb", str(e.exception))
601 """Test that the end-at-4gb property checks for position boundaries"""
602 with self.assertRaises(ValueError) as e:
604 self.assertIn("Node '/binman/u-boot': Position 0x0 (0) is outside "
606 str(e.exception))
610 data = self._DoReadFile('29_x86-rom.dts')
617 with self.assertRaises(ValueError) as e:
618 self._DoTestFile('31_x86-rom-me.dts')
619 self.assertIn("Node '/binman/intel-descriptor': Cannot find FD "
620 "signature", str(e.exception))
624 with self.assertRaises(ValueError) as e:
625 self._DoTestFile('30_x86-rom-me-no-desc.dts')
626 self.assertIn("Node '/binman/intel-me': No position set with "
627 "pos-unset: should another entry provide this correct "
628 "position?", str(e.exception))
632 data = self._DoReadFile('31_x86-rom-me.dts')
637 data = self._DoReadFile('32_intel-vga.dts')
642 data = self._DoReadFile('33_x86-start16.dts')
649 u-boot-nodtb.bin with a microcode pointer inserted at the correct
651 u-boot.dtb with the microcode removed
690 u-boot-nodtb.bin with a microcode pointer inserted at the correct
692 u-boot.dtb with the microcode
724 """Test that u-boot.img can be put in a file"""
730 with self.assertRaises(ValueError) as e:
732 self.assertIn("Node '/binman/u-boot-dtb-with-ucode': No /microcode "
733 "node found in ", str(e.exception))
736 """Test that a missing u-boot-dtb-with-ucode node is detected"""
737 with self.assertRaises(ValueError) as e:
739 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find "
740 "microcode region u-boot-dtb-with-ucode", str(e.exception))
743 """Test that a missing u-boot-ucode node is detected"""
744 with self.assertRaises(ValueError) as e:
746 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find "
747 "microcode region u-boot-ucode", str(e.exception))
750 """Test that a U-Boot binary without the microcode symbol is detected"""
754 TestFunctional._MakeInputFile('u-boot', fd.read())
756 with self.assertRaises(ValueError) as e:
758 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot locate "
759 "_dt_ucode_base_size symbol in u-boot", str(e.exception))
764 TestFunctional._MakeInputFile('u-boot', fd.read())
768 with self.assertRaises(ValueError) as e:
770 self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Microcode "
772 "image ranging from 00000000 to 0000002e", str(e.exception))
775 """Test that we can cope with an image without microcode (e.g. qemu)"""
777 TestFunctional._MakeInputFile('u-boot', fd.read())
789 self.assertEqual(chr(0) * (0x200 - used_len), third)
793 with self.assertRaises(ValueError) as e:
796 "entry 'invalid-entry'", str(e.exception))
800 data = self._DoReadFile('42_intel-fsp.dts')
805 data = self._DoReadFile('43_intel-cmc.dts')