Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemSEPolicy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matombo
AndroidSystemSEPolicy
Commits
be60f71f
Commit
be60f71f
authored
Oct 4, 2017
by
Jeff Vander Stoep
Committed by
android-build-merger
Oct 4, 2017
Browse files
Options
Downloads
Plain Diff
Merge "Move python sepolicy tests to embedded launcher" am:
1e880410
am:
f2d1003c
am:
a6b8f4b1
Change-Id: Ic64d56e86e455c8cb5e814c359aaee568618d7e0
parents
a09b3b4f
a6b8f4b1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Android.mk
+2
-2
2 additions, 2 deletions
Android.mk
tests/Android.bp
+1
-0
1 addition, 0 deletions
tests/Android.bp
tests/policy.py
+5
-3
5 additions, 3 deletions
tests/policy.py
with
8 additions
and
5 deletions
Android.mk
+
2
−
2
View file @
be60f71f
...
...
@@ -1188,7 +1188,7 @@ $(sepolicy_tests): PRIVATE_SEPOLICY := $(built_sepolicy)
$(sepolicy_tests)
:
$(HOST_OUT_EXECUTABLES)/sepolicy_tests
\
$(built_plat_fc) $(built_nonplat_fc) $(built_sepolicy)
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
python
$(
HOST_OUT_EXECUTABLES
)
/sepolicy_tests
-l
$(
HOST_OUT
)
/lib64
-f
$(
PRIVATE_PLAT_FC
)
-f
$(
PRIVATE_NONPLAT_FC
)
-p
$(
PRIVATE_SEPOLICY
)
$(
hide
)
$(
HOST_OUT_EXECUTABLES
)
/sepolicy_tests
-l
$(
HOST_OUT
)
/lib64
-f
$(
PRIVATE_PLAT_FC
)
-f
$(
PRIVATE_NONPLAT_FC
)
-p
$(
PRIVATE_SEPOLICY
)
$(
hide
)
touch
$@
##################################
...
...
@@ -1304,7 +1304,7 @@ $(treble_sepolicy_tests): $(HOST_OUT_EXECUTABLES)/treble_sepolicy_tests \
$(built_plat_fc) $(built_nonplat_fc) $(built_sepolicy) $(built_plat_sepolicy)
\
$(built_26.0_plat_sepolicy) $(26.0_compat) $(26.0_mapping.combined.cil)
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
python
$(
HOST_OUT_EXECUTABLES
)
/treble_sepolicy_tests
-l
\
$(
hide
)
$(
HOST_OUT_EXECUTABLES
)
/treble_sepolicy_tests
-l
\
$(
HOST_OUT
)
/lib64
-f
$(
PRIVATE_PLAT_FC
)
-f
$(
PRIVATE_NONPLAT_FC
)
\
-b
$(
PRIVATE_PLAT_SEPOLICY
)
-m
$(
PRIVATE_COMBINED_MAPPING
)
\
-o
$(
PRIVATE_SEPOLICY_OLD
)
-p
$(
PRIVATE_SEPOLICY
)
\
...
...
...
...
This diff is collapsed.
Click to expand it.
tests/Android.bp
+
1
−
0
View file @
be60f71f
...
...
@@ -19,6 +19,7 @@ python_defaults {
name: "py2_only",
version: {
py2: {
embedded_launcher: true,
enabled: true,
},
py3: {
...
...
...
...
This diff is collapsed.
Click to expand it.
tests/policy.py
+
5
−
3
View file @
be60f71f
...
...
@@ -2,6 +2,7 @@ from ctypes import *
import
re
import
os
import
sys
import
platform
###
# Check whether the regex will match a file path starting with the provided
...
...
@@ -252,12 +253,13 @@ class Policy:
# load ctypes-ified libsepol wrapper
def
__InitLibsepolwrap
(
self
,
LibPath
):
if
"
linux
"
in
sys
.
platform
:
if
"
linux
"
in
platform
.
system
().
lower
()
:
lib
=
CDLL
(
LibPath
+
"
/libsepolwrap.so
"
)
elif
"
darwin
"
in
sys
.
platform
:
elif
"
darwin
"
in
platform
.
system
().
lower
()
:
lib
=
CDLL
(
LibPath
+
"
/libsepolwrap.dylib
"
)
else
:
sys
.
exit
(
"
only Linux and Mac currrently supported
"
)
sys
.
exit
(
"
policy.py:
"
+
platform
.
system
()
+
"
not supported.
"
+
"
Only Linux and Darwin platforms are currently supported.
"
)
# int get_allow_rule(char *out, size_t len, void *policydbp, void *avtab_iterp);
lib
.
get_allow_rule
.
restype
=
c_int
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment