Skip to content

Commit 13b85f9

Browse files
DeviceInfracopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 875894289
1 parent 0dd641a commit 13b85f9

File tree

1 file changed

+15
-8
lines changed
  • src/java/com/google/devtools/mobileharness/platform/androiddesktop/device

1 file changed

+15
-8
lines changed

src/java/com/google/devtools/mobileharness/platform/androiddesktop/device/paris-check-health

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ function usage()
99
Usage: $progname [--device DEVICE] [--verbose] [--repair] [--deploy] [--latest-paris]
1010
1111
optional arguments:
12-
-h, --help show this help message and exit
13-
-v, --verbose increase the verbosity of the bash script
14-
-d, --device DEVICE device hostname[:port]
15-
--latest-paris Use latest paris version (default: prod)
16-
--repair repair the device
17-
--deploy deploy the device
12+
-h, --help show this help message and exit
13+
-v, --verbose increase the verbosity of the bash script
14+
-d, --device DEVICE device hostname[:port]
15+
--latest-paris Use latest paris version (default: prod)
16+
--repair repair the device
17+
--deploy deploy the device
18+
--depot-tools-path PATH path to depot tools (default: /usr/local/google/mobileharness/ate/cipd_packages)
1819
1920
HEREDOC
2021
}
@@ -26,6 +27,7 @@ deploy=0
2627
repair=0
2728
device=""
2829
useLatestParis=0
30+
depotToolsPath="/usr/local/google/mobileharness/ate/cipd_packages"
2931
port="5555"
3032
user=`whoami`
3133
tm=`date +"%Y-%m-%d_%H%M%S_%N"`
@@ -36,7 +38,7 @@ namespace=${UFS_NAMESPACE:-os}
3638
# use getopt and store the output into $OPTS
3739
# note the use of -o for the short options, --long for the long name options
3840
# and a : for any option that takes a parameter
39-
OPTS=$(getopt -o "hd:v" --long "help,device:,verbose,repair,deploy,latest-paris" -n "$progname" -- "$@")
41+
OPTS=$(getopt -o "hd:v" --long "help,device:,verbose,repair,deploy,latest-paris,depot-tools-path:" -n "$progname" -- "$@")
4042
if [ $? != 0 ] ; then echo "Error in command line arguments." >&2 ; usage; exit 1 ; fi
4143
eval set -- "$OPTS"
4244

@@ -49,6 +51,7 @@ while true; do
4951
--latest-paris ) useLatestParis=1; shift 1 ;;
5052
--repair ) repair=1; shift ;;
5153
--deploy ) deploy=1; shift ;;
54+
--depot-tools-path ) depotToolsPath="$2"; shift 2 ;;
5255
-v | --verbose ) verbose=$((verbose + 1)); shift ;;
5356
-- ) shift; break ;;
5457
* ) break ;;
@@ -60,6 +63,11 @@ if [ -z "${device}" ]; then
6063
exit -1
6164
fi
6265

66+
if [ ! -x "${depotToolsPath}/cipd" ]; then
67+
echo "Error: cipd executable not found at ${depotToolsPath}/cipd. Please check --depot-tools-path."
68+
exit 1
69+
fi
70+
6371
if [[ $device =~ ":" ]]; then
6472
port=${device##*:}
6573
device="${device%%:*}"
@@ -109,7 +117,6 @@ exitEarlyIfExistingRepairJobRunning "${device}"
109117

110118
cd "${dd}"
111119
# download paris
112-
depotToolsPath="/usr/local/google/mobileharness/runtime_files/recovery/depot_tools"
113120
"${depotToolsPath}"/cipd init -force -cache-dir "${pd}"
114121

115122
if [[ $useLatestParis -eq 1 ]]; then

0 commit comments

Comments
 (0)