• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2014 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
15package {
16    default_team: "trendy_team_platform_security",
17    // See: http://go/android-license-faq
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21java_test_host {
22    // Must match the package name in CtsTestCaseList.mk
23    name: "CtsSecurityHostTestCases",
24    defaults: ["cts_defaults"],
25    srcs: [
26        "src/**/*.java",
27    ],
28    // tag this module as a cts test artifact
29    test_suites: [
30        "cts",
31        "general-tests",
32    ],
33    libs: [
34        "cts-tradefed",
35        "tradefed",
36        "compatibility-host-util",
37    ],
38    java_resources: [
39        ":plat_seapp_contexts",
40        ":plat_seapp_neverallows",
41        ":plat_file_contexts",
42        ":plat_property_contexts",
43        ":plat_service_contexts",
44    ],
45    static_libs: [
46        "CtsSecurityHostTestCases_StaticLibs",
47        "diffutils-prebuilt-jar",
48        "CompatChangeGatingTestBase",
49        "cts-host-utils",
50    ],
51    data: [
52        ":CtsZipValidateApp",
53    ],
54    // These two host cc_library_* modules cannot be wrapped as java_resources directly into
55    // a .jar due to the "missing variant" issue, see b/197025344 for more details. This workaround
56    // will install these two modules alongside with the .jar file in the testcases directory.
57    jni_libs: [
58        "libsepolwrap",
59        "libc++",
60    ],
61    target_required: ["CtsDeviceInfo"],
62}
63
64java_genrule_host {
65    name: "CtsSecurityHostTestCases_StaticLibs",
66    tools: [
67        "soong_zip",
68        "checkseapp",
69        "checkfc",
70        "property_info_checker",
71        "searchpolicy",
72        "secilc",
73        "sepolicy-analyze",
74        "sepolicy_tests",
75    ],
76    tool_files: [
77        ":general_sepolicy.conf",
78        ":prebuilt_sepolicy_cts_data",
79    ],
80    out: ["CtsSecurityHostTestCases_StaticLibs.jar"],
81    cmd: "echo $(locations :prebuilt_sepolicy_cts_data) > $(out).prebuilt_list.txt && " +
82        "$(location soong_zip) -jar -o $(location CtsSecurityHostTestCases_StaticLibs.jar) -j " +
83        "-f $(location checkseapp) " +
84        "-f $(location checkfc) " +
85        "-f $(location property_info_checker) " +
86        "-f $(location searchpolicy) " +
87        "-f $(location secilc) " +
88        "-f $(location sepolicy-analyze) " +
89        "-f $(location sepolicy_tests) " +
90        "-f $(location :general_sepolicy.conf) " +
91        "-l $(out).prebuilt_list.txt",
92}
93