[zorg] r306635 - [asan] Run Android tests without asan_device_setup
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 28 20:03:42 PDT 2017
Author: vitalybuka
Date: Wed Jun 28 20:03:42 2017
New Revision: 306635
URL: http://llvm.org/viewvc/llvm-project?rev=306635&view=rev
Log:
[asan] Run Android tests without asan_device_setup
asan_device_setup requires rooted device. After this change any device with
debug authorization should work.
Modified:
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh?rev=306635&r1=306634&r2=306635&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh Wed Jun 28 20:03:42 2017
@@ -63,15 +63,10 @@ build_android() {
# Testing armv7 instead of plain arm to work around
# https://code.google.com/p/android/issues/detail?id=68779
build_android arm armv7-linux-androideabi armeabi-v7a
-build_android x86 i686-linux-android x86
-build_android arm64 aarch64-linux-android arm64-v8a
+test_android arm armeabi-v7a @@@STEP_FAILURE@@@
-echo @@@BUILD_STEP restart adb@@@
-export USER=$( id -un )
-export HOME=$( getent passwd "$USER" | cut -d: -f6 )
-ADB_TRACE=all adb kill-server || true
-ADB_TRACE=all adb devices || true
+build_android arm64 aarch64-linux-android arm64-v8a
+test_android arm64 arm64-v8a @@@STEP_FAILURE@@@
-test_android arm armeabi-v7a @@@STEP_FAILURE@@@
+build_android x86 i686-linux-android x86
test_android x86 x86 @@@STEP_FAILURE@@@
-test_android arm64 arm64-v8a @@@STEP_FAILURE@@@
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh?rev=306635&r1=306634&r2=306635&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh Wed Jun 28 20:03:42 2017
@@ -122,6 +122,7 @@ function test_android { # ARCH ABI STEP_
local _abi=$2
local _step_failure=$3
ADB=adb
+ $ADB kill-server
ANDROID_DEVICES=$(${ADB} devices | grep 'device$' | awk '{print $1}')
for SERIAL in $ANDROID_DEVICES; do
ABILIST=$(${ADB} -s $SERIAL shell getprop ro.product.cpu.abilist)
@@ -144,26 +145,18 @@ function test_android_on_device { # ARCH
DEVICE_DESCRIPTION=$_arch/$_build_flavor/$_build_id
SYMBOLIZER_BIN=$ROOT/llvm_build_android_$_arch/bin/llvm-symbolizer
+ ASAN_RT=$(find $ROOT/llvm_build64/lib/ -name libclang_rt.asan-$_arch-android.so)
COMPILER_RT_BUILD_DIR=$ROOT/compiler_rt_build_android_$_arch
ADB=adb
- DEVICE_ROOT=/data/local/asan_test
+ DEVICE_ROOT=/data/local/tmp/Output
export ANDROID_SERIAL=$_serial
echo "Serial $_serial"
echo @@@BUILD_STEP device setup [$DEVICE_DESCRIPTION]@@@
-
$ADB wait-for-device
-
- echo "Device is up"
$ADB devices
- ($ADB disable-verity | grep "already disabled") || $ADB reboot
- $ADB wait-for-device
-
- ADB=$ADB $ROOT/llvm_build64/bin/asan_device_setup
- sleep 2
-
# Nexus Player does not have enough RAM to run ASan tests reliably.
# Luckily, none of our tests need the application runtime, and killing
# that can free several hundred megs of RAM.
@@ -175,33 +168,28 @@ function test_android_on_device { # ARCH
# Kill leftover symbolizers. TODO: figure out what's going on.
$ADB shell pkill llvm-symbolizer || true
- $ADB push $SYMBOLIZER_BIN /system/bin/
$ADB shell rm -rf $DEVICE_ROOT
$ADB shell mkdir $DEVICE_ROOT
+ $ADB push $SYMBOLIZER_BIN $DEVICE_ROOT/
+ $ADB push $ASAN_RT $DEVICE_ROOT/
+ $ADB push $COMPILER_RT_BUILD_DIR/lib/sanitizer_common/tests/SanitizerTest $DEVICE_ROOT/
+ $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanTest $DEVICE_ROOT/
+ $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanNoinstTest $DEVICE_ROOT/
echo @@@BUILD_STEP run asan lit tests [$DEVICE_DESCRIPTION]@@@
-
(cd $COMPILER_RT_BUILD_DIR && ninja check-asan) || echo $_step_failure
echo @@@BUILD_STEP run sanitizer_common tests [$DEVICE_DESCRIPTION]@@@
-
- $ADB push $COMPILER_RT_BUILD_DIR/lib/sanitizer_common/tests/SanitizerTest $DEVICE_ROOT/
-
$ADB shell "$DEVICE_ROOT/SanitizerTest; \
echo \$? >$DEVICE_ROOT/error_code"
$ADB pull $DEVICE_ROOT/error_code error_code && (exit `cat error_code`) || echo $_step_failure
echo @@@BUILD_STEP run asan tests [$DEVICE_DESCRIPTION]@@@
-
- $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanTest $DEVICE_ROOT/
- $ADB push $COMPILER_RT_BUILD_DIR/lib/asan/tests/AsanNoinstTest $DEVICE_ROOT/
-
if [[ $_arch == aarch64 || $_arch == x86_64 ]]; then
ASANWRAPPER=
else
ASANWRAPPER=asanwrapper
fi
-
NUM_SHARDS=7
for ((SHARD=0; SHARD < $NUM_SHARDS; SHARD++)); do
$ADB shell "ASAN_OPTIONS=start_deactivated=1 \
@@ -217,8 +205,4 @@ function test_android_on_device { # ARCH
echo \$? >$DEVICE_ROOT/error_code"
$ADB pull $DEVICE_ROOT/error_code error_code && echo && (exit `cat error_code`) || echo $_step_failure
done
-
- sleep 2
-
- $ADB devices
}
More information about the llvm-commits
mailing list