Skip to content

Fix two broken AciTests cases and enable the suite in the default build#675

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/aci-tests
Jul 8, 2026
Merged

Fix two broken AciTests cases and enable the suite in the default build#675
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/aci-tests

Conversation

@vharseko

@vharseko vharseko commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

AciTests — the 515-test suite covering the whole dseecompat ACI machinery
(parsing, targets, bind rules, effective rights, proxy auth) — is in the
slow TestNG group, which the build excludes (excludegroups=slow in the
failsafe configuration). The suite therefore never runs in CI, and two
tests silently rotted. Found while validating #674 against the full suite.

The two failures

  1. testValidAcis declared this ACI valid:

    (targattrfilters="del=cn:(&(cn=foo)(cn=f*)) && 1sn_:(1sn_=joe*)")
    (version 3.0;acl "bad_ATTR_TYPE_NAME"; allow (write) userdn="ldap:///self";)
    

    The attribute name 1sn_ passes the deliberately lenient dseecompat
    ATTR_NAME pattern (Aci.java documents it as "graciously" matching
    names beginning with a letter or digit), but the filter part
    (1sn_=joe*) is parsed via the SDK's RFC 4512 AttributeDescription
    parser, where a token starting with a digit must be a numeric OID — so
    decoding fails ("invalid character 's' at position 1") and the ADD is
    rejected with result 21. Since no schema can define an attribute named
    1sn_", an ACI referencing it can never match anything; strict rejection is the correct behaviour, and the test case moves to the invalidAcis`
    provider (with a comment explaining why).

  2. testCompare expected the ldapcompare tool to exit with
    COMPARE_TRUE (6), but the toolkit tool returns 0 for a successful
    true comparison unless --useCompareResultCode is given. The test now
    passes the flag, so it again asserts the actual comparison result
    (TRUE → 6, FALSE → 5) rather than a generic success.

Enabling the suite

The groups="slow" marker is removed from the AciTests class-level
@Test annotation, so the suite runs in the default build. It adds ~34 s.
The pom-level excludegroups=slow is left untouched — the other ~40
slow-group classes (replication stress tests, quicksetup, etc.) are not
affected.

Testing

mvn -P precommit -pl opendj-server-legacy verify -Dit.test=AciTests with
the default configuration (no group overrides): 515 tests, 0 failures,
0 skipped, ~34 s
.

Files

  • opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/AciTests.java

AciTests (515 tests covering the dseecompat ACI machinery) is in the
"slow" TestNG group, which the build excludes, so the suite never ran
in CI and two tests silently rotted:

- testValidAcis declared an ACI with targattrfilters attribute "1sn_"
  valid. The name passes the deliberately lenient dseecompat ATTR_NAME
  pattern, but the filter part is now parsed as an RFC 4512 attribute
  description, where a leading digit means a numeric OID, so the ACI is
  rejected at decode time (result 21). No schema can define such an
  attribute, so strict rejection is correct: the case moves to the
  invalidAcis provider.

- testCompare expected the ldapcompare tool to exit with COMPARE_TRUE
  (6), but the tool returns 0 for a successful true comparison unless
  --useCompareResultCode is given. Pass the flag so the test asserts
  the actual comparison result again.

Remove the "slow" group from the AciTests class so the suite runs in
the default build (~34 s); other slow-group classes are unaffected.
@vharseko vharseko added tests Test suites: fixing, enabling, un-disabling ACI Access Control Instructions subsystem labels Jul 6, 2026
@vharseko vharseko merged commit 770c47d into OpenIdentityPlatform:master Jul 8, 2026
17 checks passed
@vharseko vharseko deleted the features/aci-tests branch July 8, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ACI Access Control Instructions subsystem bug CI tests Test suites: fixing, enabling, un-disabling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants