diff mbox

[U-Boot,5/6] test/py: replace cmd_repeat.sh with Python

Message ID 1447816804-6312-6-git-send-email-swarren@wwwdotorg.org
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Nov. 18, 2015, 3:20 a.m. UTC
From: Stephen Warren <swarren@nvidia.com>

This moves this test into the new infra-structure, and also allows it to
work on real hardware, not just sandbox.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 test/cmd_repeat.sh | 29 -----------------------------
 test/py/test_md.py | 10 ++++++++++
 2 files changed, 10 insertions(+), 29 deletions(-)
 delete mode 100755 test/cmd_repeat.sh

Comments

Tom Rini Nov. 23, 2015, 11:44 p.m. UTC | #1
On Tue, Nov 17, 2015 at 08:20:03PM -0700, Stephen Warren wrote:

> From: Stephen Warren <swarren@nvidia.com>
> 
> This moves this test into the new infra-structure, and also allows it to
> work on real hardware, not just sandbox.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/test/cmd_repeat.sh b/test/cmd_repeat.sh
deleted file mode 100755
index 990e79900f47..000000000000
--- a/test/cmd_repeat.sh
+++ /dev/null
@@ -1,29 +0,0 @@ 
-#!/bin/sh
-
-# Test for U-Boot cli including command repeat
-
-BASE="$(dirname $0)"
-. $BASE/common.sh
-
-run_test() {
-	./${OUTPUT_DIR}/u-boot <<END
-setenv ctrlc_ignore y
-md 0
-
-reset
-END
-}
-check_results() {
-	echo "Check results"
-
-	grep -q 00000100 ${tmp} || fail "Command did not repeat"
-}
-
-echo "Test CLI repeat"
-echo
-tmp="$(tempfile)"
-build_uboot
-run_test >${tmp}
-check_results ${tmp}
-rm ${tmp}
-echo "Test passed"
diff --git a/test/py/test_md.py b/test/py/test_md.py
index 49cdd2685234..9667fd4f2217 100644
--- a/test/py/test_md.py
+++ b/test/py/test_md.py
@@ -10,3 +10,13 @@  def test_md(uboot_console):
     uboot_console.run_command("mw " + addr + " " + val)
     response = uboot_console.run_command("md " + addr + " 10")
     assert(expected_response in response)
+
+@pytest.mark.buildconfigspec("cmd_memory")
+def test_md_repeat(uboot_console):
+    addr_base = "%08x" % uboot_console.config.ram_base
+    words = 0x10
+    addr_repeat = "%08x" % (uboot_console.config.ram_base + (words * 4))
+    uboot_console.run_command("md %s %x" % (addr_base, words))
+    response = uboot_console.run_command("")
+    expected_response = addr_repeat + ": "
+    assert(expected_response in response)