These are a set of CLs merged from the wv cdm repo to the android repo. * Make Android NDK Builds Work With Latest BoringSSL Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/37000 ] The latest updates to BoringSSL require C99 or later. Our NDK-based builds (OEMCrypto Variants & Fastball) were not specifying a C standard. This patch adds compiler flags so that C files are compiled as C11 now. Note that this is about the *C* standard in use, not the *C++* standard, which this patch leaves untouched. BUG: 67907873 Test: build_android_mock.sh * Update BoringSSL to f7412cb072cc6b1847140e0c4f8b3ceeccd0e708 Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36761 ] This is the result of running UPDATE_BORINGSSL.sh. Future runs of this script should produce much smaller sets of changed files, but because the BoringSSL revision already in this directory was so old and contained many extraneous files from the Android operating system, the set of changed files is extensive this time. BUG: 67907873 * Refactoring the build files. Author: Vasantha Rao Polipelli <vasanthap@google.com> [ Merge of http://go/wvgerrit/37041 ] Move all common build dependencies to .gypi so that all fuzz test binary targets can be added to .gyp file without repeating code. * Introduce service certificate request property Author: Rahul Frias <rfrias@google.com> [ Merge of http://go/wvgerrit/36941 ] Platforms differ on whether they allows service certificates to be requested if privacy mode is enabled and a certificate is not present. This property allows behavior to be configurable. Generating the service certificate request will be introduced in a follow on CL. BUG: 68328352 * Deprecate using keyboxes as identification Author: Rahul Frias <rfrias@google.com> [ Merge of http://go/wvgerrit/36740 ] Previously some platforms supported using keyboxes rather than certificates as the identification tokens in the license request message. All platforms that share core CDM code of the master branch now either provision using a keybox and use a DRM certificate or an OEM certificate as identification. No future usage of keyboxes as identifying tokens is planned. Since the platform property use_certificates_as_identification is always set to true, the negative code paths are never taken and can be removed. * OEMCrypto_GenerateSignature API Fuzz Test. Author: Vasantha Rao Polipelli <vasanthap@google.com> [ Merge of http://go/wvgerrit/36863 ] - The first automated API fuzz test. - Also sumitting the corpus for the API fuzzed. * Add Script to Update BoringSSL from Source Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36760 ] Adds a script to third_party/boringssl/ that, when run, deletes all the auto-generated files in the generated/ directory and regenerates them from scratch, starting from the latest public HEAD of BoringSSL. Bug: 67907873 * Fix Fastball / OEMCrypto Variant BoringSSL Makefiles Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36926 ] Previously, when moving the BoringSSL source within the tree, I was not able to verify that I had not broken the NDK-compatible makefiles used by Fastball because that build is broken on master. I had to make a best-guess as to how they should be updated and hope. Now, however, I have been informed that the OEMCrypto Variants also use these makefiles, and I have been able to use that build to find where I broke them and get them fully working. Bug: 67386164 Test: build_android_mock.sh * Add kit/ to BoringSSL Include Path for Fastball & OEMCrypto Variants Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36925 ] When I moved the BoringSSL source in the tree, I updated the Android.mk files that pointed to it in order to build it. I did not realize that some makefiles outside that directory also contained hardcoded pointers into that directory. These references broke after the move. This patch fixes those paths to point to the new BoringSSL location. Bug: 67386164 Test: build_android_mock.sh * OEMCrypto Unit Test Refactor. Author: Vasantha Rao Polipelli <vasanthap@google.com> [ Merge of http://go/wvgerrit/36562 ] Refactoring OEMCrypto Tests so the Session Utility test code can be reused in fuzz tests. * Reorder license server config table to match ids Author: Jeff Fore <jfore@google.com> [ Merge of http://go/wvgerrit/36743 ] * Separate Hand-Written BoringSSL Files from Downloaded/Generated Ones Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36561 ] I want to make updating BoringSSL as simple as possible for us going forward. A future commit will add a script that automatically downloads and sets up the latest version of BoringSSL. To facilitate this script, a clear distinction needs to be made between the files that can be downloaded with / regenerated from the BoringSSL source and the files that are maintained by us by hand. The version of BoringSSL in this change is exactly the same as the one already in this directory. It has just been moved one folder deeper. Bug: 67907873 * Remove BoringSSL Symlinks, They Are Confusing Gerrit Author: John W. Bruce <juce@google.com> [ Merge of http://go/wvgerrit/36560 ] There are some symlinks in the current copy of BoringSSL that are causing headaches when I try to upload future changes to Gerrit. These were inherited from the Android OS and are not used by our build anywhere. They would be wiped out when I update BoringSSL anyway, but wiping them out in a separate change before I upload any other changes avoids confusing Gerrit. Bug: 67907873 * Add group master key id to support sublicense master key rotation, and content identification. Author: Jeff Fore <jfore@google.com> [ Merge of http://go/wvgerrit/36180 ] * OEMCrypto Fuzzer test framework Author: Vasantha Rao Polipelli <vasanthap@google.com> [ Merge of http://go/wvgerrit/36280 ] - Adding a sample fuzz test. - Adding build scripts for building the new Fuzz Tests to come. Design doc: go/oemcrypt_ref_impl_fuzz * Build Mod Mock with C++ 11 Author: Fred Gylys-Colwell <fredgc@google.com> [ Merge of http://go/wvgerrit/36328 ] This should fix the android oemcrypto mock build: http://go/wvbuild/job/Android_OEMCrypto_Variants BUG: 71650075 Test: Not currently passing. Will be addressed in a subsequent commit in the chain. Change-Id: Ic4d5be3118ef97e3f7d386149a2b5d9be8f0a87e
124 lines
4.0 KiB
Bash
Executable File
124 lines
4.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
final_result=0
|
|
failed_tests=()
|
|
|
|
# Below, we will append filters to the exclusion portion of GTEST_FILTER, so we
|
|
# need to guarantee it has one.
|
|
if [ -z "$GTEST_FILTER" ]; then
|
|
# If it wasn't set, make it add all tests, and remove none.
|
|
GTEST_FILTER="*-"
|
|
# if GTEST_FILTER already has a negative sign, we leave it alone.
|
|
elif [ 0 -eq `expr index "$GTEST_FILTER" "-"` ]; then
|
|
# If GTEST_FILTER was set, but does not have a negative sign, add one. This
|
|
# gives gtest an empty list of tests to skip.
|
|
GTEST_FILTER="$GTEST_FILTER-"
|
|
fi
|
|
|
|
# Execute a command in "adb shell" and capture the result.
|
|
adb_shell_run() {
|
|
local test_file=$1
|
|
shift
|
|
if adb shell ls /data/bin/$test_file &> /dev/null; then
|
|
test_file=/data/bin/$test_file
|
|
else
|
|
echo "Please install the test on the device in /data/bin, "
|
|
echo "or begin execution by running ./build_and_run_all_unit_tests.sh"
|
|
exit 1
|
|
fi
|
|
echo $test_file
|
|
local tmp_log="$OUT/mediadrmtest.log"
|
|
local adb_error="[ADB SHELL] $@ $test_file failed"
|
|
adb shell "GTEST_FILTER=$GTEST_FILTER $@ $test_file" \|\| echo "$adb_error" | tee "$tmp_log"
|
|
! grep -Fq "$adb_error" "$tmp_log"
|
|
local result=$?
|
|
if [ $result -ne 0 ]; then
|
|
final_result=$result
|
|
failed_tests+=("$adb_error")
|
|
fi
|
|
}
|
|
|
|
# Use Package Manager (via adb shell) to enable or disable DroidGuard.
|
|
# Disabling DroidGuard during the test run prevents concurrency issues
|
|
# with provisioning status.
|
|
set_droidguard() {
|
|
adb shell pm $1 com.google.android.gms/com.google.android.gms.droidguard.DroidGuardService
|
|
}
|
|
|
|
if [ -z "$ANDROID_BUILD_TOP" ]; then
|
|
echo "Android build environment not set"
|
|
exit -1
|
|
fi
|
|
|
|
echo "waiting for device"
|
|
ADB_OUTPUT=`adb root && echo ". " && adb wait-for-device remount`
|
|
echo $ADB_OUTPUT
|
|
if echo $ADB_OUTPUT | grep -qi "verity"; then
|
|
echo
|
|
echo "ERROR: This device has Verity enabled. run_all_unit_tests.sh does not "
|
|
echo "work if Verity is enabled. Please disable Verity with"
|
|
echo "\"adb disable-verity\" and try again."
|
|
exit -1
|
|
fi
|
|
|
|
# Disable DroidGuard to prevent provisioning collisions
|
|
set_droidguard disable
|
|
|
|
# Run oemcrypto tests first due to historical test order issues
|
|
adb_shell_run oemcrypto_test \
|
|
GTEST_FILTER="$GTEST_FILTER:*Level1Required" FORCE_LEVEL3_OEMCRYPTO=yes
|
|
adb_shell_run oemcrypto_test
|
|
|
|
# Run request_license_test next to ensure device is provisioned
|
|
adb_shell_run request_license_test
|
|
|
|
# cdm_extended_duration_test takes >30 minutes to run.
|
|
# adb_shell_run cdm_extended_duration_test
|
|
|
|
# cdm_feature_test to be run with modified/mock oemcrypto
|
|
# adb_shell_run cdm_feature_test
|
|
|
|
# Additional tests
|
|
adb_shell_run base64_test
|
|
adb_shell_run buffer_reader_test
|
|
adb_shell_run cdm_engine_test
|
|
adb_shell_run cdm_session_unittest
|
|
adb_shell_run counter_metric_unittest
|
|
adb_shell_run crypto_session_unittest
|
|
adb_shell_run device_files_unittest
|
|
adb_shell_run distribution_unittest
|
|
adb_shell_run event_metric_unittest
|
|
adb_shell_run file_store_unittest
|
|
adb_shell_run file_utils_unittest
|
|
adb_shell_run http_socket_test
|
|
adb_shell_run initialization_data_unittest
|
|
adb_shell_run libwvdrmdrmplugin_hidl_test
|
|
adb_shell_run libwvdrmdrmplugin_test
|
|
adb_shell_run libwvdrmmediacrypto_hidl_test
|
|
adb_shell_run libwvdrmmediacrypto_test
|
|
adb_shell_run license_keys_unittest
|
|
adb_shell_run license_unittest
|
|
adb_shell_run policy_engine_constraints_unittest
|
|
adb_shell_run policy_engine_unittest
|
|
adb_shell_run service_certificate_unittest
|
|
adb_shell_run timer_unittest
|
|
adb_shell_run usage_table_header_unittest
|
|
adb_shell_run value_metric_unittest
|
|
adb_shell_run wv_cdm_metrics_test
|
|
|
|
# Run the non-Treble test on non-Treble devices
|
|
if adb shell ls /vendor/lib/mediadrm/libwvdrmengine.so &> /dev/null ||
|
|
adb shell ls /vendor/lib64/mediadrm/libwvdrmengine.so &> /dev/null; then
|
|
library_path="/vendor/lib/mediadrm/:/vendor/lib64/mediadrm/"
|
|
adb_shell_run libwvdrmengine_test LD_LIBRARY_PATH=$library_path
|
|
fi
|
|
|
|
# Run the Treble test on Treble devices
|
|
if adb shell ls /vendor/lib/libwvhidl.so &> /dev/null ||
|
|
adb shell ls /vendor/lib64/libwvhidl.so &> /dev/null; then
|
|
adb_shell_run libwvdrmengine_hidl_test
|
|
fi
|
|
|
|
# Re-enable DroidGuard
|
|
set_droidguard enable
|