From ff7dcd7e4d50ce99f57bd0cee90aded7036c5388 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 13 Sep 2017 18:11:14 -0700 Subject: [PATCH] Audio VTS: do not test duplicate policy configuration file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch only modifies the VTS tests. O generic policy configuration fallback is incorrect (see I2a39606cd820b5cd27a640248bf692204ec2cd71 for the fix). Nevertheless, has no impact on products because this fallback is only used in aosp builds and GSI. Unfortunatly, this break the VTS test when run agains GSI. Because it is too late to change GSI for Oc and DR, relax the test to support current O GSI. For P, ihis patch will not be part of VTS and the fallback config will be fixed. Bug: 65535343 Merged-In: I2a39606cd820b5cd27a640248bf692204ec2cd71 Test: Following script: setup() { BUILD_ID=$1 TARGET_PRODUCT=$2 TARGET_BUILD_TYPE=${3:-userdebug} TARGET_ARCH=${4:-arm64} set +x echo "The following three variables can be overridden" \ "by setting the corresponding environment variable" set -x TEST_SUITES_TARGET=${VTS_TEST_SUITES_TARGET:-test_suites_${TARGET_ARCH}} BASE_TARGET=${VTS_BASE_TARGET:-${TARGET_PRODUCT}-${TARGET_BUILD_TYPE}} AOSP_TARGET=${VTS_AOSP_TARGET:-aosp_${TARGET_ARCH}_ab-${TARGET_BUILD_TYPE}} set +x download() { local target=$1 local file=$2 test -f $file || /google/data/ro/projects/android/fetch_artifact --bid $BUILD_ID --target $target $file || { local r=$?; rm $file; return $r; } } echo "Downloading" download $TEST_SUITES_TARGET 'android-vts.zip' download $BASE_TARGET "${TARGET_PRODUCT}-img-${BUILD_ID}.zip" download $AOSP_TARGET "aosp_${TARGET_ARCH}_ab-img-${BUILD_ID}.zip" echo "Unzipping" rm -r system.img android-vts unzip aosp_${TARGET_ARCH}_ab-img-$BUILD_ID.zip system.img unzip android-vts.zip echo "Building vbmeta without verity" avbtool make_vbmeta_image --flag 2 --output vbmeta.img set -x adb reboot bootloader fastboot update ${TARGET_PRODUCT}-img-$BUILD_ID.zip --skip-reboot fastboot flash vbmeta vbmeta.img || echo "Warning: Device does not support vbmeta" fastboot erase system fastboot flash system system.img fastboot erase metadata fastboot -w fastboot reboot echo "Board setup" echo "You may now start vts-tradefed with:" echo '$ ANDROID_BUILD_TOP= PATH="$PWD:$PATH" vts-tradefed' } VTS_TEST_SUITES_TARGET=test_suites_arm64_fastbuild3d_linux setup 4327646 sailfish vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation Change-Id: Ibe1feed41325a3e4fb25e959bd254156348aa584 Signed-off-by: Kevin Rocard --- audio/2.0/vts/functional/ValidateAudioConfiguration.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp index ee490239bf..ec3259a1e3 100644 --- a/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp +++ b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp @@ -28,6 +28,7 @@ TEST(CheckConfig, audioPolicyConfigurationValidation) { const auto configPath = folder + '/' + configName; if (access(configPath.c_str(), R_OK) == 0) { ASSERT_VALID_XML(configPath.c_str(), configSchemaPath); + return; // The framework does not read past the first config file found } } }