summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-10-03 10:29:09 -0700
committerNingyuan Wang <nywang@google.com>2017-10-03 10:33:26 -0700
commit9644f59b8a506175e2b983ac8e088da12af854ef (patch)
tree2d70443c851e583f653c48f590199856f693e77c
parent6e5a94db8d7dc577a135cc81d80e0bdf39d42780 (diff)
downloadwifilogd-9644f59b8a506175e2b983ac8e088da12af854ef.tar.gz
Automatically do 'adb disable-verity' if needed
This also adds 'adb wait-for-device' before 'adb root' to correctly handle the case that device is not ready yet when runtest.sh is executed. Bug: 67326963 Test: run 'adb enable-verify' and 'adb reboot' then execute run_test.sh observe that 'adb disable-verify' is executed. Test: run 'adb disable-verify' and 'adb reboot' then execute run_test.sh observe that 'adb disable-verify' is not executed. Change-Id: I064a6408fefee13cc3c4882f060e3b5059364d4f
-rwxr-xr-xruntests.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/runtests.sh b/runtests.sh
index 9d6701a..7fae183 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -30,9 +30,21 @@ make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk \
set -x # print commands
+adb wait-for-device
adb root
adb wait-for-device
-adb remount
+
+# 'disable-verity' will appear in 'adb remount' output if
+# dm-verity is enabled and needs to be disabled.
+if adb remount | grep 'disable-verity'; then
+ adb disable-verity
+ adb reboot
+ adb wait-for-device
+ adb root
+ adb wait-for-device
+ adb remount
+fi
+
adb sync
adb shell /data/nativetest/wifilogd_unit_test/wifilogd_unit_test