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    prebuilts: ["sample_prebuilt_file"],
91    key: "apex.test.key",
92    certificate: ":apex.test.certificate",
93    installable: false,
94    updatable: false,
95}
96
97apex_key {
98    name: "apex.test.key",
99    public_key: "testdata/com.android.apex.test.avbpubkey",
100    private_key: "testdata/com.android.apex.test.pem",
101    installable: false,
102}
103
104android_app_certificate {
105    name: "apex.test.certificate",
106    // will use testcert.pk8 and testcert.x509.pem
107    certificate: "testdata/testcert",
108}
109
110prebuilt_etc {
111    name: "apex.test.ld.config.txt",
112    src: "testdata/ld.config.txt",
113    filename: "ld.config.txt",
114    installable: false,
115}
116
117prebuilt_etc {
118    name: "sample_prebuilt_file",
119    src: "testdata/sample_prebuilt_file",
120}
121
122prebuilt_etc {
123    name: "apex.test.init.rc",
124    src: "testdata/init.rc",
125    filename: "init.rc",
126    installable: false,
127}
128
129java_test_host {
130    name: "apex_rollback_tests",
131    srcs:  ["src/**/ApexRollbackTests.java"],
132    libs: ["tradefed", "truth-prebuilt"],
133    static_libs: ["frameworks-base-hostutils", "cts-install-lib-host"],
134    test_config: "apex-rollback-tests.xml",
135    test_suites: ["general-tests"],
136
137    data: [
138        "testdata/trigger_watchdog.rc",
139        "testdata/trigger_watchdog.sh",
140        "testdata/trigger_reboot.sh",
141        ":apex.apexd_test_v2",
142        ":com.android.apex.cts.shim.v2_prebuilt",
143    ],
144}
145
146java_test_host {
147    name: "apexd_host_tests",
148    srcs:  [
149        "src/**/ApexdHostTest.java",
150        ":apex-info-list",
151    ],
152    libs: ["tradefed"],
153    static_libs: [
154        "truth-prebuilt",
155        "apex_manifest_proto_java",
156        "frameworks-base-hostutils",
157        "cts-install-lib-host"
158    ],
159    test_config: "apexd-host-tests.xml",
160    test_suites: ["general-tests"],
161    data: [
162        ":apex.apexd_test",
163        ":apex.apexd_test_v2",
164        ":apex.apexd_test_v2_no_pb",
165        ":apex.apexd_test_v3",
166        ":com.android.apex.cts.shim.v2_prebuilt",
167        ":com.android.apex.cts.shim.v2_no_pb",
168        ":com.android.apex.cts.shim.v2_additional_file_prebuilt",
169    ],
170}
171
172java_test_host {
173    name: "sharedlibs_host_tests",
174    srcs: [
175        "src/**/SharedLibsApexTest.java"
176    ],
177    libs: ["tradefed"],
178    java_resources: [
179        ":com.android.apex.test.bar_stripped.v1.libvX_prebuilt",
180        ":com.android.apex.test.bar_stripped.v2.libvY_prebuilt",
181        ":com.android.apex.test.bar.v1.libvX_prebuilt",
182        ":com.android.apex.test.bar.v2.libvY_prebuilt",
183        ":com.android.apex.test.baz_stripped.v1.libvX_prebuilt",
184        ":com.android.apex.test.foo_stripped.v1.libvX_prebuilt",
185        ":com.android.apex.test.foo_stripped.v2.libvY_prebuilt",
186        ":com.android.apex.test.foo.v1.libvX_prebuilt",
187        ":com.android.apex.test.foo.v2.libvY_prebuilt",
188        ":com.android.apex.test.pony_stripped.v1.libvZ_prebuilt",
189        ":com.android.apex.test.pony.v1.libvZ_prebuilt",
190        ":com.android.apex.test.sharedlibs_generated.v1.libvX_prebuilt",
191        ":com.android.apex.test.sharedlibs_generated.v2.libvY_prebuilt",
192        ":com.android.apex.test.sharedlibs_secondary_generated.v1.libvZ_prebuilt",
193    ],
194    static_libs: [
195        "compatibility-host-util",
196        "cts-install-lib-host",
197        "frameworks-base-hostutils",
198        "truth-prebuilt"
199    ],
200    test_config: "shared-libs-apex-tests.xml",
201    test_suites: ["general-tests"],
202}
203
204java_test_host {
205    name: "apex_compression_platform_tests",
206    srcs:  ["src/**/ApexCompressionTests.java"],
207    libs: ["tradefed", "truth-prebuilt"],
208    static_libs: ["cts-install-lib-host", "testng"],
209    test_config: "apex_compression_platform_tests.xml",
210    test_suites: ["general-tests"],
211    data: [
212        ":com.android.apex.compressed.v1",
213        ":com.android.apex.compressed.v1_original",
214        ":com.android.apex.compressed.v1_different_digest",
215        ":com.android.apex.compressed.v2",
216        ":gen_manifest_mismatch_compressed_apex_v2",
217        ":apex_compression_tests_app",
218    ],
219}
220
221android_test_helper_app {
222    name: "apex_compression_tests_app",
223    manifest: "app/AndroidManifest.xml",
224    srcs: ["app/src/**/*.java"],
225    static_libs: ["androidx.test.rules", "cts-install-lib", "cts-rollback-lib", "testng"],
226    test_suites: ["general-tests"],
227    java_resources: [
228        ":com.android.apex.compressed.v1_original",
229        ":com.android.apex.compressed.v2_original",
230    ]
231}
232