diff options
Diffstat (limited to 'tests/libptxdisttest.kermit')
-rw-r--r-- | tests/libptxdisttest.kermit | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/libptxdisttest.kermit b/tests/libptxdisttest.kermit index 061d42e3e..17dfac3de 100644 --- a/tests/libptxdisttest.kermit +++ b/tests/libptxdisttest.kermit @@ -1,4 +1,4 @@ -#!/usr/bin/kermit # -*-sh-*- +#!/usr/bin/kermit define ptx_init { @@ -60,36 +60,46 @@ define ptx_wait_string { define ptx_uboot_enter_shell { ptx_test_start "Logging into U-Boot" + minput 120 "U-Boot 1" "U-Boot 2" +:eval_again if failure { writeln ERROR "FAILED! (waiting for u-boot-signature)" exit 1 } lineout .uboot_version := \v(minput) - ptx_wait_string 10 "\m(PTXCONF_BOARDSETUP_UBOOTPROMPT)" + if = \m(uboot_version) 2 { + .uboot_prompt = "uboot:" + } else { + .uboot_prompt = "uboot> " + } + # sometimes there are caches for serial inputs containing old data + # make sure we act on the newest one + minput 120 "U-Boot 1" "U-Boot 2" \m(uboot_prompt) + if not = \v(minput) 3 goto eval_again ptx_test_end } define ptx_uboot_exec { lineout "\%2" - input \%1 \m(PTXCONF_BOARDSETUP_UBOOTPROMPT) + input \%1 \m(uboot_prompt) if failure { - writeln ERROR "FAILED! (timeout while waiting for u-boot prompt after \%2)" + writeln ERROR "FAILED! (timeout while waiting for u-boot prompt after '\%2')" exit 1 } if = \m(uboot_version) 2 { - lineout "echo k-res:$?" - input 10 \fpattern(k-res:0$) + lineout "echo result: $?" + input 10 \fpattern(result: 0$) if failure { - writeln ERROR "FAILED! (returncode from \%2 is not 0)" + writeln ERROR "FAILED! (returncode from '\%2' is not 0)" exit 1 } - input 10 \m(PTXCONF_BOARDSETUP_UBOOTPROMPT) + input 10 \m(uboot_prompt) } } |