Prepare treble_sepolicy_tests for inclusion in CTS
Unconditionally compile treble_sepolicy_tests. Make compat files conditional on running the compat tests. Bug: 37008075 Test: build Change-Id: Ib3aee6e93d285ca141803a13958fbcb38b891b68
This commit is contained in:
parent
9d9c370f31
commit
fe0910c9ad
2 changed files with 15 additions and 17 deletions
|
@ -204,12 +204,6 @@ LOCAL_REQUIRED_MODULES += \
|
||||||
secilc \
|
secilc \
|
||||||
plat_sepolicy_vers.txt \
|
plat_sepolicy_vers.txt \
|
||||||
|
|
||||||
ifneq ($(with_asan),true)
|
|
||||||
LOCAL_REQUIRED_MODULES += \
|
|
||||||
treble_sepolicy_tests \
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Include precompiled policy, unless told otherwise
|
# Include precompiled policy, unless told otherwise
|
||||||
ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false)
|
ifneq ($(PRODUCT_PRECOMPILED_SEPOLICY),false)
|
||||||
LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256
|
LOCAL_REQUIRED_MODULES += precompiled_sepolicy precompiled_sepolicy.plat_and_mapping.sha256
|
||||||
|
@ -247,6 +241,7 @@ endif
|
||||||
ifneq ($(with_asan),true)
|
ifneq ($(with_asan),true)
|
||||||
LOCAL_REQUIRED_MODULES += \
|
LOCAL_REQUIRED_MODULES += \
|
||||||
sepolicy_tests \
|
sepolicy_tests \
|
||||||
|
treble_sepolicy_tests \
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -332,18 +332,11 @@ if __name__ == '__main__':
|
||||||
if not os.path.exists(options.libpath):
|
if not os.path.exists(options.libpath):
|
||||||
sys.exit("Error: library-path " + options.libpath + " does not exist\n"
|
sys.exit("Error: library-path " + options.libpath + " does not exist\n"
|
||||||
+ parser.usage)
|
+ parser.usage)
|
||||||
if not options.basepolicy:
|
|
||||||
sys.exit("Must specify the current platform-only policy file\n" + parser.usage)
|
|
||||||
if not options.mapping:
|
|
||||||
sys.exit("Must specify a compatibility mapping file\n" + parser.usage)
|
|
||||||
if not options.oldpolicy:
|
|
||||||
sys.exit("Must specify the previous monolithic policy file\n" + parser.usage)
|
|
||||||
if not options.policy:
|
if not options.policy:
|
||||||
sys.exit("Must specify current monolithic policy file\n" + parser.usage)
|
sys.exit("Must specify current monolithic policy file\n" + parser.usage)
|
||||||
if not os.path.exists(options.policy):
|
if not os.path.exists(options.policy):
|
||||||
sys.exit("Error: policy file " + options.policy + " does not exist\n"
|
sys.exit("Error: policy file " + options.policy + " does not exist\n"
|
||||||
+ parser.usage)
|
+ parser.usage)
|
||||||
|
|
||||||
if not options.file_contexts:
|
if not options.file_contexts:
|
||||||
sys.exit("Error: Must specify file_contexts file(s)\n" + parser.usage)
|
sys.exit("Error: Must specify file_contexts file(s)\n" + parser.usage)
|
||||||
for f in options.file_contexts:
|
for f in options.file_contexts:
|
||||||
|
@ -351,15 +344,25 @@ if __name__ == '__main__':
|
||||||
sys.exit("Error: File_contexts file " + f + " does not exist\n" +
|
sys.exit("Error: File_contexts file " + f + " does not exist\n" +
|
||||||
parser.usage)
|
parser.usage)
|
||||||
|
|
||||||
|
# Mapping files are only necessary for the TrebleCompatMapping test
|
||||||
|
if options.tests is None or options.tests is "TrebleCompatMapping":
|
||||||
|
if not options.basepolicy:
|
||||||
|
sys.exit("Must specify the current platform-only policy file\n" + parser.usage)
|
||||||
|
if not options.mapping:
|
||||||
|
sys.exit("Must specify a compatibility mapping file\n" + parser.usage)
|
||||||
|
if not options.oldpolicy:
|
||||||
|
sys.exit("Must specify the previous monolithic policy file\n" + parser.usage)
|
||||||
|
basepol = policy.Policy(options.basepolicy, None, options.libpath)
|
||||||
|
oldpol = policy.Policy(options.oldpolicy, None, options.libpath)
|
||||||
|
mapping = mini_parser.MiniCilParser(options.mapping)
|
||||||
|
compatSetup(basepol, oldpol, mapping)
|
||||||
|
|
||||||
|
|
||||||
if options.faketreble:
|
if options.faketreble:
|
||||||
FakeTreble = True
|
FakeTreble = True
|
||||||
|
|
||||||
pol = policy.Policy(options.policy, options.file_contexts, options.libpath)
|
pol = policy.Policy(options.policy, options.file_contexts, options.libpath)
|
||||||
setup(pol)
|
setup(pol)
|
||||||
basepol = policy.Policy(options.basepolicy, None, options.libpath)
|
|
||||||
oldpol = policy.Policy(options.oldpolicy, None, options.libpath)
|
|
||||||
mapping = mini_parser.MiniCilParser(options.mapping)
|
|
||||||
compatSetup(basepol, oldpol, mapping)
|
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
PrintScontexts()
|
PrintScontexts()
|
||||||
|
|
Loading…
Reference in a new issue