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: ["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 39java_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 ], 55} 56 57java_test_host { 58 name: "NetworkStagedRollbackTest", 59 srcs: ["NetworkStagedRollbackTest/src/**/*.java"], 60 libs: ["tradefed"], 61 static_libs: ["RollbackTestLib", "frameworks-base-hostutils"], 62 test_suites: ["general-tests"], 63 test_config: "NetworkStagedRollbackTest.xml", 64} 65 66java_test_host { 67 name: "MultiUserRollbackTest", 68 srcs: ["MultiUserRollbackTest/src/**/*.java"], 69 libs: ["tradefed"], 70 static_libs: [ 71 "frameworks-base-hostutils", 72 ], 73 test_suites: ["general-tests"], 74 test_config: "MultiUserRollbackTest.xml", 75} 76 77java_library_host { 78 name: "RollbackTestLib", 79 srcs: ["lib/src/**/*.java"], 80 libs: ["tradefed"], 81} 82 83genrule { 84 name: "com.android.apex.apkrollback.test.pem", 85 out: ["com.android.apex.apkrollback.test.pem"], 86 cmd: "openssl genrsa -out $(out) 4096", 87} 88 89genrule { 90 name: "com.android.apex.apkrollback.test.pubkey", 91 srcs: [":com.android.apex.apkrollback.test.pem"], 92 out: ["com.android.apex.apkrollback.test.pubkey"], 93 tools: ["avbtool"], 94 cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)", 95} 96 97apex_key { 98 name: "com.android.apex.apkrollback.test.key", 99 private_key: ":com.android.apex.apkrollback.test.pem", 100 public_key: ":com.android.apex.apkrollback.test.pubkey", 101 installable: false, 102} 103 104apex { 105 name: "com.android.apex.apkrollback.test_v1", 106 manifest: "testdata/manifest_v1.json", 107 androidManifest: "testdata/AndroidManifest.xml", 108 file_contexts: ":apex.test-file_contexts", 109 key: "com.android.apex.apkrollback.test.key", 110 apps: ["TestAppAv1"], 111 installable: false, 112 updatable: false, 113} 114 115apex { 116 name: "com.android.apex.apkrollback.test_v2", 117 manifest: "testdata/manifest_v2.json", 118 androidManifest: "testdata/AndroidManifest.xml", 119 file_contexts: ":apex.test-file_contexts", 120 key: "com.android.apex.apkrollback.test.key", 121 apps: ["TestAppAv2"], 122 installable: false, 123 updatable: false, 124} 125 126apex { 127 name: "com.android.apex.apkrollback.test_v2Crashing", 128 manifest: "testdata/manifest_v2.json", 129 androidManifest: "testdata/AndroidManifest.xml", 130 file_contexts: ":apex.test-file_contexts", 131 key: "com.android.apex.apkrollback.test.key", 132 apps: ["TestAppACrashingV2"], 133 installable: false, 134 updatable: false, 135} 136