From b9518073037aee71b0ed71cbcd930e44cde0a592 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Fri, 22 Nov 2024 14:05:20 +0900 Subject: Add apex_test.skip_validations Run validations for apex_test modules as well. If a test apex needs to be invalid for testing, it needs to specify which validation it needs to skip. This is to prevent cases like using apex_test to avoid a certain validation, but accidentally skipping all validations. For now, host_apex_verifier/apex_sepolicy_tests can be skipped. Bug: 363090062 Test: m nothing --no-skip-soong-tests Test: mmma system/apex Change-Id: I2d14f25f579eabe92ed2bd0e28b5ed19583df99d --- apex/builder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apex/builder.go') diff --git a/apex/builder.go b/apex/builder.go index d0acc8d6c..e5ae10622 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -924,14 +924,14 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) { var validations android.Paths validations = append(validations, runApexLinkerconfigValidation(ctx, unsignedOutputFile, imageDir)) // TODO(b/279688635) deapexer supports [ext4] - if !a.testApex && suffix == imageApexSuffix && ext4 == a.payloadFsType { + if !a.skipValidation(apexSepolicyTests) && suffix == imageApexSuffix && ext4 == a.payloadFsType { validations = append(validations, runApexSepolicyTests(ctx, unsignedOutputFile)) } if !a.testApex && len(a.properties.Unwanted_transitive_deps) > 0 { validations = append(validations, runApexElfCheckerUnwanted(ctx, unsignedOutputFile, a.properties.Unwanted_transitive_deps)) } - if !a.testApex && android.InList(a.payloadFsType, []fsType{ext4, erofs}) { + if !a.skipValidation(hostApexVerifier) && android.InList(a.payloadFsType, []fsType{ext4, erofs}) { validations = append(validations, runApexHostVerifier(ctx, a, unsignedOutputFile)) } ctx.Build(pctx, android.BuildParams{ @@ -1220,7 +1220,7 @@ func runApexLinkerconfigValidation(ctx android.ModuleContext, apexFile android.P // $ deapexer list -Z {apex_file} > {file_contexts} // $ apex_sepolicy_tests -f {file_contexts} func runApexSepolicyTests(ctx android.ModuleContext, apexFile android.Path) android.Path { - timestamp := android.PathForModuleOut(ctx, "sepolicy_tests.timestamp") + timestamp := android.PathForModuleOut(ctx, "apex_sepolicy_tests.timestamp") ctx.Build(pctx, android.BuildParams{ Rule: apexSepolicyTestsRule, Input: apexFile, -- cgit v1.2.3-59-g8ed1b