summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2009-01-09 17:53:42 +0000
committerWolfram Sang <w.sang@pengutronix.de>2009-01-09 17:53:42 +0000
commitbab98d751a761209011c590833f6dd3c82674ad9 (patch)
tree8fafa0c56408f7549b931923899a995906813f0f /tests
parent7dbe09a0b58c5d231b3f7cf511697f69cbcc26dc (diff)
downloadptxdist-bab98d751a761209011c590833f6dd3c82674ad9.tar.gz
ptxdist-bab98d751a761209011c590833f6dd3c82674ad9.tar.xz
* tests: wait for own output to appear in input buffer (makes waiting for events more robust)
* tests: small whitespace removal git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@9468 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'tests')
-rw-r--r--tests/libptxdisttest.kermit12
-rwxr-xr-xtests/setenv.kermit6
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/libptxdisttest.kermit b/tests/libptxdisttest.kermit
index 02d498fd7..b139f90af 100644
--- a/tests/libptxdisttest.kermit
+++ b/tests/libptxdisttest.kermit
@@ -73,6 +73,12 @@ define ptx_wait_string {
ptx_check_fail "waiting for '\%2'"
}
+# Output something and sync to itself being output
+define ptx_lineout {
+ lineout \%1
+ input 5 \%1
+}
+
define ptx_uboot_enter_shell {
ptx_test_start "Logging into U-Boot"
@@ -96,14 +102,12 @@ define ptx_uboot_enter_shell {
define ptx_uboot_exec {
- lineout "\%2"
- # Wait for the command itself to sync to input buffer
- input 10 \%2
+ ptx_lineout "\%2"
input \%1 \m(uboot_prompt)
ptx_check_fail "timeout while waiting for u-boot prompt after '\%2'"
if = \m(uboot_version) 2 {
- lineout "echo result: $?"
+ ptx_lineout "echo result: $?"
input 10 \fpattern(result: 0$)
ptx_check_fail "returncode from '\%2' is not 0"
diff --git a/tests/setenv.kermit b/tests/setenv.kermit
index 84af52321..3d2de9f9d 100755
--- a/tests/setenv.kermit
+++ b/tests/setenv.kermit
@@ -7,7 +7,7 @@ define setenv_uboot_v1 {
ptx_check_fail "Could not open \%2."
clear input
- lineout "printenv"
+ ptx_lineout "printenv"
declare \&c[1000]
# array with entries to skip
@@ -66,7 +66,7 @@ define setenv_uboot_v2 {
ptx_uboot_exec 3 "eth0.netmask=\m(PTXCONF_BOARDSETUP_NETMASK)"
ptx_test_end
- ptx_test_start "Getting default environment"
+ ptx_test_start "Getting default environment"
ptx_uboot_exec 15 "ping $eth0.serverip"
ptx_uboot_exec 15 "tftp \m(imagename)"
ptx_test_end
@@ -78,7 +78,7 @@ define setenv_uboot_v2 {
ptx_test_end
ptx_uboot_exec_single "Reloading new environment" 10 "loadenv"
-
+
ptx_test_start "Restoring MAC address"
ptx_uboot_exec 5 "echo -a /env/config eth0.ethaddr=$eth0.ethaddr"
ptx_uboot_exec 10 "saveenv"