blob: 7dd003eb975546f0f48b238ae17d091f5d3ca17a [file] [log] [blame]
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
android_test {
name: "RollbackTest",
manifest: "RollbackTest/AndroidManifest.xml",
platform_apis: true,
srcs: ["RollbackTest/src/**/*.java"],
static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
test_suites: ["general-tests"],
test_config: "RollbackTest.xml",
java_resources: [
":com.android.apex.apkrollback.test_v2",
":com.android.apex.apkrollback.test_v2Crashing"
],
}
java_test_host {
name: "StagedRollbackTest",
srcs: ["StagedRollbackTest/src/**/*.java"],
libs: ["tradefed"],
static_libs: [
"compatibility-tradefed",
"frameworks-base-hostutils",
"RollbackTestLib",
"testng",
],
test_suites: ["general-tests"],
test_config: "StagedRollbackTest.xml",
data: [":com.android.apex.apkrollback.test_v1"],
}
java_test_host {
name: "NetworkStagedRollbackTest",
srcs: ["NetworkStagedRollbackTest/src/**/*.java"],
libs: ["tradefed"],
static_libs: ["RollbackTestLib", "frameworks-base-hostutils"],
test_suites: ["general-tests"],
test_config: "NetworkStagedRollbackTest.xml",
}
java_test_host {
name: "MultiUserRollbackTest",
srcs: ["MultiUserRollbackTest/src/**/*.java"],
libs: ["tradefed"],
static_libs: [
"frameworks-base-hostutils",
],
test_suites: ["general-tests"],
test_config: "MultiUserRollbackTest.xml",
}
java_library_host {
name: "RollbackTestLib",
srcs: ["lib/src/**/*.java"],
libs: ["tradefed"],
}
genrule {
name: "com.android.apex.apkrollback.test.pem",
out: ["com.android.apex.apkrollback.test.pem"],
cmd: "openssl genrsa -out $(out) 4096",
}
genrule {
name: "com.android.apex.apkrollback.test.pubkey",
srcs: [":com.android.apex.apkrollback.test.pem"],
out: ["com.android.apex.apkrollback.test.pubkey"],
tools: ["avbtool"],
cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
}
apex_key {
name: "com.android.apex.apkrollback.test.key",
private_key: ":com.android.apex.apkrollback.test.pem",
public_key: ":com.android.apex.apkrollback.test.pubkey",
installable: false,
}
apex {
name: "com.android.apex.apkrollback.test_v1",
manifest: "testdata/manifest_v1.json",
androidManifest: "testdata/AndroidManifest.xml",
file_contexts: ":apex.test-file_contexts",
key: "com.android.apex.apkrollback.test.key",
apps: ["TestAppAv1"],
installable: false,
}
apex {
name: "com.android.apex.apkrollback.test_v2",
manifest: "testdata/manifest_v2.json",
androidManifest: "testdata/AndroidManifest.xml",
file_contexts: ":apex.test-file_contexts",
key: "com.android.apex.apkrollback.test.key",
apps: ["TestAppAv2"],
installable: false,
}
apex {
name: "com.android.apex.apkrollback.test_v2Crashing",
manifest: "testdata/manifest_v2.json",
androidManifest: "testdata/AndroidManifest.xml",
file_contexts: ":apex.test-file_contexts",
key: "com.android.apex.apkrollback.test.key",
apps: ["TestAppACrashingV2"],
installable: false,
}