blob: 4f5a30502c91305e2fbb6c1644c311724145dc33 [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"],
JW Wang3ac333f22020-07-08 17:06:36 +080032 static_libs: [
33 "compatibility-tradefed",
34 "frameworks-base-hostutils",
35 "RollbackTestLib",
36 "testng",
37 ],
Richard Uhlera7291342019-03-07 14:51:05 +000038 test_suites: ["general-tests"],
39 test_config: "StagedRollbackTest.xml",
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000040 data: [":com.android.apex.apkrollback.test_v1"],
Richard Uhlera7291342019-03-07 14:51:05 +000041}
shafik2340e8b2019-05-30 15:15:43 +010042
43java_test_host {
JW Wangce92d632020-01-16 16:22:00 +080044 name: "NetworkStagedRollbackTest",
45 srcs: ["NetworkStagedRollbackTest/src/**/*.java"],
46 libs: ["tradefed"],
JW Wang3ac333f22020-07-08 17:06:36 +080047 static_libs: ["RollbackTestLib", "frameworks-base-hostutils"],
JW Wangce92d632020-01-16 16:22:00 +080048 test_suites: ["general-tests"],
49 test_config: "NetworkStagedRollbackTest.xml",
50}
51
52java_test_host {
Gavin Corkerya859e8a2019-09-06 12:14:26 +010053 name: "MultiUserRollbackTest",
54 srcs: ["MultiUserRollbackTest/src/**/*.java"],
shafik2340e8b2019-05-30 15:15:43 +010055 libs: ["tradefed"],
JW Wang838dea52020-07-15 13:56:13 +080056 static_libs: [
57 "frameworks-base-hostutils",
58 ],
shafik2340e8b2019-05-30 15:15:43 +010059 test_suites: ["general-tests"],
Gavin Corkerya859e8a2019-09-06 12:14:26 +010060 test_config: "MultiUserRollbackTest.xml",
shafik2340e8b2019-05-30 15:15:43 +010061}
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000062
JW Wangd617d2f2020-02-12 17:18:00 +080063java_library_host {
64 name: "RollbackTestLib",
65 srcs: ["lib/src/**/*.java"],
66 libs: ["tradefed"],
67}
68
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000069genrule {
70 name: "com.android.apex.apkrollback.test.pem",
71 out: ["com.android.apex.apkrollback.test.pem"],
72 cmd: "openssl genrsa -out $(out) 4096",
73}
74
75genrule {
76 name: "com.android.apex.apkrollback.test.pubkey",
77 srcs: [":com.android.apex.apkrollback.test.pem"],
78 out: ["com.android.apex.apkrollback.test.pubkey"],
79 tools: ["avbtool"],
80 cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
81}
82
83apex_key {
84 name: "com.android.apex.apkrollback.test.key",
85 private_key: ":com.android.apex.apkrollback.test.pem",
86 public_key: ":com.android.apex.apkrollback.test.pubkey",
87 installable: false,
88}
89
90apex {
91 name: "com.android.apex.apkrollback.test_v1",
92 manifest: "testdata/manifest_v1.json",
93 androidManifest: "testdata/AndroidManifest.xml",
94 file_contexts: ":apex.test-file_contexts",
95 key: "com.android.apex.apkrollback.test.key",
96 apps: ["TestAppAv1"],
97 installable: false,
98}
99
100apex {
101 name: "com.android.apex.apkrollback.test_v2",
102 manifest: "testdata/manifest_v2.json",
103 androidManifest: "testdata/AndroidManifest.xml",
104 file_contexts: ":apex.test-file_contexts",
105 key: "com.android.apex.apkrollback.test.key",
106 apps: ["TestAppAv2"],
107 installable: false,
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +0000108}
109
110apex {
111 name: "com.android.apex.apkrollback.test_v2Crashing",
112 manifest: "testdata/manifest_v2.json",
113 androidManifest: "testdata/AndroidManifest.xml",
114 file_contexts: ":apex.test-file_contexts",
115 key: "com.android.apex.apkrollback.test.key",
116 apps: ["TestAppACrashingV2"],
117 installable: false,
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +0000118}