Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 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 | |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 15 | android_test { |
| 16 | name: "RollbackTest", |
| 17 | manifest: "RollbackTest/AndroidManifest.xml", |
Colin Cross | 082aec6 | 2020-08-27 04:12:26 +0000 | [diff] [blame^] | 18 | platform_apis: true, |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 19 | srcs: ["RollbackTest/src/**/*.java"], |
shafik | e17ad4a | 2019-06-06 19:16:39 +0100 | [diff] [blame] | 20 | static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"], |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 21 | test_suites: ["general-tests"], |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 22 | test_config: "RollbackTest.xml", |
Mohammad Samiul Islam | e7e63a6 | 2020-01-16 13:55:49 +0000 | [diff] [blame] | 23 | java_resources: [ |
| 24 | ":com.android.apex.apkrollback.test_v2", |
| 25 | ":com.android.apex.apkrollback.test_v2Crashing" |
| 26 | ], |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | java_test_host { |
| 30 | name: "StagedRollbackTest", |
| 31 | srcs: ["StagedRollbackTest/src/**/*.java"], |
| 32 | libs: ["tradefed"], |
JW Wang | 3ac333f2 | 2020-07-08 17:06:36 +0800 | [diff] [blame] | 33 | static_libs: [ |
| 34 | "compatibility-tradefed", |
| 35 | "frameworks-base-hostutils", |
| 36 | "RollbackTestLib", |
| 37 | "testng", |
| 38 | ], |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 39 | test_suites: ["general-tests"], |
| 40 | test_config: "StagedRollbackTest.xml", |
Mohammad Samiul Islam | 3fcecfc | 2019-12-20 17:46:01 +0000 | [diff] [blame] | 41 | data: [":com.android.apex.apkrollback.test_v1"], |
Richard Uhler | a729134 | 2019-03-07 14:51:05 +0000 | [diff] [blame] | 42 | } |
shafik | 2340e8b | 2019-05-30 15:15:43 +0100 | [diff] [blame] | 43 | |
| 44 | java_test_host { |
JW Wang | ce92d63 | 2020-01-16 16:22:00 +0800 | [diff] [blame] | 45 | name: "NetworkStagedRollbackTest", |
| 46 | srcs: ["NetworkStagedRollbackTest/src/**/*.java"], |
| 47 | libs: ["tradefed"], |
JW Wang | 3ac333f2 | 2020-07-08 17:06:36 +0800 | [diff] [blame] | 48 | static_libs: ["RollbackTestLib", "frameworks-base-hostutils"], |
JW Wang | ce92d63 | 2020-01-16 16:22:00 +0800 | [diff] [blame] | 49 | test_suites: ["general-tests"], |
| 50 | test_config: "NetworkStagedRollbackTest.xml", |
| 51 | } |
| 52 | |
| 53 | java_test_host { |
Gavin Corkery | a859e8a | 2019-09-06 12:14:26 +0100 | [diff] [blame] | 54 | name: "MultiUserRollbackTest", |
| 55 | srcs: ["MultiUserRollbackTest/src/**/*.java"], |
shafik | 2340e8b | 2019-05-30 15:15:43 +0100 | [diff] [blame] | 56 | libs: ["tradefed"], |
JW Wang | 838dea5 | 2020-07-15 13:56:13 +0800 | [diff] [blame] | 57 | static_libs: [ |
| 58 | "frameworks-base-hostutils", |
| 59 | ], |
shafik | 2340e8b | 2019-05-30 15:15:43 +0100 | [diff] [blame] | 60 | test_suites: ["general-tests"], |
Gavin Corkery | a859e8a | 2019-09-06 12:14:26 +0100 | [diff] [blame] | 61 | test_config: "MultiUserRollbackTest.xml", |
shafik | 2340e8b | 2019-05-30 15:15:43 +0100 | [diff] [blame] | 62 | } |
Mohammad Samiul Islam | 3fcecfc | 2019-12-20 17:46:01 +0000 | [diff] [blame] | 63 | |
JW Wang | d617d2f | 2020-02-12 17:18:00 +0800 | [diff] [blame] | 64 | java_library_host { |
| 65 | name: "RollbackTestLib", |
| 66 | srcs: ["lib/src/**/*.java"], |
| 67 | libs: ["tradefed"], |
| 68 | } |
| 69 | |
Mohammad Samiul Islam | 3fcecfc | 2019-12-20 17:46:01 +0000 | [diff] [blame] | 70 | genrule { |
| 71 | name: "com.android.apex.apkrollback.test.pem", |
| 72 | out: ["com.android.apex.apkrollback.test.pem"], |
| 73 | cmd: "openssl genrsa -out $(out) 4096", |
| 74 | } |
| 75 | |
| 76 | genrule { |
| 77 | name: "com.android.apex.apkrollback.test.pubkey", |
| 78 | srcs: [":com.android.apex.apkrollback.test.pem"], |
| 79 | out: ["com.android.apex.apkrollback.test.pubkey"], |
| 80 | tools: ["avbtool"], |
| 81 | cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)", |
| 82 | } |
| 83 | |
| 84 | apex_key { |
| 85 | name: "com.android.apex.apkrollback.test.key", |
| 86 | private_key: ":com.android.apex.apkrollback.test.pem", |
| 87 | public_key: ":com.android.apex.apkrollback.test.pubkey", |
| 88 | installable: false, |
| 89 | } |
| 90 | |
| 91 | apex { |
| 92 | name: "com.android.apex.apkrollback.test_v1", |
| 93 | manifest: "testdata/manifest_v1.json", |
| 94 | androidManifest: "testdata/AndroidManifest.xml", |
| 95 | file_contexts: ":apex.test-file_contexts", |
| 96 | key: "com.android.apex.apkrollback.test.key", |
| 97 | apps: ["TestAppAv1"], |
| 98 | installable: false, |
| 99 | } |
| 100 | |
| 101 | apex { |
| 102 | name: "com.android.apex.apkrollback.test_v2", |
| 103 | manifest: "testdata/manifest_v2.json", |
| 104 | androidManifest: "testdata/AndroidManifest.xml", |
| 105 | file_contexts: ":apex.test-file_contexts", |
| 106 | key: "com.android.apex.apkrollback.test.key", |
| 107 | apps: ["TestAppAv2"], |
| 108 | installable: false, |
Mohammad Samiul Islam | e7e63a6 | 2020-01-16 13:55:49 +0000 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | apex { |
| 112 | name: "com.android.apex.apkrollback.test_v2Crashing", |
| 113 | manifest: "testdata/manifest_v2.json", |
| 114 | androidManifest: "testdata/AndroidManifest.xml", |
| 115 | file_contexts: ":apex.test-file_contexts", |
| 116 | key: "com.android.apex.apkrollback.test.key", |
| 117 | apps: ["TestAppACrashingV2"], |
| 118 | installable: false, |
Mohammad Samiul Islam | 3fcecfc | 2019-12-20 17:46:01 +0000 | [diff] [blame] | 119 | } |