blob: 3f36f41f2cbe40a4b4f2a24765b8d5e0492a9897 [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 Kimcbc95ea2022-01-21 19:32:53 +090049 libs: [
50 "mini_cil_parser",
Inseob Kimcbc95ea2022-01-21 19:32:53 +090051 ],
Dan Cashman91d398d2017-09-26 12:58:29 -070052}
53
54python_binary_host {
55 name: "sepolicy_tests",
56 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080057 "sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070058 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +090059 libs: ["pysepolwrap"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090060 data: [":libsepolwrap"],
Dan Cashman91d398d2017-09-26 12:58:29 -070061}
62
63python_binary_host {
Jooyung Han23d1e622023-04-04 18:03:07 +090064 name: "apex_sepolicy_tests",
65 srcs: [
66 "apex_sepolicy_tests.py",
67 ],
Jooyung Han23d1e622023-04-04 18:03:07 +090068 libs: ["pysepolwrap"],
69 data: [
70 ":libsepolwrap",
Cole Faust30349e32024-10-22 16:31:06 -070071 ],
72 device_common_data: [
Jooyung Han23d1e622023-04-04 18:03:07 +090073 ":precompiled_sepolicy",
74 ],
75}
76
77python_test_host {
78 name: "apex_sepolicy_tests_test",
79 srcs: [
80 "apex_sepolicy_tests.py",
81 "apex_sepolicy_tests_test.py",
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 test_options: {
91 unit_test: true,
92 },
93}
94
95python_binary_host {
Dan Cashman91d398d2017-09-26 12:58:29 -070096 name: "searchpolicy",
97 srcs: [
Jeff Vander Stoep3a3756f2018-04-24 11:03:22 -070098 "searchpolicy.py",
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -070099 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900100 libs: ["pysepolwrap"],
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700101 required: ["libsepolwrap"],
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -0700102}
Tri Vo438684b2018-09-29 17:47:10 -0700103
104python_binary_host {
105 name: "combine_maps",
106 srcs: [
107 "combine_maps.py",
Tri Vo438684b2018-09-29 17:47:10 -0700108 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900109 libs: ["mini_cil_parser"],
Tri Vo438684b2018-09-29 17:47:10 -0700110}
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700111
112python_binary_host {
113 name: "fc_sort",
114 srcs: [
115 "fc_sort.py",
116 ],
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700117}
Inseob Kim2bcc0452020-12-21 13:16:44 +0900118
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100119python_test_host {
120 name: "fc_sort_test",
121 srcs: [
122 "fc_sort.py",
123 "fc_sort_test.py",
124 ],
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100125 test_options: {
126 unit_test: true,
Inseob Kimff2018f2024-04-17 09:48:43 +0900127 },
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100128}
129
Inseob Kim2bcc0452020-12-21 13:16:44 +0900130python_binary_host {
131 name: "check_prop_prefix",
132 srcs: ["check_prop_prefix.py"],
133}
Inseob Kim36d9d392023-09-04 17:40:03 +0900134
135python_binary_host {
136 name: "sepolicy_freeze_test",
137 srcs: [
138 "sepolicy_freeze_test.py",
139 ],
Inseob Kim36d9d392023-09-04 17:40:03 +0900140 libs: [
141 "mini_cil_parser",
142 ],
143}
Inseob Kim55d140f2023-09-26 11:19:13 +0900144
145python_test_host {
146 name: "policy_test",
147 srcs: [
148 "fc_sort.py",
149 "policy.py",
150 "policy_test.py",
151 ],
152 test_options: {
153 unit_test: true,
154 },
Inseob Kim55d140f2023-09-26 11:19:13 +0900155}
Inseob Kim6faaf132024-05-02 17:40:00 +0900156
157// prebuilt files to be included to CTS
158filegroup {
159 name: "prebuilt_sepolicy_cts_data",
Inseob Kimd4e49452025-01-17 10:43:25 +0900160 srcs: [
161 ":202404_sepolicy_cts_data",
162 ":202504_sepolicy_cts_data",
163 ],
Inseob Kim6faaf132024-05-02 17:40:00 +0900164 visibility: ["//cts/hostsidetests/security"],
165}