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
+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