Use prebuilts for compat test if prebuilts exist

system/sepolicy should support both REL build and ToT build. That means
that system/sepolicy and prebuilts may differ. As the frozen sepolicy is
what vendor sepolicy uses, so we need to use prebuilts to run Treble
compat test.

Bug: 296875906
Test: m selinux_policy on REL
Change-Id: I4b290266ba87e3f011d640bec133fc88359ea52f
This commit is contained in:
Inseob Kim 2023-09-08 10:44:49 +09:00
parent ab64129dbb
commit 2aac33597d
7 changed files with 131 additions and 11 deletions

View File

@ -550,24 +550,24 @@ file_contexts.modules.tmp :=
# Tests for Treble compatibility of current platform policy and vendor policy of
# given release version.
built_plat_sepolicy := $(call intermediates-dir-for,ETC,base_plat_sepolicy)/base_plat_sepolicy
built_system_ext_sepolicy := $(call intermediates-dir-for,ETC,base_system_ext_sepolicy)/base_system_ext_sepolicy
built_product_sepolicy := $(call intermediates-dir-for,ETC,base_product_sepolicy)/base_product_sepolicy
base_plat_pub_policy.cil := $(call intermediates-dir-for,ETC,base_plat_pub_policy.cil)/base_plat_pub_policy.cil
base_system_ext_pub_polcy.cil := $(call intermediates-dir-for,ETC,base_system_ext_pub_polcy.cil)/base_system_ext_pub_polcy.cil
base_product_pub_policy.cil := $(call intermediates-dir-for,ETC,base_product_pub_policy.cil)/base_product_pub_policy.cil
ver := $(PLATFORM_SEPOLICY_VERSION)
ifneq ($(wildcard $(LOCAL_PATH)/prebuilts/api/$(PLATFORM_SEPOLICY_VERSION)),)
# If PLATFORM_SEPOLICY_VERSION is already frozen, use prebuilts for compat test
base_plat_pub_policy.cil := $(call intermediates-dir-for,ETC,$(ver)_plat_pub_policy.cil)/$(ver)_plat_pub_policy.cil
base_product_pub_policy.cil := $(call intermediates-dir-for,ETC,$(ver)_product_pub_policy.cil)/$(ver)_product_pub_policy.cil
else
# If not, use ToT for compat test
base_plat_pub_policy.cil := $(call intermediates-dir-for,ETC,base_plat_pub_policy.cil)/base_plat_pub_policy.cil
base_product_pub_policy.cil := $(call intermediates-dir-for,ETC,base_product_pub_policy.cil)/base_product_pub_policy.cil
endif
ver :=
$(foreach v,$(PLATFORM_SEPOLICY_COMPAT_VERSIONS), \
$(eval version_under_treble_tests := $(v)) \
$(eval include $(LOCAL_PATH)/treble_sepolicy_tests_for_release.mk) \
)
built_plat_sepolicy :=
built_system_ext_sepolicy :=
built_product_sepolicy :=
base_plat_pub_policy.cil :=
base_system_ext_pub_polcy.cil :=
base_product_pub_policy.cil :=
#################################

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "29.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_29.0}",
":se_build_files{.system_ext_public_29.0}",
":se_build_files{.product_public_29.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "29.0_product_pub_policy.cil",
src: ":29.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "29.0_plat_policy.conf",
srcs: [

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "30.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_30.0}",
":se_build_files{.system_ext_public_30.0}",
":se_build_files{.product_public_30.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "30.0_product_pub_policy.cil",
src: ":30.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "30.0_plat_policy.conf",
srcs: [

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "31.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_31.0}",
":se_build_files{.system_ext_public_31.0}",
":se_build_files{.product_public_31.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "31.0_product_pub_policy.cil",
src: ":31.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "31.0_plat_policy.conf",
srcs: [

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "32.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_32.0}",
":se_build_files{.system_ext_public_32.0}",
":se_build_files{.product_public_32.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "32.0_product_pub_policy.cil",
src: ":32.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "32.0_plat_policy.conf",
srcs: [

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "33.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_33.0}",
":se_build_files{.system_ext_public_33.0}",
":se_build_files{.product_public_33.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "33.0_product_pub_policy.cil",
src: ":33.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "33.0_plat_policy.conf",
srcs: [

View File

@ -27,6 +27,26 @@ se_policy_cil {
installable: false,
}
se_policy_conf {
name: "34.0_product_pub_policy.conf",
srcs: [
":se_build_files{.plat_public_34.0}",
":se_build_files{.system_ext_public_34.0}",
":se_build_files{.product_public_34.0}",
":se_build_files{.reqd_mask}",
],
installable: false,
build_variant: "user",
}
se_policy_cil {
name: "34.0_product_pub_policy.cil",
src: ":34.0_product_pub_policy.conf",
filter_out: [":reqd_policy_mask.cil"],
secilc_check: false,
installable: false,
}
se_policy_conf {
name: "34.0_plat_policy.conf",
srcs: [