blob: 81e7927c57658a781b8aebeef0870027a348c2e1 [file] [log] [blame]
Bob Badour601ebb42021-02-03 23:07:40 -08001package {
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
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -07009cc_library_host_shared {
10 name: "libsepolwrap",
11 srcs: ["sepol_wrap.cpp"],
Inseob Kimff2018f2024-04-17 09:48:43 +090012 cflags: [
13 "-Wall",
14 "-Werror",
15 ],
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070016 export_include_dirs: ["include"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090017 stl: "c++_static",
Dan Willemsen948354a2017-09-01 14:08:46 -070018
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.
Jeff Vander Stoep3ca843a2017-10-04 09:42:29 -070022 static_libs: [
23 "libbase",
24 "libsepol",
25 ],
Dan Willemsen948354a2017-09-01 14:08:46 -070026 sanitize: {
27 never: true,
28 },
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070029}
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -070030
Inseob Kimcbc95ea2022-01-21 19:32:53 +090031python_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
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -070044python_binary_host {
45 name: "treble_sepolicy_tests",
46 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080047 "treble_sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070048 ],
Inseob Kim4912a242022-07-25 11:30:02 +090049 version: {
50 py3: {
51 embedded_launcher: true,
52 },
53 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090054 libs: [
55 "mini_cil_parser",
Inseob Kimcbc95ea2022-01-21 19:32:53 +090056 ],
Dan Cashman91d398d2017-09-26 12:58:29 -070057}
58
59python_binary_host {
60 name: "sepolicy_tests",
61 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080062 "sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070063 ],
Inseob Kim4912a242022-07-25 11:30:02 +090064 version: {
65 py3: {
66 embedded_launcher: true,
67 },
68 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090069 libs: ["pysepolwrap"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090070 data: [":libsepolwrap"],
Dan Cashman91d398d2017-09-26 12:58:29 -070071}
72
73python_binary_host {
Jooyung Han23d1e622023-04-04 18:03:07 +090074 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",
Cole Faust30349e32024-10-22 16:31:06 -070086 ],
87 device_common_data: [
Jooyung Han23d1e622023-04-04 18:03:07 +090088 ":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",
Cole Faust30349e32024-10-22 16:31:06 -0700101 ],
102 device_common_data: [
Jooyung Han23d1e622023-04-04 18:03:07 +0900103 ":precompiled_sepolicy",
104 ],
105 test_options: {
106 unit_test: true,
107 },
Jooyung Han7ba515a2023-04-11 08:30:19 +0900108 version: {
109 py3: {
110 embedded_launcher: true,
111 },
112 },
Jooyung Han23d1e622023-04-04 18:03:07 +0900113}
114
115python_binary_host {
Dan Cashman91d398d2017-09-26 12:58:29 -0700116 name: "searchpolicy",
117 srcs: [
Jeff Vander Stoep3a3756f2018-04-24 11:03:22 -0700118 "searchpolicy.py",
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700119 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900120 libs: ["pysepolwrap"],
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700121 required: ["libsepolwrap"],
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -0700122}
Tri Vo438684b2018-09-29 17:47:10 -0700123
124python_binary_host {
125 name: "combine_maps",
126 srcs: [
127 "combine_maps.py",
Tri Vo438684b2018-09-29 17:47:10 -0700128 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900129 libs: ["mini_cil_parser"],
Tri Vo438684b2018-09-29 17:47:10 -0700130}
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700131
132python_binary_host {
133 name: "fc_sort",
134 srcs: [
135 "fc_sort.py",
136 ],
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700137}
Inseob Kim2bcc0452020-12-21 13:16:44 +0900138
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100139python_test_host {
140 name: "fc_sort_test",
141 srcs: [
142 "fc_sort.py",
143 "fc_sort_test.py",
144 ],
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100145 test_options: {
146 unit_test: true,
Inseob Kimff2018f2024-04-17 09:48:43 +0900147 },
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100148}
149
Inseob Kim2bcc0452020-12-21 13:16:44 +0900150python_binary_host {
151 name: "check_prop_prefix",
152 srcs: ["check_prop_prefix.py"],
153}
Inseob Kim36d9d392023-09-04 17:40:03 +0900154
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}
Inseob Kim55d140f2023-09-26 11:19:13 +0900169
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}
Inseob Kim6faaf132024-05-02 17:40:00 +0900186
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}