| 1 |
// 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 |
|
| 15 |
package { |
| 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 |
|
| 24 |
android_test { |
| 25 |
name: "RollbackTest", |
| 26 |
manifest: "RollbackTest/AndroidManifest.xml", |
| 27 |
platform_apis: true, |
| 28 |
srcs: ["RollbackTest/src/**/*.java"], |
| 29 |
static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"], |
| 30 |
test_suites: ["general-tests"], |
| 31 |
test_config: "RollbackTest.xml", |
| 32 |
java_resources: [ |
| 33 |
":com.android.apex.apkrollback.test_v2", |
| 34 |
":com.android.apex.apkrollback.test_v2Crashing", |
| 35 |
":test.rebootless_apex_v2", |
| 36 |
], |
| 37 |
} |
| 38 |
|
| 39 |
java_test_host { |
| 40 |
name: "StagedRollbackTest", |
| 41 |
srcs: ["StagedRollbackTest/src/**/*.java"], |
| 42 |
libs: ["tradefed"], |
| 43 |
static_libs: [ |
| 44 |
"compatibility-tradefed", |
| 45 |
"frameworks-base-hostutils", |
| 46 |
"RollbackTestLib", |
| 47 |
"testng", |
| 48 |
], |
| 49 |
test_suites: ["general-tests"], |
| 50 |
test_config: "StagedRollbackTest.xml", |
| 51 |
data: [ |
| 52 |
":com.android.apex.apkrollback.test_v1", |
| 53 |
":test.rebootless_apex_v1", |
| 54 |
":RollbackTest", |
| 55 |
], |
| 56 |
} |
| 57 |
|
| 58 |
java_test_host { |
| 59 |
name: "NetworkStagedRollbackTest", |
| 60 |
srcs: ["NetworkStagedRollbackTest/src/**/*.java"], |
| 61 |
libs: ["tradefed"], |
| 62 |
static_libs: ["RollbackTestLib", "frameworks-base-hostutils"], |
| 63 |
test_suites: ["general-tests"], |
| 64 |
test_config: "NetworkStagedRollbackTest.xml", |
| 65 |
data: [":RollbackTest"], |
| 66 |
} |
| 67 |
|
| 68 |
java_test_host { |
| 69 |
name: "MultiUserRollbackTest", |
| 70 |
srcs: ["MultiUserRollbackTest/src/**/*.java"], |
| 71 |
libs: ["tradefed"], |
| 72 |
static_libs: [ |
| 73 |
"frameworks-base-hostutils", |
| 74 |
], |
| 75 |
test_suites: ["general-tests"], |
| 76 |
test_config: "MultiUserRollbackTest.xml", |
| 77 |
} |
| 78 |
|
| 79 |
java_library_host { |
| 80 |
name: "RollbackTestLib", |
| 81 |
srcs: ["lib/src/**/*.java"], |
| 82 |
libs: ["tradefed"], |
| 83 |
} |
| 84 |
|
| 85 |
genrule { |
| 86 |
name: "com.android.apex.apkrollback.test.pem", |
| 87 |
out: ["com.android.apex.apkrollback.test.pem"], |
| 88 |
cmd: "openssl genrsa -out $(out) 4096", |
| 89 |
} |
| 90 |
|
| 91 |
genrule { |
| 92 |
name: "com.android.apex.apkrollback.test.pubkey", |
| 93 |
srcs: [":com.android.apex.apkrollback.test.pem"], |
| 94 |
out: ["com.android.apex.apkrollback.test.pubkey"], |
| 95 |
tools: ["avbtool"], |
| 96 |
cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)", |
| 97 |
} |
| 98 |
|
| 99 |
apex_key { |
| 100 |
name: "com.android.apex.apkrollback.test.key", |
| 101 |
private_key: ":com.android.apex.apkrollback.test.pem", |
| 102 |
public_key: ":com.android.apex.apkrollback.test.pubkey", |
| 103 |
installable: false, |
| 104 |
} |
| 105 |
|
| 106 |
apex { |
| 107 |
name: "com.android.apex.apkrollback.test_v1", |
| 108 |
manifest: "testdata/manifest_v1.json", |
| 109 |
androidManifest: "testdata/AndroidManifest.xml", |
| 110 |
file_contexts: ":apex.test-file_contexts", |
| 111 |
key: "com.android.apex.apkrollback.test.key", |
| 112 |
apps: ["TestAppAv1"], |
| 113 |
installable: false, |
| 114 |
updatable: false, |
| 115 |
} |
| 116 |
|
| 117 |
apex { |
| 118 |
name: "com.android.apex.apkrollback.test_v2", |
| 119 |
manifest: "testdata/manifest_v2.json", |
| 120 |
androidManifest: "testdata/AndroidManifest.xml", |
| 121 |
file_contexts: ":apex.test-file_contexts", |
| 122 |
key: "com.android.apex.apkrollback.test.key", |
| 123 |
apps: ["TestAppAv2"], |
| 124 |
installable: false, |
| 125 |
updatable: false, |
| 126 |
} |
| 127 |
|
| 128 |
apex { |
| 129 |
name: "com.android.apex.apkrollback.test_v2Crashing", |
| 130 |
manifest: "testdata/manifest_v2.json", |
| 131 |
androidManifest: "testdata/AndroidManifest.xml", |
| 132 |
file_contexts: ":apex.test-file_contexts", |
| 133 |
key: "com.android.apex.apkrollback.test.key", |
| 134 |
apps: ["TestAppACrashingV2"], |
| 135 |
installable: false, |
| 136 |
updatable: false, |
| 137 |
} |