Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4148)

Unified Diff: bin/cros_run_wifi_tests.sh

Issue 6240018: This starts to fix the scripts so that they load from /usr/lib/crosutils (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: fixing bad merge Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/cros_run_vm_update ('k') | bin/cros_sign_to_ssd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_run_wifi_tests.sh
diff --git a/bin/cros_run_wifi_tests.sh b/bin/cros_run_wifi_tests.sh
index babb3d1b02ec0747be062aee2a0daa29db359e63..ce26a4cde0a8332150f9211351b890de96a59d26 100755
--- a/bin/cros_run_wifi_tests.sh
+++ b/bin/cros_run_wifi_tests.sh
@@ -7,17 +7,26 @@
# Wrapper script around run_remote_tests.sh that knows how to find
# device test cells.
+# --- BEGIN COMMON.SH BOILERPLATE ---
+# Load common CrOS utilities. Inside the chroot this file is installed in
+# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
+# location.
+find_common_sh() {
+ local common_paths=(/usr/lib/crosutils "$(dirname "$(readlink -f "$0")")/..")
+ local path
+
+ SCRIPT_ROOT=
+ for path in "${common_paths[@]}"; do
+ if [ -r "${path}/common.sh" ]; then
+ SCRIPT_ROOT=${path}
+ break
+ fi
+ done
+}
-# TODO(pstew): Apparently the script files are in transition from
-# src/scripts to src/scripts/bin. However this state has existed
-# for months now, therefore we need to look for the common libs in
-# both places
-script_root=$(dirname $0)
-if [ -f ${script_root}/../common.sh ] ; then
- script_root=${script_root}/..
-fi
-
-. "${script_root}/common.sh"
+find_common_sh
+. "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1)
+# --- END COMMON.SH BOILERPLATE ---
# Figure out the default chromelab server name. In order for this to
# work correctly, you have to:
@@ -145,10 +154,10 @@ fi
set $ret
remote=$1
shift
-for arg in $*; do
+for arg in "$@"; do
append_arg $arg
done
-eval "exec ${script_root}/run_remote_tests.sh \
+eval "exec ${SCRIPTS_DIR}/run_remote_tests.sh \
--args=\"${run_remote_args}\" --remote=${remote} $run_remote_flags \
$FLAGS_ARGV"
« no previous file with comments | « bin/cros_run_vm_update ('k') | bin/cros_sign_to_ssd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698