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