Merge "LUCI: Add build fuzz tests script to presubmits" into sc-dev am: eaa1e6d4a0 am: c6cfc6a296 am: 9a13a70164

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14486069

Change-Id: I11964ae28e3da961a07c77a88e9a9c0f0bce695b
This commit is contained in:
Fred Gylys-Colwell
2021-05-25 21:09:17 +00:00
committed by Automerger Merge Worker
2 changed files with 7 additions and 4 deletions

View File

@@ -4,13 +4,16 @@ set -ex
export CXX=clang++ export CXX=clang++
export CC=clang export CC=clang
export GYP_DEFINES="$GYP_DEFINES clang=1" export GYP_DEFINES="$GYP_DEFINES clang=1"
export PATH_TO_CDM_DIR=. export PATH_TO_CDM_DIR=.
gyp --format=ninja --depth=$(pwd) oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp export PYTHONPATH="$PYTHONPATH:$PATH_TO_CDM_DIR/third_party"
python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \
--depth=$(pwd) oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp
ninja -C out/Default ninja -C out/Default
# oemcrypto_odkitee_fuzztests.gypi has flags to instrument all the gyp targets # oemcrypto_odkitee_fuzztests.gypi has flags to instrument all the gyp targets
# with fuzzer flags. # with fuzzer flags.
gyp --format=ninja --depth=$(pwd) \ python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \
--depth=$(pwd) \
--include=oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gypi \ --include=oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gypi \
oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gyp oemcrypto/test/fuzz_tests/oemcrypto_odkitee_fuzztests.gyp
ninja -C out/Default ninja -C out/Default

View File

@@ -20,7 +20,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Convert OEMCrypto_LicenseType in core_response to a valid enum value. // Convert OEMCrypto_LicenseType in core_response to a valid enum value.
ConvertDataToValidEnum( ConvertDataToValidEnum(
OEMCrypto_LicenstType_MaxValue, OEMCrypto_LicenseType_MaxValue,
&license_api_fuzz.license_messages().core_response().license_type); &license_api_fuzz.license_messages().core_response().license_type);
license_api_fuzz.license_messages().EncryptAndSignResponse(); license_api_fuzz.license_messages().EncryptAndSignResponse();