• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15android_test {
16    name: "RollbackTest",
17    manifest: "RollbackTest/AndroidManifest.xml",
18    srcs: ["RollbackTest/src/**/*.java"],
19    static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
20    test_suites: ["general-tests"],
21    test_config: "RollbackTest.xml",
22    java_resources: [
23        ":com.android.apex.apkrollback.test_v2",
24        ":com.android.apex.apkrollback.test_v2Crashing"
25    ],
26}
27
28java_test_host {
29    name: "StagedRollbackTest",
30    srcs: ["StagedRollbackTest/src/**/*.java"],
31    libs: ["tradefed"],
32    static_libs: ["testng", "compatibility-tradefed", "RollbackTestLib"],
33    test_suites: ["general-tests"],
34    test_config: "StagedRollbackTest.xml",
35    data: [":com.android.apex.apkrollback.test_v1"],
36}
37
38java_test_host {
39    name: "NetworkStagedRollbackTest",
40    srcs: ["NetworkStagedRollbackTest/src/**/*.java"],
41    libs: ["tradefed"],
42    static_libs: ["RollbackTestLib"],
43    test_suites: ["general-tests"],
44    test_config: "NetworkStagedRollbackTest.xml",
45}
46
47java_test_host {
48    name: "MultiUserRollbackTest",
49    srcs: ["MultiUserRollbackTest/src/**/*.java"],
50    libs: ["tradefed"],
51    static_libs: [
52        "frameworks-base-hostutils",
53    ],
54    test_suites: ["general-tests"],
55    test_config: "MultiUserRollbackTest.xml",
56}
57
58java_library_host {
59    name: "RollbackTestLib",
60    srcs: ["lib/src/**/*.java"],
61    libs: ["tradefed"],
62}
63
64genrule {
65  name: "com.android.apex.apkrollback.test.pem",
66  out: ["com.android.apex.apkrollback.test.pem"],
67  cmd: "openssl genrsa -out $(out) 4096",
68}
69
70genrule {
71  name: "com.android.apex.apkrollback.test.pubkey",
72  srcs: [":com.android.apex.apkrollback.test.pem"],
73  out: ["com.android.apex.apkrollback.test.pubkey"],
74  tools: ["avbtool"],
75  cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
76}
77
78apex_key {
79  name: "com.android.apex.apkrollback.test.key",
80  private_key: ":com.android.apex.apkrollback.test.pem",
81  public_key: ":com.android.apex.apkrollback.test.pubkey",
82  installable: false,
83}
84
85apex {
86  name: "com.android.apex.apkrollback.test_v1",
87  manifest: "testdata/manifest_v1.json",
88  androidManifest: "testdata/AndroidManifest.xml",
89  file_contexts: ":apex.test-file_contexts",
90  key: "com.android.apex.apkrollback.test.key",
91  apps: ["TestAppAv1"],
92  installable: false,
93}
94
95apex {
96  name: "com.android.apex.apkrollback.test_v2",
97  manifest: "testdata/manifest_v2.json",
98  androidManifest: "testdata/AndroidManifest.xml",
99  file_contexts: ":apex.test-file_contexts",
100  key: "com.android.apex.apkrollback.test.key",
101  apps: ["TestAppAv2"],
102  installable: false,
103}
104
105apex {
106  name: "com.android.apex.apkrollback.test_v2Crashing",
107  manifest: "testdata/manifest_v2.json",
108  androidManifest: "testdata/AndroidManifest.xml",
109  file_contexts: ":apex.test-file_contexts",
110  key: "com.android.apex.apkrollback.test.key",
111  apps: ["TestAppACrashingV2"],
112  installable: false,
113}