[ Merge of http://go/wvgerrit/183472 ] For provisioning 4.0 devices, the DRM certificate serial number was changing on a reprovisioning attempt or factory reset. The app parameters sent up in the client identification name-value pair field were being filtered out in provisioning requests. This has been corrected for provisioning 4.0 stage 2 (DRM certificate request). There is no need to include them for stage 1 (OEM certificate request). The test case WvCdmRequestLicenseTest.ProvisioningSpoidTest was created earlier to ensure that SPOIDs and DRM certificates are stable. Unfortunately due to another bug b/250099615, the RKP service was holding a connection to the Widevine TA for provisioning 4.0 devices. When native tests ran as their own process, L1 would fail to load due to a connection failure and the test would run as L3. The tests passed for provisioning 4.0 devices Pixel 7 and 8 when they should have failed. This gave us a false sense of confidence that the SPOIDs were stable. For now a workaround is to run a shell command to kill the widevine TA before running native tests. $ adb shell pkill -f -9 widevine New tests have been introduced to provide integration coverage WVPluginTest at the WV plugin level and CoreIntegrationTest for core. GTS tests are also being written in b/295538002. Bug: 294451432 Bug: 293950895 Test: WVPluginTest.ProvisioningStableSpoidTestL1, WVTS tests Change-Id: Ib9ace4387866ea38bb1840feb69cea78d2d2c09c
118 lines
3.2 KiB
Bash
Executable File
118 lines
3.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if [ -z "$ANDROID_BUILD_TOP" ]; then
|
|
echo "Android build environment not set"
|
|
exit -1
|
|
fi
|
|
|
|
# Read arguments in case the user wants to do a multicore build or
|
|
# copy files to a specific android device by providing a serial number.
|
|
NUM_CORES=1
|
|
SERIAL_NUM=""
|
|
while getopts "j:s:" opt; do
|
|
case $opt in
|
|
j)
|
|
NUM_CORES=$OPTARG
|
|
;;
|
|
s)
|
|
SERIAL_NUM="-s $OPTARG"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Define the relevant aliases
|
|
source $ANDROID_BUILD_TOP/build/envsetup.sh
|
|
|
|
# Build all the targets
|
|
# This list is slightly longer than the one in run_all_unit_tests.sh because
|
|
# it does not run very long tests or tests needing special setup.
|
|
WV_UNITTESTS="base64_test \
|
|
buffer_reader_test \
|
|
cdm_coverage_test \
|
|
cdm_engine_test \
|
|
cdm_engine_metrics_decorator_unittest \
|
|
cdm_feature_test \
|
|
cdm_extended_duration_test \
|
|
cdm_session_unittest \
|
|
cdm_usage_table_unittest \
|
|
certificate_provisioning_unittest \
|
|
counter_metric_unittest \
|
|
core_integration_test \
|
|
crypto_session_unittest \
|
|
device_files_unittest \
|
|
distribution_unittest \
|
|
duration_use_case_test \
|
|
event_metric_unittest \
|
|
file_store_unittest \
|
|
file_utils_unittest \
|
|
generic_crypto_unittest \
|
|
hal_metrics_adapter_unittest \
|
|
http_socket_test \
|
|
initialization_data_unittest \
|
|
keybox_ota_test \
|
|
libwvdrmdrmplugin_hal_test \
|
|
libwvdrmengine_hal_test \
|
|
libwvdrmmediacrypto_hal_test \
|
|
license_keys_unittest \
|
|
license_unittest \
|
|
metrics_collections_unittest \
|
|
oemcrypto_test \
|
|
odk_test \
|
|
okp_fallback_policy_test \
|
|
ota_keybox_provisioner_test \
|
|
policy_engine_constraints_unittest \
|
|
policy_engine_unittest \
|
|
policy_integration_test \
|
|
reboot_test \
|
|
request_license_test \
|
|
rw_lock_test \
|
|
service_certificate_unittest \
|
|
system_id_extractor_unittest \
|
|
timer_unittest \
|
|
value_metric_unittest \
|
|
wv_cdm_metrics_test \
|
|
wv_plugin_test"
|
|
|
|
cd $ANDROID_BUILD_TOP
|
|
pwd
|
|
m -j $NUM_CORES $WV_UNITTESTS
|
|
|
|
|
|
# Detect the device and check if Verity is going to stop the script from working
|
|
echo "waiting for device"
|
|
ADB_OUTPUT=`adb $SERIAL_NUM root && echo ". " && adb $SERIAL_NUM wait-for-device remount`
|
|
echo $ADB_OUTPUT
|
|
if echo $ADB_OUTPUT | grep -qi "verity"; then
|
|
echo
|
|
echo "ERROR: This device has Verity enabled. build_and_run_all_unit_tests.sh "
|
|
echo "does not work if Verity is enabled. Please disable Verity with"
|
|
echo "\"adb $SERIAL_NUM disable-verity\" and try again."
|
|
exit -1
|
|
fi
|
|
|
|
# Push the files to the device
|
|
|
|
# Given a local path to a file, this will try to push it to /data/nativetest.
|
|
# If that fails, an error message will be printed.
|
|
try_adb_push() {
|
|
# android-tests.zip requires /data/nativetest, we should use the same
|
|
if [ -f $OUT/data/nativetest/$1 ]; then
|
|
test_file=$OUT/data/nativetest/$1
|
|
elif [ -f $OUT/data/nativetest/vendor/$1/$1 ]; then
|
|
test_file=$OUT/data/nativetest/vendor/$1/$1
|
|
else
|
|
echo "I cannot find $1"
|
|
echo "I think it should be in $OUT/data/nativetest"
|
|
exit 1
|
|
fi
|
|
adb $SERIAL_NUM shell mkdir -p /data/nativetest
|
|
adb $SERIAL_NUM push $test_file /data/nativetest/$1
|
|
}
|
|
|
|
# Push the tests to the device
|
|
for f in $WV_UNITTESTS; do
|
|
try_adb_push $f
|
|
done
|