Reverse LD_LIBRARY_PATH order based on liboemcrypto.so

am: 45d02c545c

Change-Id: I2e28abef3400773443df0bbb0f6392663bbd93a6
This commit is contained in:
Srujan Gaddam
2019-05-24 12:28:52 -07:00
committed by android-build-merger

View File

@@ -43,6 +43,14 @@ adb_shell_run() {
echo "------ Starting: $test_file"
local tmp_log="$OUT/mediadrmtest.log"
local adb_error="[ADB SHELL] $@ $test_file failed"
# The liboemcrypto.so looks for other shared libraries using the
# LD_LIBRARY_PATH. It is possible that even though the 64-bit liboemcrypto.so
# does not exist, there are 64-bit versions of the shared libraries it tries
# to load. We must reverse the library path in this case so we don't attempt
# to load 64-bit libraries with the 32-bit liboemcrypto.so.
if ! adb $SERIAL_NUM shell ls /vendor/lib64/liboemcrypto.so &> /dev/null; then
OEC_PATHS=/vendor/lib:/vendor/lib64
fi
adb $SERIAL_NUM shell "LD_LIBRARY_PATH=$OEC_PATHS GTEST_FILTER=$GTEST_FILTER $@ $test_file" \|\| echo "$adb_error" | tee "$tmp_log"
! grep -Fq "$adb_error" "$tmp_log"
local result=$?