diff mbox

[U-Boot,9/9] test: Adjust run_command_list() to return a list of strings

Message ID 1470008109-9699-10-git-send-email-sjg@chromium.org
State Accepted
Commit f6d34651d8a21514abbfa32f44a0ec2014ef002b
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass July 31, 2016, 11:35 p.m. UTC
Return one string for each command that was executed. This seems cleaner.

Suggested-by: Teddy Reed <teddy.reed@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/py/tests/test_vboot.py    | 2 +-
 test/py/u_boot_console_base.py | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

Stephen Warren Aug. 2, 2016, 5:27 p.m. UTC | #1
On 07/31/2016 05:35 PM, Simon Glass wrote:
> Return one string for each command that was executed. This seems cleaner.

The series,
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tom Rini Aug. 6, 2016, 1:01 a.m. UTC | #2
On Sun, Jul 31, 2016 at 05:35:09PM -0600, Simon Glass wrote:

> Return one string for each command that was executed. This seems cleaner.
> 
> Suggested-by: Teddy Reed <teddy.reed@gmail.com>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py
index d7ab439..021892b 100644
--- a/test/py/tests/test_vboot.py
+++ b/test/py/tests/test_vboot.py
@@ -71,7 +71,7 @@  def test_vboot(u_boot_console):
                 ['sb load hostfs - 100 %stest.fit' % tmpdir,
                 'fdt addr 100',
                 'bootm 100'])
-        assert(expect_string in output)
+        assert(expect_string in ''.join(output))
 
     def make_fit(its):
         """Make a new FIT from the .its source file.
diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index b855b10..ee9b928 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -225,11 +225,12 @@  class ConsoleBase(object):
         Args:
             cmd: List of commands (each a string).
         Returns:
-            Combined output of all commands, as a string.
+            A list of output strings from each command, one element for each
+            command.
         """
-        output = ''
+        output = []
         for cmd in cmds:
-            output += self.run_command(cmd)
+            output.append(self.run_command(cmd))
         return output
 
     def ctrlc(self):