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

Unified Diff: run_remote_tests.sh

Issue 2728006: Make run_remote_tests.sh support --results_dir_root. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Created 10 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: run_remote_tests.sh
diff --git a/run_remote_tests.sh b/run_remote_tests.sh
index 48b497d9fc80b78518f6f50f3ed0c51e540e3a21..7418f284a1ecbba4d4a7c00ba4dcbcb632de75c4 100755
--- a/run_remote_tests.sh
+++ b/run_remote_tests.sh
@@ -149,15 +149,37 @@ function main() {
exit 1
fi
+ # Check the validity of the user-specified result directory
+ # It must be within the /tmp directory
+ if [[ -n "${FLAGS_results_dir_root}" ]]; then
+ SUBSTRING=${FLAGS_results_dir_root:0:5}
+ if [[ ${SUBSTRING} != "/tmp/" ]]; then
+ echo "User-specified result directory must be within the /tmp directory"
+ echo "ex: --results_dir_root=/tmp/<result_directory>"
+ exit 1
+ fi
+ fi
+
set -e
# Set global TMP for remote_access.sh's sake
- if [[ ${INSIDE_CHROOT} -eq 0 ]]
- then
- TMP=$(mktemp -d ${FLAGS_chroot}/tmp/run_remote_tests.XXXX)
+ # and if --results_dir_root is specified,
+ # set TMP and create dir appropriately
+ if [[ ${INSIDE_CHROOT} -eq 0 ]]; then
+ if [[ -n "${FLAGS_results_dir_root}" ]]; then
+ TMP=${FLAGS_chroot}${FLAGS_results_dir_root}
+ mkdir -m 777 ${TMP}
+ else
+ TMP=$(mktemp -d ${FLAGS_chroot}/tmp/run_remote_tests.XXXX)
+ fi
TMP_INSIDE_CHROOT=$(echo ${TMP#${FLAGS_chroot}})
else
- TMP=$(mktemp -d /tmp/run_remote_tests.XXXX)
+ if [[ -n "${FLAGS_results_dir_root}" ]]; then
+ TMP=${FLAGS_results_dir_root}
+ mkdir -m 777 ${TMP}
+ else
+ TMP=$(mktemp -d /tmp/run_remote_tests.XXXX)
+ fi
TMP_INSIDE_CHROOT=${TMP}
fi
@@ -217,12 +239,6 @@ function main() {
echo_color "yellow" " * " "${CONTROL_FILE}"
done
- if [[ -z "${FLAGS_results_dir_root}" ]]; then
- FLAGS_results_dir_root="${TMP_INSIDE_CHROOT}"
- fi
-
- mkdir -p "${FLAGS_results_dir_root}"
-
for control_file in ${control_files_to_run}; do
# Assume a line starts with TEST_TYPE =
control_file=$(remove_quotes "${control_file}")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698