diff --git a/tests/test_shell/tests/01-basic b/tests/test_shell/tests/01-basic index aea3e91b7a..7fa0c1044d 100755 --- a/tests/test_shell/tests/01-basic +++ b/tests/test_shell/tests/01-basic @@ -1,10 +1,15 @@ #!/usr/bin/expect -set timeout 5 - spawn make term -sleep 1 +set timeout 5 +expect { + "test_shell" {} + timeout { exit 1 } +} + +set timeout 1 + send "\n" send "\n" expect { diff --git a/tests/test_shell/tests/02-inputlength-regression b/tests/test_shell/tests/02-inputlength-regression deleted file mode 100755 index bd4e78d154..0000000000 --- a/tests/test_shell/tests/02-inputlength-regression +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect - -set timeout 1 - -spawn make term - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -sleep 1 -puts "\nTest successful!\n" diff --git a/tests/test_shell/tests/02-unknown-command b/tests/test_shell/tests/02-unknown-command index 15623ba586..754abc8029 100755 --- a/tests/test_shell/tests/02-unknown-command +++ b/tests/test_shell/tests/02-unknown-command @@ -1,10 +1,15 @@ #!/usr/bin/expect -set timeout 2 - spawn make term -sleep 1 +set timeout 5 +expect { + "test_shell" {} + timeout { exit 1 } +} + +set timeout 1 + send "\n" send "\n" expect { @@ -14,7 +19,12 @@ expect { send "some_definately_unknown_command\n" expect { - "shell: command not found." {} + "shell: command not found:" { + expect { + "some_definately_unknown_command" {} + timeout { exit 1 } + } + } timeout { exit 1 } } diff --git a/tests/test_shell/tests/03-inputlength-regression b/tests/test_shell/tests/03-inputlength-regression new file mode 100755 index 0000000000..625527ad08 --- /dev/null +++ b/tests/test_shell/tests/03-inputlength-regression @@ -0,0 +1,53 @@ +#!/usr/bin/expect + +spawn make term + +set timeout 5 +expect { + "test_shell" {} + timeout { exit 1 } +} + +set timeout 1 + +send "\n" +expect { + ">" {} + timeout { exit 1 } +} + +send "start_test\n" +expect { + "\[TEST_START\]" {} + timeout { exit 1 } +} +expect { + ">" {} + timeout { exit 1 } +} + +for { set i 0 } { $i < 10 } { incr i 1 } { + send "123456789012345678901234567890123456789012345678901234567890\n" + expect { + "shell: command not found:" { + expect { + "123456789012345678901234567890123456789012345678901234567890" {} + timeout { exit 1 } + } + } + timeout { exit 1 } + } +} + +send "end_test\n" +expect { + "\[TEST_END\]" {} + timeout { exit 1 } +} +expect { + ">" {} + timeout { exit 1 } +} + +sleep 1 +puts "\nTest successful!\n"