blob: 21007ef1396fb9477e0f9c0d0c6f157f9e7e0f6c [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
Bob Badoure539dba2021-02-12 17:07:05 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_base_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_base_license"],
22}
23
Richard Uhlera7291342019-03-07 14:51:05 +000024android_test {
25 name: "RollbackTest",
26 manifest: "RollbackTest/AndroidManifest.xml",
Colin Cross082aec62020-08-27 04:12:26 +000027 platform_apis: true,
Richard Uhlera7291342019-03-07 14:51:05 +000028 srcs: ["RollbackTest/src/**/*.java"],
shafike17ad4a2019-06-06 19:16:39 +010029 static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
Richard Uhlera7291342019-03-07 14:51:05 +000030 test_suites: ["general-tests"],
Richard Uhlera7291342019-03-07 14:51:05 +000031 test_config: "RollbackTest.xml",
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +000032 java_resources: [
33 ":com.android.apex.apkrollback.test_v2",
JW Wang858845f2021-07-14 11:17:04 +080034 ":com.android.apex.apkrollback.test_v2Crashing",
35 ":test.rebootless_apex_v2",
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +000036 ],
Richard Uhlera7291342019-03-07 14:51:05 +000037}
38
39java_test_host {
40 name: "StagedRollbackTest",
41 srcs: ["StagedRollbackTest/src/**/*.java"],
42 libs: ["tradefed"],
JW Wang3ac333f22020-07-08 17:06:36 +080043 static_libs: [
44 "compatibility-tradefed",
45 "frameworks-base-hostutils",
46 "RollbackTestLib",
47 "testng",
48 ],
Richard Uhlera7291342019-03-07 14:51:05 +000049 test_suites: ["general-tests"],
50 test_config: "StagedRollbackTest.xml",
JW Wang858845f2021-07-14 11:17:04 +080051 data: [
52 ":com.android.apex.apkrollback.test_v1",
53 ":test.rebootless_apex_v1",
Yikeeee7bd32022-09-28 20:58:25 +080054 ":RollbackTest",
JW Wang858845f2021-07-14 11:17:04 +080055 ],
Richard Uhlera7291342019-03-07 14:51:05 +000056}
shafik2340e8b2019-05-30 15:15:43 +010057
58java_test_host {
JW Wangce92d632020-01-16 16:22:00 +080059 name: "NetworkStagedRollbackTest",
60 srcs: ["NetworkStagedRollbackTest/src/**/*.java"],
61 libs: ["tradefed"],
JW Wang3ac333f22020-07-08 17:06:36 +080062 static_libs: ["RollbackTestLib", "frameworks-base-hostutils"],
JW Wangce92d632020-01-16 16:22:00 +080063 test_suites: ["general-tests"],
64 test_config: "NetworkStagedRollbackTest.xml",
Yike80004e32022-08-29 14:16:45 +080065 data: [":RollbackTest"],
JW Wangce92d632020-01-16 16:22:00 +080066}
67
68java_test_host {
Gavin Corkerya859e8a2019-09-06 12:14:26 +010069 name: "MultiUserRollbackTest",
70 srcs: ["MultiUserRollbackTest/src/**/*.java"],
shafik2340e8b2019-05-30 15:15:43 +010071 libs: ["tradefed"],
JW Wang838dea52020-07-15 13:56:13 +080072 static_libs: [
73 "frameworks-base-hostutils",
74 ],
shafik2340e8b2019-05-30 15:15:43 +010075 test_suites: ["general-tests"],
Gavin Corkerya859e8a2019-09-06 12:14:26 +010076 test_config: "MultiUserRollbackTest.xml",
Sudheer Shankadd08e5d2023-01-11 07:16:24 +000077 data : [":RollbackTest"],
shafik2340e8b2019-05-30 15:15:43 +010078}
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000079
JW Wangd617d2f2020-02-12 17:18:00 +080080java_library_host {
81 name: "RollbackTestLib",
82 srcs: ["lib/src/**/*.java"],
83 libs: ["tradefed"],
84}
85
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +000086genrule {
87 name: "com.android.apex.apkrollback.test.pem",
88 out: ["com.android.apex.apkrollback.test.pem"],
89 cmd: "openssl genrsa -out $(out) 4096",
90}
91
92genrule {
93 name: "com.android.apex.apkrollback.test.pubkey",
94 srcs: [":com.android.apex.apkrollback.test.pem"],
95 out: ["com.android.apex.apkrollback.test.pubkey"],
96 tools: ["avbtool"],
97 cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
98}
99
100apex_key {
101 name: "com.android.apex.apkrollback.test.key",
102 private_key: ":com.android.apex.apkrollback.test.pem",
103 public_key: ":com.android.apex.apkrollback.test.pubkey",
104 installable: false,
105}
106
107apex {
108 name: "com.android.apex.apkrollback.test_v1",
109 manifest: "testdata/manifest_v1.json",
110 androidManifest: "testdata/AndroidManifest.xml",
111 file_contexts: ":apex.test-file_contexts",
112 key: "com.android.apex.apkrollback.test.key",
113 apps: ["TestAppAv1"],
114 installable: false,
Mathew Inwoodc99ec4a2021-02-16 14:58:27 +0000115 updatable: false,
Mohammad Samiul Islam3fcecfc2019-12-20 17:46:01 +0000116}
117
118apex {
119 name: "com.android.apex.apkrollback.test_v2",
120 manifest: "testdata/manifest_v2.json",
121 androidManifest: "testdata/AndroidManifest.xml",
122 file_contexts: ":apex.test-file_contexts",
123 key: "com.android.apex.apkrollback.test.key",
124 apps: ["TestAppAv2"],
125 installable: false,
Mathew Inwoodc99ec4a2021-02-16 14:58:27 +0000126 updatable: false,
Mohammad Samiul Islame7e63a62020-01-16 13:55:49 +0000127}
128
129apex {
130 name: "com.android.apex.apkrollback.test_v2Crashing",
131 manifest: "testdata/manifest_v2.json",
132 androidManifest: "testdata/AndroidManifest.xml",
133 file_contexts: ":apex.test-file_contexts",
134 key: "com.android.apex.apkrollback.test.key",
135 apps: ["TestAppACrashingV2"],
136 installable: false,
Mathew Inwoodc99ec4a2021-02-16 14:58:27 +0000137 updatable: false,
Bob Badoure539dba2021-02-12 17:07:05 -0800138}