blob: 45517506c05304abbe83bc3fdc34540c493dceae [file] [log] [blame]
// Copyright (C) 2014 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.
package {
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
java_test_host {
// Must match the package name in CtsTestCaseList.mk
name: "CtsSecurityHostTestCases",
defaults: ["cts_defaults"],
srcs: [
"src/**/*.java",
":CtsSecurityHostTestCases_LocalGeneratedSources",
],
// tag this module as a cts test artifact
test_suites: [
"cts",
"general-tests",
],
libs: [
"cts-tradefed",
"tradefed",
"compatibility-host-util",
],
java_resources: [
":plat_seapp_contexts",
":plat_seapp_neverallows",
":plat_file_contexts",
":plat_property_contexts",
":plat_service_contexts",
],
static_libs: [
"CtsSecurityHostTestCases_StaticLibs",
],
// These two host cc_library_* modules cannot be wrapped as java_resources directly into
// a .jar due to the "missing variant" issue, see b/197025344 for more details. This workaround
// will install these two modules alongside with the .jar file in the testcases directory.
jni_libs: [
"libsepolwrap",
"libc++",
],
target_required: ["CtsDeviceInfo"],
}
genrule {
name: "CtsSecurityHostTestCases_LocalGeneratedSources",
tools: [
"SELinuxNeverallowTestGen",
"soong_zip",
],
srcs: [":general_sepolicy.conf"],
out: ["SELinuxNeverallowRulesTest.srcjar"],
cmd: "mkdir -p $(genDir)/android/cts/security && " +
"$(location SELinuxNeverallowTestGen) $(in) $(genDir)/android/cts/security/SELinuxNeverallowRulesTest.java && " +
"$(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)",
}
java_genrule_host {
name: "CtsSecurityHostTestCases_StaticLibs",
tools: [
"soong_zip",
"checkseapp",
"checkfc",
"property_info_checker",
"searchpolicy",
"secilc",
"sepolicy-analyze",
"sepolicy_tests",
"treble_sepolicy_tests",
],
out: ["CtsSecurityHostTestCases_StaticLibs.jar"],
cmd: "$(location soong_zip) -jar -o $(location CtsSecurityHostTestCases_StaticLibs.jar) -j " +
"-f $(location checkseapp) " +
"-f $(location checkfc) " +
"-f $(location property_info_checker) " +
"-f $(location searchpolicy) " +
"-f $(location secilc) " +
"-f $(location sepolicy-analyze) " +
"-f $(location sepolicy_tests) " +
"-f $(location treble_sepolicy_tests) ",
}