xref: /aosp_15_r20/system/sepolicy/tests/Android.bp (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1package {
2    // http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // the below license kinds from "system_sepolicy_license":
5    //   SPDX-license-identifier-Apache-2.0
6    default_applicable_licenses: ["system_sepolicy_license"],
7}
8
9cc_library_host_shared {
10    name: "libsepolwrap",
11    srcs: ["sepol_wrap.cpp"],
12    cflags: [
13        "-Wall",
14        "-Werror",
15    ],
16    export_include_dirs: ["include"],
17    stl: "c++_static",
18
19    // libsepolwrap gets loaded from the system python, which does not have the
20    // ASAN runtime. So turn off sanitization for ourself, and  use static
21    // libraries, since the shared libraries will use ASAN.
22    static_libs: [
23        "libbase",
24        "libsepol",
25    ],
26    sanitize: {
27        never: true,
28    },
29}
30
31python_library_host {
32    name: "mini_cil_parser",
33    srcs: ["mini_parser.py"],
34}
35
36python_library_host {
37    name: "pysepolwrap",
38    srcs: [
39        "fc_sort.py",
40        "policy.py",
41    ],
42}
43
44python_binary_host {
45    name: "treble_sepolicy_tests",
46    srcs: [
47        "treble_sepolicy_tests.py",
48    ],
49    version: {
50        py3: {
51            embedded_launcher: true,
52        },
53    },
54    libs: [
55        "mini_cil_parser",
56    ],
57}
58
59python_binary_host {
60    name: "sepolicy_tests",
61    srcs: [
62        "sepolicy_tests.py",
63    ],
64    version: {
65        py3: {
66            embedded_launcher: true,
67        },
68    },
69    libs: ["pysepolwrap"],
70    data: [":libsepolwrap"],
71}
72
73python_binary_host {
74    name: "apex_sepolicy_tests",
75    srcs: [
76        "apex_sepolicy_tests.py",
77    ],
78    version: {
79        py3: {
80            embedded_launcher: true,
81        },
82    },
83    libs: ["pysepolwrap"],
84    data: [
85        ":libsepolwrap",
86    ],
87    device_common_data: [
88        ":precompiled_sepolicy",
89    ],
90}
91
92python_test_host {
93    name: "apex_sepolicy_tests_test",
94    srcs: [
95        "apex_sepolicy_tests.py",
96        "apex_sepolicy_tests_test.py",
97    ],
98    libs: ["pysepolwrap"],
99    data: [
100        ":libsepolwrap",
101    ],
102    device_common_data: [
103        ":precompiled_sepolicy",
104    ],
105    test_options: {
106        unit_test: true,
107    },
108    version: {
109        py3: {
110            embedded_launcher: true,
111        },
112    },
113}
114
115python_binary_host {
116    name: "searchpolicy",
117    srcs: [
118        "searchpolicy.py",
119    ],
120    libs: ["pysepolwrap"],
121    required: ["libsepolwrap"],
122}
123
124python_binary_host {
125    name: "combine_maps",
126    srcs: [
127        "combine_maps.py",
128    ],
129    libs: ["mini_cil_parser"],
130}
131
132python_binary_host {
133    name: "fc_sort",
134    srcs: [
135        "fc_sort.py",
136    ],
137}
138
139python_test_host {
140    name: "fc_sort_test",
141    srcs: [
142        "fc_sort.py",
143        "fc_sort_test.py",
144    ],
145    test_options: {
146        unit_test: true,
147    },
148}
149
150python_binary_host {
151    name: "check_prop_prefix",
152    srcs: ["check_prop_prefix.py"],
153}
154
155python_binary_host {
156    name: "sepolicy_freeze_test",
157    srcs: [
158        "sepolicy_freeze_test.py",
159    ],
160    version: {
161        py3: {
162            embedded_launcher: true,
163        },
164    },
165    libs: [
166        "mini_cil_parser",
167    ],
168}
169
170python_test_host {
171    name: "policy_test",
172    srcs: [
173        "fc_sort.py",
174        "policy.py",
175        "policy_test.py",
176    ],
177    test_options: {
178        unit_test: true,
179    },
180    version: {
181        py3: {
182            embedded_launcher: true,
183        },
184    },
185}
186
187// prebuilt files to be included to CTS
188filegroup {
189    name: "prebuilt_sepolicy_cts_data",
190    srcs: [":202404_sepolicy_cts_data"],
191    visibility: ["//cts/hostsidetests/security"],
192}
193