From b30e2f05f7ed3dd2a79e2dc90f00a4da831fb1dc Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Fri, 29 Mar 2024 11:09:48 +0900 Subject: [PATCH] Fix treble sepolicy tests and combine_maps script * Since vFRC there are no more minor version, so combine_maps.py is fixed to correctly handle both vFRC version and prior V.v version. * treble_sepolicy_tests_for_release.mk uses incorrect variable SYSTEM_EXT_PREBUILT_POLICY and PRODUCT_PREBUILT_POLICY, so fixing them. Bug: 331866470 Test: m selinux_policy Change-Id: I7a3ab7cf3abf2155c1998e1972adee1202af8dff --- tests/combine_maps.py | 5 +++-- treble_sepolicy_tests_for_release.mk | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/combine_maps.py b/tests/combine_maps.py index 1a7dfaabc..b0fb850c5 100644 --- a/tests/combine_maps.py +++ b/tests/combine_maps.py @@ -41,8 +41,9 @@ def Combine(top, bottom): if len(top_type_set) == 1: continue - m = re.match(r"(\w+)_\d+_\d+", top_ta) - # Typeattributes in V.v.cil have _V_v suffix, but not in V.v.ignore.cil + m = re.fullmatch(r"(\w+?)_\d+(_0)?", top_ta) + # Typeattributes in V(.0).cil have _V(_0) suffix, but not in + # V(.0).ignore.cil bottom_type = m.group(1) if m else top_ta # If type doesn't exist in bottom map, no need to maintain mappings to diff --git a/treble_sepolicy_tests_for_release.mk b/treble_sepolicy_tests_for_release.mk index 9d6960bb7..2e9d68f6b 100644 --- a/treble_sepolicy_tests_for_release.mk +++ b/treble_sepolicy_tests_for_release.mk @@ -15,7 +15,7 @@ IS_TREBLE_TEST_ENABLED_PARTNER := false ifeq ($(filter 26.0 27.0 28.0 29.0,$(version)),) ifneq (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)$(BOARD_PRODUCT_PREBUILT_DIR)) IS_TREBLE_TEST_ENABLED_PARTNER := true -endif # (,$(SYSTEM_EXT_PREBUILT_POLICY)$(PRODUCT_PREBUILT_POLICY)) +endif # (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)$(BOARD_PRODUCT_PREBUILT_DIR)) endif # ($(filter 26.0 27.0 28.0 29.0,$(version)),) include $(BUILD_SYSTEM)/base_rules.mk @@ -30,18 +30,18 @@ $(version)_mapping.cil := $(call intermediates-dir-for,ETC,plat_$(version).cil)/ $(version)_mapping.ignore.cil := \ $(call intermediates-dir-for,ETC,$(version).ignore.cil)/$(version).ignore.cil ifeq ($(IS_TREBLE_TEST_ENABLED_PARTNER),true) -ifneq (,$(SYSTEM_EXT_PREBUILT_POLICY)) +ifneq (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)) $(version)_mapping.cil += \ $(call intermediates-dir-for,ETC,system_ext_$(version).cil)/system_ext_$(version).cil $(version)_mapping.ignore.cil += \ $(call intermediates-dir-for,ETC,system_ext_$(version).ignore.cil)/system_ext_$(version).ignore.cil -endif # (,$(SYSTEM_EXT_PREBUILT_POLICY)) -ifneq (,$(PRODUCT_PREBUILT_POLICY)) +endif # (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)) +ifneq (,$(BOARD_PRODUCT_PREBUILT_DIR)) $(version)_mapping.cil += \ $(call intermediates-dir-for,ETC,product_$(version).cil)/product_$(version).cil $(version)_mapping.ignore.cil += \ $(call intermediates-dir-for,ETC,product_$(version).ignore.cil)/product_$(version).ignore.cil -endif # (,$(PRODUCT_PREBUILT_POLICY)) +endif # (,$(BOARD_PRODUCT_PREBUILT_DIR)) endif #($(IS_TREBLE_TEST_ENABLED_PARTNER),true) # $(version)_mapping.combined.cil - a combination of the mapping file used when