1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2020 The Android Open Source Project
4  ~
5  ~ Licensed under the Apache License, Version 2.0 (the "License");
6  ~ you may not use this file except in compliance with the License.
7  ~ You may obtain a copy of the License at
8  ~
9  ~      http://www.apache.org/licenses/LICENSE-2.0
10  ~
11  ~ Unless required by applicable law or agreed to in writing, software
12  ~ distributed under the License is distributed on an "AS IS" BASIS,
13  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ~ See the License for the specific language governing permissions and
15  ~ limitations under the License.
16  -->
17<configuration description="Runs PermissionServicePerfTests metric instrumentation.">
18    <option name="test-suite-tag" value="apct"/>
19    <option name="test-suite-tag" value="apct-metric-instrumentation"/>
20    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
21        <option name="cleanup-apks" value="true"/>
22        <option name="test-file-name" value="PermissionServicePerfTests.apk"/>
23    </target_preparer>
24    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
25        <option name="cleanup-apks" value="true"/>
26        <option name="force-queryable" value="false"/>
27        <option name="test-file-name" value="UsePermissionApp0.apk"/>
28        <option name="test-file-name" value="UsePermissionApp1.apk"/>
29        <option name="test-file-name" value="UsePermissionApp2.apk"/>
30        <option name="test-file-name" value="UsePermissionApp3.apk"/>
31        <option name="test-file-name" value="UsePermissionApp4.apk"/>
32        <option name="test-file-name" value="UsePermissionApp5.apk"/>
33        <option name="test-file-name" value="UsePermissionApp6.apk"/>
34        <option name="test-file-name" value="UsePermissionApp7.apk"/>
35        <option name="test-file-name" value="UsePermissionApp8.apk"/>
36        <option name="test-file-name" value="UsePermissionApp9.apk"/>
37        <option name="test-file-name" value="UsePermissionApp10.apk"/>
38        <option name="test-file-name" value="UsePermissionApp11.apk"/>
39        <option name="test-file-name" value="UsePermissionApp12.apk"/>
40        <option name="test-file-name" value="UsePermissionApp13.apk"/>
41        <option name="test-file-name" value="UsePermissionApp14.apk"/>
42        <option name="test-file-name" value="UsePermissionApp15.apk"/>
43        <option name="test-file-name" value="UsePermissionApp16.apk"/>
44        <option name="test-file-name" value="UsePermissionApp17.apk"/>
45        <option name="test-file-name" value="UsePermissionApp18.apk"/>
46        <option name="test-file-name" value="UsePermissionApp19.apk"/>
47        <option name="test-file-name" value="UsePermissionApp20.apk"/>
48        <option name="test-file-name" value="UsePermissionApp21.apk"/>
49        <option name="test-file-name" value="UsePermissionApp22.apk"/>
50        <option name="test-file-name" value="UsePermissionApp23.apk"/>
51        <option name="test-file-name" value="UsePermissionApp24.apk"/>
52        <option name="test-file-name" value="UsePermissionApp25.apk"/>
53        <option name="test-file-name" value="UsePermissionApp26.apk"/>
54        <option name="test-file-name" value="UsePermissionApp27.apk"/>
55        <option name="test-file-name" value="UsePermissionApp28.apk"/>
56        <option name="test-file-name" value="UsePermissionApp29.apk"/>
57    </target_preparer>
58
59    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
60        <option name="package" value="android.perftests.permission"/>
61        <option name="hidden-api-checks" value="false"/>
62    </test>
63
64    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
65        <option name="directory-keys" value="/data/local/PermissionServicePerfTests"/>
66        <option name="collect-on-run-ended-only" value="true"/>
67    </metrics_collector>
68
69    <!-- Needed for pushing the trace config file -->
70    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
71    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
72        <option name="push-file" key="trace_config_detailed.textproto"
73                value="/data/misc/perfetto-traces/trace_config.textproto"/>
74        <!--Install the content provider automatically when we push some file in sdcard folder.-->
75        <!--Needed to avoid the installation during the test suite.-->
76        <option name="push-file" key="trace_config_detailed.textproto"
77                value="/sdcard/sample.textproto"/>
78        <option name="push-file" key="UsePermissionApp0.apk"
79                value="/data/local/tmp/perftests/UsePermissionApp0.apk" />
80        <option name="push-file" key="UsePermissionApp1.apk"
81                value="/data/local/tmp/perftests/UsePermissionApp1.apk" />
82        <option name="push-file" key="UsePermissionApp2.apk"
83                value="/data/local/tmp/perftests/UsePermissionApp2.apk" />
84        <option name="push-file" key="UsePermissionApp3.apk"
85                value="/data/local/tmp/perftests/UsePermissionApp3.apk" />
86        <option name="push-file" key="UsePermissionApp4.apk"
87                value="/data/local/tmp/perftests/UsePermissionApp4.apk" />
88        <option name="push-file" key="UsePermissionApp5.apk"
89                value="/data/local/tmp/perftests/UsePermissionApp5.apk" />
90        <option name="push-file" key="UsePermissionApp6.apk"
91                value="/data/local/tmp/perftests/UsePermissionApp6.apk" />
92        <option name="push-file" key="UsePermissionApp7.apk"
93                value="/data/local/tmp/perftests/UsePermissionApp7.apk" />
94        <option name="push-file" key="UsePermissionApp8.apk"
95                value="/data/local/tmp/perftests/UsePermissionApp8.apk" />
96        <option name="push-file" key="UsePermissionApp9.apk"
97                value="/data/local/tmp/perftests/UsePermissionApp9.apk" />
98        <option name="push-file" key="UsePermissionApp10.apk"
99                value="/data/local/tmp/perftests/UsePermissionApp10.apk" />
100        <option name="push-file" key="UsePermissionApp11.apk"
101                value="/data/local/tmp/perftests/UsePermissionApp11.apk" />
102        <option name="push-file" key="UsePermissionApp12.apk"
103                value="/data/local/tmp/perftests/UsePermissionApp12.apk" />
104        <option name="push-file" key="UsePermissionApp13.apk"
105                value="/data/local/tmp/perftests/UsePermissionApp13.apk" />
106        <option name="push-file" key="UsePermissionApp14.apk"
107                value="/data/local/tmp/perftests/UsePermissionApp14.apk" />
108        <option name="push-file" key="UsePermissionApp15.apk"
109                value="/data/local/tmp/perftests/UsePermissionApp15.apk" />
110        <option name="push-file" key="UsePermissionApp16.apk"
111                value="/data/local/tmp/perftests/UsePermissionApp16.apk" />
112        <option name="push-file" key="UsePermissionApp17.apk"
113                value="/data/local/tmp/perftests/UsePermissionApp17.apk" />
114        <option name="push-file" key="UsePermissionApp18.apk"
115                value="/data/local/tmp/perftests/UsePermissionApp18.apk" />
116        <option name="push-file" key="UsePermissionApp19.apk"
117                value="/data/local/tmp/perftests/UsePermissionApp19.apk" />
118        <option name="push-file" key="UsePermissionApp20.apk"
119                value="/data/local/tmp/perftests/UsePermissionApp20.apk" />
120        <option name="push-file" key="UsePermissionApp21.apk"
121                value="/data/local/tmp/perftests/UsePermissionApp21.apk" />
122        <option name="push-file" key="UsePermissionApp22.apk"
123                value="/data/local/tmp/perftests/UsePermissionApp22.apk" />
124        <option name="push-file" key="UsePermissionApp23.apk"
125                value="/data/local/tmp/perftests/UsePermissionApp23.apk" />
126        <option name="push-file" key="UsePermissionApp24.apk"
127                value="/data/local/tmp/perftests/UsePermissionApp24.apk" />
128        <option name="push-file" key="UsePermissionApp25.apk"
129                value="/data/local/tmp/perftests/UsePermissionApp25.apk" />
130        <option name="push-file" key="UsePermissionApp26.apk"
131                value="/data/local/tmp/perftests/UsePermissionApp26.apk" />
132        <option name="push-file" key="UsePermissionApp27.apk"
133                value="/data/local/tmp/perftests/UsePermissionApp27.apk" />
134        <option name="push-file" key="UsePermissionApp28.apk"
135                value="/data/local/tmp/perftests/UsePermissionApp28.apk" />
136        <option name="push-file" key="UsePermissionApp29.apk"
137                value="/data/local/tmp/perftests/UsePermissionApp29.apk" />
138    </target_preparer>
139
140    <!-- Needed for pulling the collected trace config on to the host -->
141    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
142        <option name="pull-pattern-keys" value="perfetto_file_path"/>
143    </metrics_collector>
144
145    <!-- Needed for storing the perfetto trace files in the sdcard/test_results -->
146    <option name="isolated-storage" value="false"/>
147
148    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
149        <option name="package" value="android.perftests.permission"/>
150        <option name="hidden-api-checks" value="false"/>
151
152        <!-- Listener related args for collecting the traces and waiting for the device to
153             stabilize. -->
154        <option name="device-listeners"
155                value="android.device.collectors.ProcLoadListener,android.device.collectors.PerfettoListener"/>
156        <!-- Guarantee that user defined RunListeners will be running before any of the default
157             listeners defined in this runner. -->
158        <option name="instrumentation-arg" key="newRunListenerMode" value="true"/>
159
160        <!-- ProcLoadListener related arguments -->
161        <!-- Wait for device last minute threshold to reach 3 with 2 minute timeout before starting
162             the test run -->
163        <option name="instrumentation-arg" key="procload-collector:per_run" value="true"/>
164        <option name="instrumentation-arg" key="proc-loadavg-threshold" value="3"/>
165        <option name="instrumentation-arg" key="proc-loadavg-timeout" value="120000"/>
166        <option name="instrumentation-arg" key="proc-loadavg-interval" value="10000"/>
167
168        <!-- PerfettoListener related arguments -->
169        <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true"/>
170        <option name="instrumentation-arg" key="perfetto_config_file"
171                value="trace_config.textproto"/>
172
173        <!--
174         PackageInstallerBenchmark will break for 5 minutes time out so it changes to 10 minutes
175          -->
176        <option name="test-timeout" value="600000" />
177    </test>
178
179
180</configuration>
181