summaryrefslogtreecommitdiff
path: root/test-art-target-test.sh
diff options
context:
space:
mode:
authorKevin Brodsky <kevin.brodsky@linaro.org>2015-12-16 11:05:57 +0000
committerVishal Bhoj <vishal.bhoj@linaro.org>2016-01-04 09:17:30 +0530
commitdc64acc3b35584243e27bdd9bfbf81647509a6e5 (patch)
tree8d41117dc8b4199b4ab6e40b44e62e07acffe1cd /test-art-target-test.sh
parent7d90c77e19510bb9de2c95215ad966480fcc9096 (diff)
downloadart-build-tests.sh-dc64acc3b35584243e27bdd9bfbf81647509a6e5.tar.gz
Local mode for running target/host test
setup-android.sh 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, setup-android.sh tries to honor the existing environment variables, for instance regarding ccache, instead of always redefining them. Change-Id: I5a91d6385919c06aeb0725101ffc87646479f6bc
Diffstat (limited to 'test-art-target-test.sh')
-rwxr-xr-xtest-art-target-test.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/test-art-target-test.sh b/test-art-target-test.sh
index 9b3d69c..049716b 100755
--- a/test-art-target-test.sh
+++ b/test-art-target-test.sh
@@ -1,8 +1,9 @@
#!/bin/bash
-. $PWD/setup-android.sh
-sudo chmod -R 777 /tmp/
-sudo umount -f out/target/product
+# We do not use a tmpfs out/target/product in this test
+NO_TMPFS_TARGET_PRODUCT=y
+. $PWD/setup-android.sh
+[[ $JENKINS_MODE ]] && sudo chmod 1777 /tmp
TEST_ART_COMMAND="test-art-target"
TEST_ART_OUTPUT_DIR=$WORKSPACE/$TEST_ART_COMMAND/
@@ -11,9 +12,9 @@ MAKE_TARGETS=$TEST_ART_COMMAND
mkdir -p $WORKSPACE/$TEST_ART_COMMAND/
if [[ ! -e ./art/tools/buildbot-build.sh ]]; then
-wget https://android-git.linaro.org/gitweb/platform/art.git/blob_plain/refs/heads/master:/tools/buildbot-build.sh -O ./art/tools/buildbot-build.sh
-sed -i "s/build-art-target-tests/build-art-target/g" ./art/tools/buildbot-build.sh
-chmod a+x ./art/tools/buildbot-build.sh
+ wget https://android-git.linaro.org/gitweb/platform/art.git/blob_plain/refs/heads/master:/tools/buildbot-build.sh -O ./art/tools/buildbot-build.sh
+ sed -i "s/build-art-target-tests/build-art-target/g" ./art/tools/buildbot-build.sh
+ chmod a+x ./art/tools/buildbot-build.sh
fi
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/buildbot-build.sh -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
./art/tools/setup-buildbot-device.sh