1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2022 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16<configuration description="Config for CTS AdServices test cases requiring a debuggable app">
17    <object class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController"
18            type="module_controller">
19        <option name="mainline-module-package-name" value="com.google.android.adservices" />
20    </object>
21    <option name="config-descriptor:metadata" key="component" value="adservices" />
22    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
23    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
24    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
25    <option name="test-suite-tag" value="cts" />
26    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
27        <option name="cleanup-apks" value="true" />
28        <option name="test-file-name" value="CtsAdServicesDebuggableDeviceTestCases.apk" />
29    </target_preparer>
30
31    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
32        <!-- Disable kill switches to ignore the effect of actual PH values. -->
33        <option name="run-command" value="device_config put adservices global_kill_switch false" />
34        <option name="run-command" value="device_config put adservices fledge_select_ads_kill_switch false" />
35        <option name="run-command" value="device_config put adservices fledge_custom_audience_service_kill_switch false" />
36        <option name="run-command" value="device_config put adservices fledge_schedule_custom_audience_update_enabled true" />
37        <option name="run-command" value="device_config put adservices adid_kill_switch false" />
38
39        <!-- Override Consent notification to debug mode to grant user consent -->
40        <option name="run-command"
41                value="setprop debug.adservices.consent_notified_debug_mode true"/>
42        <option name="teardown-command"
43                value="setprop debug.adservices.consent_notified_debug_mode false"/>
44
45        <!-- Override Consent Manager to debug mode to grant user consent -->
46        <option name="run-command" value="setprop debug.adservices.consent_manager_debug_mode true" />
47        <option name="teardown-command" value="setprop debug.adservices.consent_manager_debug_mode false"/>
48
49        <!-- Override MDD background job to avoid race condition. -->
50        <option name="run-command"
51                value="device_config put adservices mdd_background_task_kill_switch true"/>
52        <option name="teardown-command"
53                value="device_config put adservices mdd_background_task_kill_switch false"/>
54
55        <!-- Increase the allowed API queries per second -->
56        <option name="run-command" value="device_config put adservices sdk_request_permits_per_second 100000" />
57        <option name="teardown-command" value="device_config put adservices sdk_request_permits_per_second 1" />
58
59        <!-- Temporarily disable Device Config sync -->
60        <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
61        <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
62
63        <option name="run-command" value="setprop log.tag.adservices VERBOSE" />
64        <option name="run-command" value="setprop log.tag.adservices.fledge VERBOSE" />
65
66        <!-- Temporarily enable enrollment seed for testing -->
67        <option name="run-command"
68                value="device_config put adservices enable_enrollment_test_seed true" />
69        <option name="teardown-command"
70                value="device_config put adservices enable_enrollment_test_seed false" />
71
72        <!-- Disable Register Ad Beacon Feature at run -->
73        <option name="run-command" value="device_config put adservices fledge_register_ad_beacon_enabled false" />
74
75        <!-- Disable Register Ad Beacon Feature at teardown -->
76        <option name="teardown-command" value="device_config put adservices fledge_register_ad_beacon_enabled false" />
77
78        <!-- Disable CPC billing feature at run -->
79        <option name="run-command" value="device_config put adservices fledge_cpc_billing_enabled false" />
80
81        <!-- Disable CPC billing feature at teardown -->
82        <option name="teardown-command" value="device_config put adservices fledge_cpc_billing_enabled false" />
83    </target_preparer>
84
85    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
86        <option name="package" value="android.adservices.debuggablects" />
87        <option name="hidden-api-checks" value="false" />
88        <option name="exclude-annotation" value="org.junit.Ignore" />
89    </test>
90</configuration>
91
92