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