path: root/
diff options
authorKevin Brodsky <>2015-12-16 11:05:57 +0000
committerVishal Bhoj <>2016-01-04 09:17:30 +0530
commitdc64acc3b35584243e27bdd9bfbf81647509a6e5 (patch)
tree8d41117dc8b4199b4ab6e40b44e62e07acffe1cd /
parent7d90c77e19510bb9de2c95215ad966480fcc9096 (diff)
Local mode for running target/host test now detects whether the script is being invoked through Jenkins by checking the existence of JENKINS_HOME. In this case, JENKINS_MODE is defined and the behaviour remains the same. Otherwise, the script assumes it is running on a local machine and does not modify the user environment or use sudo. Additionally, default values are provided for variables normally defined by Jenkins, so that it is possible to run the script without additional configuration on any machine that has been set up for building Android (repo is assumed to be in the PATH, for instance). In local mode, tries to honor the existing environment variables, for instance regarding ccache, instead of always redefining them. Change-Id: I5a91d6385919c06aeb0725101ffc87646479f6bc
Diffstat (limited to '')
1 files changed, 10 insertions, 7 deletions
diff --git a/ b/
index 9b3d69c..049716b 100755
--- a/
+++ b/
@@ -1,8 +1,9 @@
-. $PWD/
-sudo chmod -R 777 /tmp/
-sudo umount -f out/target/product
+# We do not use a tmpfs out/target/product in this test
+. $PWD/
+[[ $JENKINS_MODE ]] && sudo chmod 1777 /tmp
if [[ ! -e ./art/tools/ ]]; then
-wget -O ./art/tools/
-sed -i "s/build-art-target-tests/build-art-target/g" ./art/tools/
-chmod a+x ./art/tools/
+ wget -O ./art/tools/
+ sed -i "s/build-art-target-tests/build-art-target/g" ./art/tools/
+ chmod a+x ./art/tools/
MAKE_START=$(date +%s.%N)
@@ -24,7 +25,9 @@ export CUSTOM_TARGET_LINKER=/data/local/tmp/system/bin/linker64
export ANDROID_PRODUCT_OUT=$PWD/out/target/product/armv8/
export TARGET_PRODUCT=armv8
time ./art/tools/ -j12 --target
-sudo out/host/linux-x86/bin/adb start-server
+# Build servers do not necessarily have up to date udev rules, start adb-server
+# as root to avoid the issue
+[[ $JENKINS_MODE ]] && sudo out/host/linux-x86/bin/adb start-server
adb shell rm -rf /data/local/tmp /data/art-test /data/nativetest