diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-12-14 04:12:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-12-14 04:12:12 +0000 |
commit | 42c9e7e393583dfc243540e3d3b4ae7cdc46467f (patch) | |
tree | af917156323c556f391309a139e3923d5f15c3b3 | |
parent | 8f1fcd5b943121e7b021c50468e01e71adb9d514 (diff) | |
parent | f7572ec8ffd6bf45c077919a3f3fbb909ad142b2 (diff) | |
download | system_core-42c9e7e393583dfc243540e3d3b4ae7cdc46467f.tar.gz system_core-42c9e7e393583dfc243540e3d3b4ae7cdc46467f.tar.bz2 system_core-42c9e7e393583dfc243540e3d3b4ae7cdc46467f.zip |
Merge "fs_mgr: overlayfs: test inAdb and inFastboot"
-rwxr-xr-x | fs_mgr/tests/adb-remount-test.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fs_mgr/tests/adb-remount-test.sh b/fs_mgr/tests/adb-remount-test.sh index fde82b422..aaee1a7a1 100755 --- a/fs_mgr/tests/adb-remount-test.sh +++ b/fs_mgr/tests/adb-remount-test.sh @@ -36,14 +36,25 @@ NORMAL="${ESCAPE}[0m" Returns: true if device is in fastboot mode" ] inFastboot() { - fastboot devices | grep "^${ANDROID_SERIAL}[${SPACE}${TAB}]" > /dev/null + fastboot devices | + if [ -n "${ANDROID_SERIAL}" ]; then + grep "^${ANDROID_SERIAL}[${SPACE}${TAB}]" > /dev/null + else + wc -l | grep '^1$' >/dev/null + fi } [ "USAGE: inAdb Returns: true if device is in adb mode" ] inAdb() { - adb devices | grep -v 'List of devices attached' | grep "^${ANDROID_SERIAL}[${SPACE}${TAB}]" > /dev/null + adb devices | + grep -v 'List of devices attached' | + if [ -n "${ANDROID_SERIAL}" ]; then + grep "^${ANDROID_SERIAL}[${SPACE}${TAB}]" > /dev/null + else + wc -l | grep '^1$' >/dev/null + fi } [ "USAGE: adb_sh <commands> </dev/stdin >/dev/stdout 2>/dev/stderr @@ -277,7 +288,7 @@ if ! inAdb; then echo "${ORANGE}[ WARNING ]${NORMAL} device not in adb mode ... waiting 2 minutes" adb_wait 2m fi -inAdb || die "device not in adb mode" +inAdb || die "specified device not in adb mode" isDebuggable || die "device not a debug build" # Do something |