1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19java_defaults {
20    name: "apex_e2e_test_defaults",
21    libs: [
22        "tradefed",
23        "truth",
24    ],
25    static_libs: [
26        "apex_e2e_base_test",
27    ],
28}
29
30java_test_host {
31    name: "timezone_data_e2e_tests",
32    srcs: ["src/**/TimezoneDataHostTest.java"],
33    defaults: ["apex_e2e_test_defaults"],
34    static_libs: [
35        "platformprotos",
36    ],
37    data: [
38        ":test1_com.android.tzdata",
39    ],
40    test_config: "timezone-data-e2e-tests.xml",
41    test_suites: ["device-tests"],
42}
43
44java_test_host {
45    name: "media_e2e_tests",
46    srcs: ["src/**/MediaHostTest.java"],
47    defaults: ["apex_e2e_test_defaults"],
48    data: [
49        ":test_com.android.media",
50    ],
51    test_config: "media-e2e-tests.xml",
52    test_suites: ["device-tests"],
53}
54
55java_test_host {
56    name: "media_swcodec_e2e_tests",
57    srcs: ["src/**/MediaSwCodecHostTest.java"],
58    defaults: ["apex_e2e_test_defaults"],
59    data: [
60        ":test_com.android.media.swcodec",
61    ],
62    test_config: "media-swcodec-e2e-tests.xml",
63    test_suites: ["device-tests"],
64}
65
66java_test_host {
67    name: "apex_targetprep_tests",
68    libs: ["tradefed"],
69    srcs: ["src/**/ApexTargetPrepTest.java"],
70    data: [":StagedInstallTestApexV2"],
71    test_config: "apex-targetprep-tests.xml",
72    test_suites: ["general-tests"],
73}
74
75java_library_host {
76    name: "apex_e2e_base_test",
77    srcs: ["src/**/ApexE2EBaseHostTest.java"],
78    static_libs: [
79        "frameworks-base-hostutils",
80        "cts-install-lib-host",
81    ],
82    libs: [
83        "tradefed",
84    ],
85}
86
87apex {
88    name: "apex.test",
89    manifest: "testdata/apex_manifest.json",
90    androidManifest: "testdata/AndroidManifest.xml",
91    prebuilts: ["sample_prebuilt_file"],
92    key: "apex.test.key",
93    certificate: ":apex.test.certificate",
94    installable: false,
95    updatable: false,
96}
97
98apex_key {
99    name: "apex.test.key",
100    public_key: "testdata/com.android.apex.test.avbpubkey",
101    private_key: "testdata/com.android.apex.test.pem",
102    installable: false,
103}
104
105android_app_certificate {
106    name: "apex.test.certificate",
107    // will use testcert.pk8 and testcert.x509.pem
108    certificate: "testdata/testcert",
109}
110
111prebuilt_etc {
112    name: "apex.test.ld.config.txt",
113    src: "testdata/ld.config.txt",
114    filename: "ld.config.txt",
115    installable: false,
116}
117
118prebuilt_etc {
119    name: "sample_prebuilt_file",
120    src: "testdata/sample_prebuilt_file",
121}
122
123prebuilt_etc {
124    name: "apex.test.init.rc",
125    src: "testdata/init.rc",
126    filename: "init.rc",
127    installable: false,
128}
129
130java_test_host {
131    name: "apex_rollback_tests",
132    srcs: ["src/**/ApexRollbackTests.java"],
133    libs: [
134        "tradefed",
135        "truth",
136    ],
137    static_libs: [
138        "frameworks-base-hostutils",
139        "cts-install-lib-host",
140    ],
141    test_config: "apex-rollback-tests.xml",
142    test_suites: ["general-tests"],
143
144    data: [
145        "testdata/trigger_watchdog.rc",
146        "testdata/trigger_watchdog.sh",
147        "testdata/trigger_reboot.sh",
148        ":apex.apexd_test_v2",
149        ":com.android.apex.cts.shim.v2_prebuilt",
150    ],
151}
152
153java_test_host {
154    name: "apexd_host_tests",
155    srcs: [
156        "src/**/ApexdHostTest.java",
157        ":apex-info-list",
158    ],
159    libs: ["tradefed"],
160    static_libs: [
161        "truth",
162        "apex_manifest_proto_java",
163        "frameworks-base-hostutils",
164        "cts-install-lib-host",
165    ],
166    test_config: "apexd-host-tests.xml",
167    test_suites: ["general-tests"],
168    data: [
169        ":apex.apexd_test",
170        ":apex.apexd_test_v2",
171        ":apex.apexd_test_v2_no_pb",
172        ":apex.apexd_test_v3",
173        ":com.android.apex.cts.shim.v2_prebuilt",
174        ":com.android.apex.cts.shim.v2_no_pb",
175        ":com.android.apex.cts.shim.v2_additional_file_prebuilt",
176        ":test.good1.com.android.hardware.wifi",
177        ":test.bad1.com.android.hardware.wifi",
178        ":test.bad2.com.android.hardware.wifi",
179        ":test.bad3.com.android.hardware.wifi",
180    ],
181}
182
183java_test_host {
184    name: "VendorApexHostTestCases",
185    srcs: [
186        "src/**/VendorApexTests.java",
187        ":apex-info-list",
188    ],
189    libs: [
190        "compatibility-tradefed",
191        "tradefed",
192        "truth",
193        "hamcrest",
194        "hamcrest-library",
195    ],
196    static_libs: [
197        "cts-install-lib-host",
198        "frameworks-base-hostutils",
199        "testng",
200    ],
201    data: [
202        ":VendorApexTestsApp",
203        ":com.android.apex.vendor.foo",
204        ":com.android.apex.vendor.foo",
205        ":com.android.apex.vendor.foo.apex.all.ready",
206        ":com.android.apex.vendor.foo.bootstrap",
207        ":com.android.apex.vendor.foo.v1_with_service",
208    ],
209    test_config: "vendor-apex-tests.xml",
210    test_suites: [
211        "general-tests",
212    ],
213}
214
215android_test_helper_app {
216    name: "VendorApexTestsApp",
217    srcs: ["app/src/**/VendorApexTests.java"],
218    manifest: "app/VendorApexTests_AndroidManifest.xml",
219    static_libs: [
220        "androidx.test.runner",
221        "androidx.test.core",
222        "truth",
223        "cts-install-lib",
224        "testng",
225    ],
226    sdk_version: "test_current",
227    java_resources: [
228        ":com.android.apex.vendor.foo.v2",
229        ":com.android.apex.vendor.foo.v2_with_requireNativeLibs",
230        ":com.android.apex.vendor.foo.v2_with_service",
231        ":com.android.apex.vendor.foo.v2_with_wrong_vndk_version",
232    ],
233    test_suites: [
234        "general-tests",
235    ],
236}
237
238java_test_host {
239    name: "sharedlibs_host_tests",
240    srcs: [
241        "src/**/SharedLibsApexTest.java",
242    ],
243    libs: ["tradefed"],
244    java_resources: [
245        ":com.android.apex.test.bar_stripped.v1.libvX_prebuilt",
246        ":com.android.apex.test.bar_stripped.v2.libvY_prebuilt",
247        ":com.android.apex.test.bar.v1.libvX_prebuilt",
248        ":com.android.apex.test.bar.v2.libvY_prebuilt",
249        ":com.android.apex.test.baz_stripped.v1.libvX_prebuilt",
250        ":com.android.apex.test.foo_stripped.v1.libvX_prebuilt",
251        ":com.android.apex.test.foo_stripped.v2.libvY_prebuilt",
252        ":com.android.apex.test.foo.v1.libvX_prebuilt",
253        ":com.android.apex.test.foo.v2.libvY_prebuilt",
254        ":com.android.apex.test.pony_stripped.v1.libvZ_prebuilt",
255        ":com.android.apex.test.pony.v1.libvZ_prebuilt",
256        ":com.android.apex.test.sharedlibs_generated.v1.libvX_prebuilt",
257        ":com.android.apex.test.sharedlibs_generated.v2.libvY_prebuilt",
258        ":com.android.apex.test.sharedlibs_secondary_generated.v1.libvZ_prebuilt",
259    ],
260    static_libs: [
261        "compatibility-host-util",
262        "cts-install-lib-host",
263        "frameworks-base-hostutils",
264        "truth",
265    ],
266    test_config: "shared-libs-apex-tests.xml",
267    test_suites: ["general-tests"],
268}
269
270java_test_host {
271    name: "apex_compression_platform_tests",
272    srcs: ["src/**/ApexCompressionTests.java"],
273    libs: [
274        "tradefed",
275        "truth",
276    ],
277    static_libs: [
278        "cts-install-lib-host",
279        "testng",
280    ],
281    test_config: "apex_compression_platform_tests.xml",
282    test_suites: ["general-tests"],
283    data: [
284        ":com.android.apex.compressed.v1",
285        ":com.android.apex.compressed.v1{.apex}",
286        ":com.android.apex.compressed.v1_different_digest",
287        ":com.android.apex.compressed.v2",
288        ":gen_manifest_mismatch_compressed_apex_v2",
289        ":apex_compression_tests_app",
290    ],
291}
292
293android_test_helper_app {
294    name: "apex_compression_tests_app",
295    manifest: "app/ApexCompressionTests_AndroidManifest.xml",
296    srcs: ["app/src/**/ApexCompressionTests.java"],
297    static_libs: [
298        "androidx.test.rules",
299        "cts-install-lib",
300        "cts-rollback-lib",
301        "testng",
302    ],
303    test_suites: ["general-tests"],
304    java_resources: [
305        ":com.android.apex.compressed.v1{.apex}",
306        ":com.android.apex.compressed.v2_original",
307    ],
308}
309
310java_test_host {
311    name: "apex_apkinapex_tests",
312    srcs: ["src/**/ApkInApexTests.java"],
313    libs: [
314        "tradefed",
315        "truth",
316    ],
317    static_libs: [
318        "cts-install-lib-host",
319        "frameworks-base-hostutils",
320        "testng",
321    ],
322    test_config: "apk-in-apex-tests.xml",
323    test_suites: ["general-tests"],
324    data: [
325        ":apex_apkinapex_tests_app",
326    ],
327    java_resources: [
328        ":com.android.apex.product.test",
329        ":com.android.apex.product.app.test.xml",
330        ":com.android.apex.system.test",
331        ":com.android.apex.system.app.test.xml",
332        ":com.android.apex.system_ext.test",
333        ":com.android.apex.system_ext.app.test.xml",
334        ":com.android.apex.vendor.test",
335        ":com.android.apex.vendor.app.test.xml",
336    ],
337}
338
339cc_test_library {
340    name: "libApkInApex_jni",
341    gtest: false,
342    srcs: [
343        "app/jni/com_android_tests_apex_app_ApkInApexTests.cpp",
344    ],
345    cflags: [
346        "-Wall",
347        "-Werror",
348    ],
349    header_libs: [
350        "jni_headers",
351    ],
352    stl: "c++_shared",
353    sdk_version: "current",
354}
355
356java_test_host {
357    name: "apex_apkinapexmaxsdk_tests",
358    srcs: ["src/**/MaxSdkTests.java"],
359    libs: [
360        "tradefed",
361        "truth",
362    ],
363    static_libs: [
364        "cts-install-lib-host",
365        "frameworks-base-hostutils",
366        "testng",
367    ],
368    test_config: "max-sdk-tests.xml",
369    test_suites: ["general-tests"],
370    data: [
371        ":apex_maxsdk_tests_app",
372        ":apex_maxsdk_regular_app_tests",
373    ],
374    java_resources: [
375        ":com.android.apex.maxsdk.test",
376    ],
377}
378
379android_test_helper_app {
380    name: "apex_apkinapex_tests_app",
381    manifest: "app/ApkInApexTests_AndroidManifest.xml",
382    srcs: ["app/src/**/ApkInApexTests.java"],
383    jni_libs: [
384        "libApkInApex_jni",
385    ],
386    compile_multilib: "both",
387    static_libs: [
388        "androidx.test.rules",
389        "cts-install-lib",
390        "cts-rollback-lib",
391        "testng",
392    ],
393    test_suites: ["general-tests"],
394}
395
396android_test_helper_app {
397    name: "apex_maxsdk_tests_app",
398    manifest: "app/MaxSdkTests_AndroidManifest.xml",
399    srcs: ["app/src/**/MaxSdkTests.java"],
400    static_libs: [
401        "androidx.test.rules",
402        "cts-install-lib",
403        "cts-rollback-lib",
404        "testng",
405    ],
406    test_suites: ["general-tests"],
407}
408
409android_test_helper_app {
410    name: "apex_maxsdk_regular_app_tests",
411    manifest: "testdata/maxsdk/app/AndroidManifest_normalApp.xml",
412}
413