e2e-test: Add check for Instruction verification failures.

This commit is contained in:
John Hood
2015-10-19 18:33:09 -04:00
parent 484677289d
commit 992fec1f30
5 changed files with 62 additions and 3 deletions
+11 -1
View File
@@ -193,8 +193,18 @@ int main( int argc, char *argv[] )
&& (strcmp( argv[ 1 ], "new" ) == 0) ) {
/* new option syntax */
int opt;
while ( (opt = getopt( argc - 1, argv + 1, "i:p:c:svl:" )) != -1 ) {
while ( (opt = getopt( argc - 1, argv + 1, "@:i:p:c:svl:" )) != -1 ) {
switch ( opt ) {
/*
* This undocumented option does nothing but eat its argument.
* Useful in scripting where you prepend something to a
* mosh-server argv, and might end up with something like
* "mosh-server new -v new -c 256", now you can say
* "mosh-server new -v -@ new -c 256" to discard the second
* "new".
*/
case '@':
break;
case 'i':
desired_ip = optarg;
break;
+1
View File
@@ -1,6 +1,7 @@
EXTRA_DIST = \
hold-stdin print-exitstatus \
e2e-test e2e-test-server \
mosh-client mosh-server \
$(displaytests) \
emulation-attributes.test
+48 -2
View File
@@ -88,6 +88,26 @@ ssh_localhost_check()
return 0
}
# These two functions are wrappers for mosh-client/mosh-server to turn
# on verbosity and log stderr.
mosh_client()
{
if [ -z "$MOSH_CLIENT" -o -z "$MOSH_E2E_TEST" ]; then
test_error "mosh_client: variables missing\n"
fi
exec 2> "${MOSH_E2E_TEST}.client.stderr"
exec "$MOSH_CLIENT" "$@"
}
mosh_server()
{
if [ -z "$MOSH_SERVER" -o -z "$MOSH_E2E_TEST" ]; then
test_error "mosh_server: variables missing\n"
fi
exec 2> "${MOSH_E2E_TEST}.server.stderr"
exec "$MOSH_SERVER" new -v -@ "$@"
}
# main
# Set up environment
@@ -101,6 +121,20 @@ else
fi
fi
# Wrappers.
case "$(basename $0)" in
mosh-client)
mosh_client "$@"
exit
;;
mosh-server)
mosh_server "$@"
exit
;;
*)
;;
esac
if ! tmux_check; then
test_skipped "tmux unavailable\n"
fi
@@ -116,6 +150,7 @@ test_args=$@
# XXX could use AM testsubdir macro instead
test_dir=$(basename ${test_name}).d
test_script="${test_name}"
rm -rf "${test_dir}"
mkdir "${test_dir}"
@@ -161,8 +196,12 @@ fi
for run in $server_tests; do
log "Running server test %s.\n" "$run"
# These three variables are for the benefit of the mosh-client and mosh-server wrappers.
export MOSH_CLIENT="$PWD/../frontend/mosh-client"
export MOSH_SERVER="$PWD/../frontend/mosh-server"
export MOSH_E2E_TEST="$PWD/${test_dir}/${run}"
# XXX need to quote special chars in server pathname here somehow
sut="../../scripts/mosh --client=../frontend/mosh-client --server=$PWD/../frontend/mosh-server --local --bind-server=127.0.0.1 127.0.0.1"
sut="../../scripts/mosh --client=${srcdir}/mosh-client --server=${srcdir}/mosh-server --local --bind-server=127.0.0.1 127.0.0.1"
testarg=$run
if [ "$run" = "direct" ]; then
sut=""
@@ -187,7 +226,14 @@ for run in $server_tests; do
if [ "$server_rv" -ne 0 ]; then
test_error "server harness exited with status %s\n" "$server_rv"
fi
# Check for "round-trip" failures
if grep -q "round-trip Instruction verification failed" "${test_dir}/${run}.server.stderr"; then
test_error "Round-trip Instruction verification failed on server during %s\n" "$run"
fi
# XXX We'd also like to check for "target state Instruction
# verification failed", a new check, but tmux's lack of BCE
# support forces mosh to clear lines with spaces and change a
# framebuffer in a way that causes this to fire spuriously.
done
for compare in $compare_tests; do
+1
View File
@@ -0,0 +1 @@
e2e-test
+1
View File
@@ -0,0 +1 @@
e2e-test