From 78b3d573dac215d09dffac001e4223a30fef8e25 Mon Sep 17 00:00:00 2001 From: Dan Cashman <dcashman@google.com> Date: Mon, 14 Aug 2017 09:47:37 -0700 Subject: [PATCH] Move compatibility files out of prebuilts dir. The treble compatibility tests check for policy differences between old and new policy. To do this correctly, we must not modify the policy which represents the older policies. Move the files meant to be changed to a different location from the ones that are not meant to be touched to avoid any undesired changes to old policy, e.g. commit: 2bdefd65078d890889672938c6f0d2accdd25bc5 Bug: 36899958 Test: Build-time tests build. Change-Id: I8fa3947cfae756f37556fb34e1654382e2e48372 --- Android.mk | 4 ++-- {prebuilts/api => private/compat}/26.0/26.0.cil | 0 {prebuilts/api => private/compat}/26.0/26.0.ignore.cil | 0 tests/treble_sepolicy_tests.py | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) rename {prebuilts/api => private/compat}/26.0/26.0.cil (100%) rename {prebuilts/api => private/compat}/26.0/26.0.ignore.cil (100%) diff --git a/Android.mk b/Android.mk index 0503b5544..1c9295eac 100644 --- a/Android.mk +++ b/Android.mk @@ -1192,8 +1192,8 @@ $(built_26.0_plat_sepolicy): $(26.0_plat_policy.conf) $(HOST_OUT_EXECUTABLES)/ch # targeting the 26.0 SELinux release. This ensures that our policy will build # when used on a device that has non-platform policy targetting the 26.0 release. 26.0_compat := $(intermediates)/26.0_compat -26.0_mapping.cil := $(LOCAL_PATH)/prebuilts/api/26.0/26.0.cil -26.0_mapping.ignore.cil := $(LOCAL_PATH)/prebuilts/api/26.0/26.0.ignore.cil +26.0_mapping.cil := $(LOCAL_PATH)/private/compat/26.0/26.0.cil +26.0_mapping.ignore.cil := $(LOCAL_PATH)/private/compat/26.0/26.0.ignore.cil 26.0_nonplat := $(LOCAL_PATH)/prebuilts/api/26.0/nonplat_sepolicy.cil $(26.0_compat): PRIVATE_CIL_FILES := \ $(built_plat_cil) $(26.0_mapping.cil) $(26.0_nonplat) diff --git a/prebuilts/api/26.0/26.0.cil b/private/compat/26.0/26.0.cil similarity index 100% rename from prebuilts/api/26.0/26.0.cil rename to private/compat/26.0/26.0.cil diff --git a/prebuilts/api/26.0/26.0.ignore.cil b/private/compat/26.0/26.0.ignore.cil similarity index 100% rename from prebuilts/api/26.0/26.0.ignore.cil rename to private/compat/26.0/26.0.ignore.cil diff --git a/tests/treble_sepolicy_tests.py b/tests/treble_sepolicy_tests.py index 7584cab5a..f65967758 100644 --- a/tests/treble_sepolicy_tests.py +++ b/tests/treble_sepolicy_tests.py @@ -223,7 +223,8 @@ def TestNoUnmappedNewTypes(): if len(violators) > 0: ret += "SELinux: The following types were found added to the policy " ret += "without an entry into the compatibility mapping file(s) found " - ret += "in prebuilts/api/" + compatMapping.apiLevel + "/\n" + ret += "in private/compat/" + compatMapping.apiLevel + "/" + ret += compatMapping.apiLevel + "[.ignore].cil/n" ret += " ".join(str(x) for x in sorted(violators)) + "\n" return ret -- GitLab