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