• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-prebuilt",
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: ["tradefed", "truth-prebuilt"],
134    static_libs: ["frameworks-base-hostutils", "cts-install-lib-host"],
135    test_config: "apex-rollback-tests.xml",
136    test_suites: ["general-tests"],
137
138    data: [
139        "testdata/trigger_watchdog.rc",
140        "testdata/trigger_watchdog.sh",
141        "testdata/trigger_reboot.sh",
142        ":apex.apexd_test_v2",
143        ":com.android.apex.cts.shim.v2_prebuilt",
144    ],
145}
146
147java_test_host {
148    name: "apexd_host_tests",
149    srcs:  [
150        "src/**/ApexdHostTest.java",
151        ":apex-info-list",
152    ],
153    libs: ["tradefed"],
154    static_libs: [
155        "truth-prebuilt",
156        "apex_manifest_proto_java",
157        "frameworks-base-hostutils",
158        "cts-install-lib-host"
159    ],
160    test_config: "apexd-host-tests.xml",
161    test_suites: ["general-tests"],
162    data: [
163        ":apex.apexd_test",
164        ":apex.apexd_test_v2",
165        ":apex.apexd_test_v2_no_pb",
166        ":apex.apexd_test_v3",
167        ":com.android.apex.cts.shim.v2_prebuilt",
168        ":com.android.apex.cts.shim.v2_no_pb",
169        ":com.android.apex.cts.shim.v2_additional_file_prebuilt",
170    ],
171}
172
173java_test_host {
174    name: "VendorApexHostTestCases",
175    srcs: [
176        "src/**/VendorApexTests.java",
177        ":apex-info-list",
178    ],
179    libs: [
180        "compatibility-tradefed",
181        "tradefed",
182        "truth-prebuilt",
183        "hamcrest",
184        "hamcrest-library",
185    ],
186    static_libs: [
187        "cts-install-lib-host",
188        "frameworks-base-hostutils",
189        "testng",
190    ],
191    data: [
192        ":VendorApexTestsApp",
193        ":com.android.apex.vendor.foo",
194        ":com.android.apex.vendor.foo",
195        ":com.android.apex.vendor.foo.apex.all.ready",
196        ":com.android.apex.vendor.foo.v1_with_service"
197    ],
198    test_config: "vendor-apex-tests.xml",
199    test_suites: [
200        "general-tests",
201    ],
202}
203
204android_test_helper_app {
205    name: "VendorApexTestsApp",
206    srcs:  ["app/src/**/VendorApexTests.java"],
207    manifest : "app/VendorApexTests_AndroidManifest.xml",
208    static_libs: [
209        "androidx.test.runner",
210        "androidx.test.core",
211        "truth-prebuilt",
212        "cts-install-lib",
213        "testng",
214    ],
215    sdk_version: "test_current",
216    java_resources: [
217        ":com.android.apex.vendor.foo.v2",
218        ":com.android.apex.vendor.foo.v2_with_requireNativeLibs",
219        ":com.android.apex.vendor.foo.v2_with_service",
220        ":com.android.apex.vendor.foo.v2_with_wrong_vndk_version",
221    ],
222    test_suites: [
223        "general-tests",
224    ],
225}
226
227java_test_host {
228    name: "sharedlibs_host_tests",
229    srcs: [
230        "src/**/SharedLibsApexTest.java"
231    ],
232    libs: ["tradefed"],
233    java_resources: [
234        ":com.android.apex.test.bar_stripped.v1.libvX_prebuilt",
235        ":com.android.apex.test.bar_stripped.v2.libvY_prebuilt",
236        ":com.android.apex.test.bar.v1.libvX_prebuilt",
237        ":com.android.apex.test.bar.v2.libvY_prebuilt",
238        ":com.android.apex.test.baz_stripped.v1.libvX_prebuilt",
239        ":com.android.apex.test.foo_stripped.v1.libvX_prebuilt",
240        ":com.android.apex.test.foo_stripped.v2.libvY_prebuilt",
241        ":com.android.apex.test.foo.v1.libvX_prebuilt",
242        ":com.android.apex.test.foo.v2.libvY_prebuilt",
243        ":com.android.apex.test.pony_stripped.v1.libvZ_prebuilt",
244        ":com.android.apex.test.pony.v1.libvZ_prebuilt",
245        ":com.android.apex.test.sharedlibs_generated.v1.libvX_prebuilt",
246        ":com.android.apex.test.sharedlibs_generated.v2.libvY_prebuilt",
247        ":com.android.apex.test.sharedlibs_secondary_generated.v1.libvZ_prebuilt",
248    ],
249    static_libs: [
250        "compatibility-host-util",
251        "cts-install-lib-host",
252        "frameworks-base-hostutils",
253        "truth-prebuilt"
254    ],
255    test_config: "shared-libs-apex-tests.xml",
256    test_suites: ["general-tests"],
257}
258
259java_test_host {
260    name: "apex_compression_platform_tests",
261    srcs:  ["src/**/ApexCompressionTests.java"],
262    libs: ["tradefed", "truth-prebuilt"],
263    static_libs: ["cts-install-lib-host", "testng"],
264    test_config: "apex_compression_platform_tests.xml",
265    test_suites: ["general-tests"],
266    data: [
267        ":com.android.apex.compressed.v1",
268        ":com.android.apex.compressed.v1_original",
269        ":com.android.apex.compressed.v1_different_digest",
270        ":com.android.apex.compressed.v2",
271        ":gen_manifest_mismatch_compressed_apex_v2",
272        ":apex_compression_tests_app",
273    ],
274}
275
276android_test_helper_app {
277    name: "apex_compression_tests_app",
278    manifest: "app/ApexCompressionTests_AndroidManifest.xml",
279    srcs: ["app/src/**/ApexCompressionTests.java"],
280    static_libs: ["androidx.test.rules", "cts-install-lib", "cts-rollback-lib", "testng"],
281    test_suites: ["general-tests"],
282    java_resources: [
283        ":com.android.apex.compressed.v1_original",
284        ":com.android.apex.compressed.v2_original",
285    ]
286}
287
288java_test_host {
289    name: "apex_apkinapex_tests",
290    srcs:  ["src/**/ApkInApexTests.java"],
291    libs: ["tradefed", "truth-prebuilt"],
292    static_libs: ["cts-install-lib-host", "frameworks-base-hostutils", "testng"],
293    test_config: "apk-in-apex-tests.xml",
294    test_suites: ["general-tests"],
295    data: [
296        ":apex_apkinapex_tests_app",
297    ],
298    java_resources: [
299        ":com.android.apex.product.test",
300        ":com.android.apex.product.app.test.xml",
301        ":com.android.apex.system.test",
302        ":com.android.apex.system.app.test.xml",
303        ":com.android.apex.system_ext.test",
304        ":com.android.apex.system_ext.app.test.xml",
305        ":com.android.apex.vendor.test",
306        ":com.android.apex.vendor.app.test.xml",
307    ],
308}
309
310cc_test_library {
311    name: "libApkInApex_jni",
312    gtest: false,
313    srcs: [
314        "app/jni/com_android_tests_apex_app_ApkInApexTests.cpp",
315    ],
316    cflags: [
317        "-Wall",
318        "-Werror",
319    ],
320    header_libs: [
321        "jni_headers"
322    ],
323    stl: "c++_shared",
324    sdk_version: "current",
325}
326
327java_test_host {
328    name: "apex_apkinapexmaxsdk_tests",
329    srcs: ["src/**/MaxSdkTests.java"],
330    libs: [
331        "tradefed",
332        "truth-prebuilt"
333    ],
334    static_libs: [
335        "cts-install-lib-host",
336        "frameworks-base-hostutils",
337        "testng"
338    ],
339    test_config: "max-sdk-tests.xml",
340    test_suites: ["general-tests"],
341    data: [
342        ":apex_maxsdk_tests_app",
343        ":apex_maxsdk_regular_app_tests",
344    ],
345    java_resources: [
346        ":com.android.apex.maxsdk.test",
347    ],
348}
349
350android_test_helper_app {
351    name: "apex_apkinapex_tests_app",
352    manifest: "app/ApkInApexTests_AndroidManifest.xml",
353    srcs: ["app/src/**/ApkInApexTests.java"],
354    jni_libs: [
355        "libApkInApex_jni",
356    ],
357    compile_multilib: "both",
358    static_libs: ["androidx.test.rules", "cts-install-lib", "cts-rollback-lib", "testng"],
359    test_suites: ["general-tests"],
360}
361
362android_test_helper_app {
363    name: "apex_maxsdk_tests_app",
364    manifest: "app/MaxSdkTests_AndroidManifest.xml",
365    srcs: ["app/src/**/MaxSdkTests.java"],
366    static_libs: ["androidx.test.rules", "cts-install-lib", "cts-rollback-lib", "testng"],
367    test_suites: ["general-tests"],
368}
369
370android_test_helper_app {
371    name: "apex_maxsdk_regular_app_tests",
372    manifest: "testdata/maxsdk/app/AndroidManifest_normalApp.xml",
373}
374