summaryrefslogtreecommitdiff
path: root/hostsidetests/security/Android.bp
blob: f42b9b434ed7b08d9e6f34d2c5b214209696f945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// 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 {
    default_team: "trendy_team_platform_security",
    // 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",
    ],
    // 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",
        "diffutils-prebuilt-jar",
        "CompatChangeGatingTestBase",
        "cts-host-utils",
    ],
    data: [
        ":CtsZipValidateApp",
    ],
    // 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"],
}

filegroup {
    name: "prebuilt_sepolicy_cts_data",
    srcs: [":202404_sepolicy_cts_data"],
}

java_genrule_host {
    name: "CtsSecurityHostTestCases_StaticLibs",
    tools: [
        "soong_zip",
        "checkseapp",
        "checkfc",
        "property_info_checker",
        "searchpolicy",
        "secilc",
        "sepolicy-analyze",
        "sepolicy_tests",
    ],
    tool_files: [
        ":general_sepolicy.conf",
        ":prebuilt_sepolicy_cts_data",
    ],
    out: ["CtsSecurityHostTestCases_StaticLibs.jar"],
    cmd: "echo $(locations :prebuilt_sepolicy_cts_data) > $(out).prebuilt_list.txt && " +
        "$(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 :general_sepolicy.conf) " +
        "-l $(out).prebuilt_list.txt",
}