Halt test running if remote board does not match source board.
When attempting to run tests from one board on another, no clear
error is reported. Unusual 'autoserv: error:' occurs with no
clear guidance.
Instead notice when the board mismatch occurs (usually because
of a mismatched default board) and notify the user.
If --allow_offline_remote the check is skipped.
BUG=chromium:222871
TEST=(default board is link and remote board is daisy)
TEST=./run_remote_tests.sh --board=daisy --remote=10.42.0.10 \
client/tests/sleeptest/control [works]
TEST=./run_remote_tests.sh --remote=10.42.0.10 \
client/tests/sleeptest/control [fails with clear error]
TEST=./run_remote_tests.sh --board=link --remote=10.42.0.10 \
client/tests/sleeptest/control [fails with clear error]
Change-Id: I138bf7d7adf0bb9b318e369348f1bcf41225e35c
Reviewed-on: https://gerrit.chromium.org/gerrit/46171
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Mike Truty <truty@chromium.org>
Tested-by: Mike Truty <truty@chromium.org>
diff --git a/run_remote_tests.sh b/run_remote_tests.sh
index 3174472..600df5a 100755
--- a/run_remote_tests.sh
+++ b/run_remote_tests.sh
@@ -397,6 +397,25 @@
fi
}
+# Fail if the remote board does not match FLAGS_board.
+verify_remote_board() {
+ [ ${FLAGS_allow_offline_remote} -eq ${FLAGS_TRUE} ] && return
+ remote_sh -n grep CHROMEOS_RELEASE_BOARD /etc/lsb-release
+ local remote_board=$(echo "${REMOTE_OUT}" | cut -d '=' -f 2)
+ if [ -z "${remote_board}" ]; then
+ error "Remote device does not properly report Board"
+ exit 1
+ fi
+ if [ -z "${FLAGS_board}" ]; then
+ error "--board not supplied and default board not found"
+ exit 1
+ fi
+ if [ "${FLAGS_board}" != "${remote_board}" ]; then
+ error "Can not run ${FLAGS_board} tests on ${remote_board}"
+ exit 1
+ fi
+}
+
main() {
cd "${SCRIPTS_DIR}"
@@ -438,6 +457,7 @@
start_ssh_agent >/dev/null
learn_board
+ verify_remote_board
if [[ -n "${FLAGS_autotest_dir}" ]]; then
if [ ! -d "${FLAGS_autotest_dir}" ]; then
die \