[U-Boot] [PATCH 2/9] test: Fix typos and tidy up

Simon Glass sjg at chromium.org
Mon Aug 1 01:35:02 CEST 2016


Fix review comments that were missed at the time. Also explain why we need
to regenerate the device tree for each test.

Reported-by: Teddy Reed <teddy.reed at gmail.com>
Suggested-by: Stephen Warren <swarren at nvidia.com>
Signed-off-by: Simon Glass <sjg at chromium.org>
Fixes: f6349c3c (test: Add a README)
---

 test/README                 | 8 ++++----
 test/py/tests/test_vboot.py | 6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/README b/test/README
index ee55972..1142e9c 100644
--- a/test/README
+++ b/test/README
@@ -13,7 +13,7 @@ To run most tests on sandbox, type this:
     test/run
 
 in the U-Boot directory. Note that only the pytest suite is run using this
-comment.
+command.
 
 
 Sandbox
@@ -29,7 +29,7 @@ Pytest Suite
 Many tests are available using the pytest suite, in test/py. This can run
 either on sandbox or on real hardware. It relies on the U-Boot console to
 inject test commands and check the result. It is slower to run than C code,
-but provides the ability to unify lots of test and summarise their results.
+but provides the ability to unify lots of tests and summarise their results.
 
 You can run the tests on sandbox with:
 
@@ -55,11 +55,11 @@ Ad-hoc tests
 There are several ad-hoc tests which run outside the pytest environment:
 
    test/fs	- File system test (shell script)
-   test/image	- FIT and lagacy image tests (shell script and Python)
+   test/image	- FIT and legacy image tests (shell script and Python)
    test/stdint	- A test that stdint.h can be used in U-Boot (shell script)
    trace	- Test for the tracing feature (shell script)
 
-The above should be converted to run as part of the pytest suite.
+TODO: Move these into pytest.
 
 
 When to write tests
diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py
index 14ec85b..46552fc 100644
--- a/test/py/tests/test_vboot.py
+++ b/test/py/tests/test_vboot.py
@@ -106,7 +106,9 @@ def test_vboot(u_boot_console):
 
         algo = sha
 
-        # Compile our device tree files for kernel and U-Boot
+        # Compile our device tree files for kernel and U-Boot. These are
+        # regenerated here since mkimage will modify them (by adding a
+        # public key) below.
         dtc('sandbox-kernel.dts')
         dtc('sandbox-u-boot.dts')
 
@@ -139,7 +141,7 @@ def test_vboot(u_boot_console):
         sig = util.cmd(cons, 'fdtget -t bx %s %s value' % (fit, sig_node))
         byte_list = sig.split()
         byte = int(byte_list[0], 16)
-        byte_list = ['%x' % (byte + 1)] + byte_list[1:]
+        byte_list[0] = '%x' % (byte + 1)
         sig = ' '.join(byte_list)
         util.cmd(cons, 'fdtput -t bx %s %s value %s' % (fit, sig_node, sig))
 
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list