blob: 89005da27709ff4dda325e79d50ac037c63ef5f4 [file] [log] [blame]
Richard Uhlera7291342019-03-07 14:51:05 +00001// Copyright (C) 2019 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
Richard Uhlera7291342019-03-07 14:51:05 +000015android_test {
16 name: "RollbackTest",
17 manifest: "RollbackTest/AndroidManifest.xml",
18 srcs: ["RollbackTest/src/**/*.java"],
shafike17ad4a2019-06-06 19:16:39 +010019 static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
Richard Uhlera7291342019-03-07 14:51:05 +000020 test_suites: ["general-tests"],
Richard Uhlera7291342019-03-07 14:51:05 +000021 test_config: "RollbackTest.xml",
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +000022 java_resources: [
23 ":com.android.apex.apkrollback.test_v2",
24 ":com.android.apex.apkrollback.test_v2Crashing"
25 ],
Richard Uhlera7291342019-03-07 14:51:05 +000026}
27
28java_test_host {
29 name: "StagedRollbackTest",
30 srcs: ["StagedRollbackTest/src/**/*.java"],
31 libs: ["tradefed"],
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000032 static_libs: ["testng", "compatibility-tradefed"],
Richard Uhlera7291342019-03-07 14:51:05 +000033 test_suites: ["general-tests"],
34 test_config: "StagedRollbackTest.xml",
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000035 data: [":com.android.apex.apkrollback.test_v1"],
Richard Uhlera7291342019-03-07 14:51:05 +000036}
shafik2340e8b2019-05-30 15:15:43 +010037
38java_test_host {
JW Wangce92d632020-01-16 16:22:00 +080039 name: "NetworkStagedRollbackTest",
40 srcs: ["NetworkStagedRollbackTest/src/**/*.java"],
41 libs: ["tradefed"],
42 static_libs: ["testng"],
43 test_suites: ["general-tests"],
44 test_config: "NetworkStagedRollbackTest.xml",
45}
46
47java_test_host {
Gavin Corkerya859e8a2019-09-06 12:14:26 +010048 name: "MultiUserRollbackTest",
49 srcs: ["MultiUserRollbackTest/src/**/*.java"],
shafik2340e8b2019-05-30 15:15:43 +010050 libs: ["tradefed"],
51 test_suites: ["general-tests"],
Gavin Corkerya859e8a2019-09-06 12:14:26 +010052 test_config: "MultiUserRollbackTest.xml",
shafik2340e8b2019-05-30 15:15:43 +010053}
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000054
55genrule {
56 name: "com.android.apex.apkrollback.test.pem",
57 out: ["com.android.apex.apkrollback.test.pem"],
58 cmd: "openssl genrsa -out $(out) 4096",
59}
60
61genrule {
62 name: "com.android.apex.apkrollback.test.pubkey",
63 srcs: [":com.android.apex.apkrollback.test.pem"],
64 out: ["com.android.apex.apkrollback.test.pubkey"],
65 tools: ["avbtool"],
66 cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
67}
68
69apex_key {
70 name: "com.android.apex.apkrollback.test.key",
71 private_key: ":com.android.apex.apkrollback.test.pem",
72 public_key: ":com.android.apex.apkrollback.test.pubkey",
73 installable: false,
74}
75
76apex {
77 name: "com.android.apex.apkrollback.test_v1",
78 manifest: "testdata/manifest_v1.json",
79 androidManifest: "testdata/AndroidManifest.xml",
80 file_contexts: ":apex.test-file_contexts",
81 key: "com.android.apex.apkrollback.test.key",
82 apps: ["TestAppAv1"],
83 installable: false,
84}
85
86apex {
87 name: "com.android.apex.apkrollback.test_v2",
88 manifest: "testdata/manifest_v2.json",
89 androidManifest: "testdata/AndroidManifest.xml",
90 file_contexts: ":apex.test-file_contexts",
91 key: "com.android.apex.apkrollback.test.key",
92 apps: ["TestAppAv2"],
93 installable: false,
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +000094}
95
96apex {
97 name: "com.android.apex.apkrollback.test_v2Crashing",
98 manifest: "testdata/manifest_v2.json",
99 androidManifest: "testdata/AndroidManifest.xml",
100 file_contexts: ":apex.test-file_contexts",
101 key: "com.android.apex.apkrollback.test.key",
102 apps: ["TestAppACrashingV2"],
103 installable: false,
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +0000104}