Skip to content

JCA conformance harness: jtreg run + exclusions - #552

Closed
WillChilds-Klein wants to merge 2 commits into
corretto:mainfrom
WillChilds-Klein:jca-conformance-jtreg-run
Closed

JCA conformance harness: jtreg run + exclusions#552
WillChilds-Klein wants to merge 2 commits into
corretto:mainfrom
WillChilds-Klein:jca-conformance-jtreg-run

Conversation

@WillChilds-Klein

Copy link
Copy Markdown
Contributor

Summary

Second of two PRs for #550, stacked on #551. Turns the scaffolding into a working conformance run against ACCP and switches CI to it.

Note

Stacked on #551 (branch-1 scaffolding). Until #551 merges, this PR's diff includes the scaffolding commit too; review #551 first. Once #551 merges to main, this collapses to just the --full delta.

Harness (run-jtreg.sh --full)

  • Builds jtreg from source at the tag pinned in jtreg-version.txt (openjdk/jtreg). No third-party prebuilt binaries.
  • Sparse-checks-out the OpenJDK test content for the JDK under test from a pinned per-version GA tag (jdk-tags.txt), via partial (--filter=blob:none) + sparse + shallow clone — only the crypto subtrees + jtreg support dirs (test/lib, test/jtreg-ext), not the whole JDK source (~226 MB vs multi-GB). Per-version pins because the test set differs by JDK version.
  • Installs ACCP at provider priority 1 via a renumbered java.security override (ACCP at 1, JDK defaults shifted to 2..N+1).

Why renumber rather than security.provider.1=ACCP

A bare security.provider.1=ACCP overwrites slot 1 (the SUN provider), evicting it — which breaks JDK-internal SecureRandom bootstrap with InternalError: SHA-1 not available (ACCP doesn't register SUN's legacy SHA/SHA1 alias) and fails nearly every test. Renumbering keeps every default present so legacy aliases fall through to SUN. This was the main harness bug found and fixed while bringing the run up.

Seeded exclusions

All triaged as not ACCP algorithm-conformance issues:

  • common.txt: DefaultProviderList, Versions, SecurityProviderModularTest — meta-tests asserting the JDK's exact default provider set, which ACCP intentionally perturbs by installing at priority 1.
  • jdk21.txt: CryptoPermissions/InconsistentEntries — writes a policy file into the read-only JDK install dir (AccessDeniedException); environmental, would fail the same against SunJCE.

Each entry carries a rationale comment per the exclusion model.

Results against ACCP (local)

JDK passed excluded exit
17 533 3 0
21 567 4 0

Workflow

jca-conformance.yml now runs --full on the JDK 17/21 matrix and uploads the jtreg report as a CI artifact.

Test plan

  • shellcheck clean
  • JDK17 full run green (533 passed, 3 excluded)
  • JDK21 full run green (567 passed, 4 excluded)
  • CI: full job green on JDK 17 and 21

Tracking: #550

First branch of issue corretto#550. Wires up a harness for running the JDK's
own jtreg crypto conformance tests against ACCP, to catch behavioral
divergence from the JDK-default providers (SunJCE, SunEC, SunRsaSign).

This commit lands the scaffolding only:

- tests/jca-conformance/run-jtreg.sh: driver script. Runs in --smoke
  mode by default, validating that ACCP installs as the highest-priority
  provider under the JDK under test and that the config files parse. The
  --full mode (real OpenJDK test-tree checkout + jtreg run) is a
  placeholder delivered in branch 2.

- tests/jca-conformance/jtreg-test-roots.txt: the JCA-relevant test/jdk
  subtrees to run (ciphers, Mac, Signature, KeyFactory, EC/RSA, etc.),
  excluding areas ACCP does not implement (TLS/JSSE, PKCS#11, Kerberos).

- tests/jca-conformance/exclusions/{common,jdk17,jdk21}.txt: per-JDK
  exclusion lists, empty to start. A failing test gets an entry here
  (with a required rationale comment linking DIFFERENCES.md or an issue)
  so CI stays green while the divergence backlog stays explicit.

- tests/jca-conformance/README.md: design, exclusion model, JCK note.

- .github/workflows/jca-conformance.yml: GHA job, matrix JDK 17/21,
  builds ACCP and runs the harness in --smoke mode (non-gating wiring
  until branch 2 enables --full).

Tracking: corretto#550
Second branch of issue corretto#550. Turns the scaffolding into a working
conformance run and switches CI to it.

Harness (run-jtreg.sh --full):
- Builds jtreg from source at a pinned openjdk/jtreg tag
  (jtreg-version.txt). No third-party prebuilt binaries.
- Sparse-checks-out the OpenJDK test content for the JDK under test
  from a pinned per-version GA tag (jdk-tags.txt), using a partial +
  sparse + shallow clone so only the crypto test subtrees and the
  jtreg support dirs (test/lib, test/jtreg-ext) are pulled, not the
  whole JDK source tree. Per-version pins because the test set differs
  by JDK version.
- Installs ACCP at provider priority 1 by emitting a renumbered
  java.security override (ACCP at 1, JDK defaults shifted to 2..N+1).
  A bare security.provider.1=ACCP would OVERWRITE the SUN provider and
  break JDK-internal SecureRandom bootstrap (InternalError: SHA-1 not
  available, since ACCP doesn't register SUN's legacy SHA/SHA1 alias);
  renumbering keeps every default present so those aliases fall through.
- Runs jtreg over the configured roots minus the exclusion lists and
  exits nonzero on any non-excluded failure.

Config:
- jdk-tags.txt: openjdk/jdk17u@jdk-17.0.13-ga, openjdk/jdk21u@jdk-21.0.5-ga
- jtreg-version.txt: jtreg-7.5.1+1

Seeded exclusions (all triaged as non-ACCP-conformance issues):
- common.txt: DefaultProviderList, Versions, SecurityProviderModularTest
  -- meta-tests asserting the JDK's exact default provider set, which
  ACCP intentionally perturbs by installing at priority 1.
- jdk21.txt: CryptoPermissions/InconsistentEntries -- writes a policy
  file into the read-only JDK install dir (AccessDeniedException);
  environmental, would fail the same against SunJCE.

Local results against ACCP:
- JDK17: 533 passed, 3 excluded, exit 0.
- JDK21: 567 passed, 4 excluded, exit 0.

Workflow: jca-conformance.yml now runs --full on the JDK 17/21 matrix
and uploads the jtreg report as an artifact.

Tracking: corretto#550
@WillChilds-Klein WillChilds-Klein changed the title JCA conformance harness: jtreg run + exclusions (2/2) JCA conformance harness: jtreg run + exclusions Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.66%. Comparing base (2f28348) to head (91dd324).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #552      +/-   ##
============================================
+ Coverage     78.58%   78.66%   +0.07%     
- Complexity     1211     1213       +2     
============================================
  Files           127      127              
  Lines          7734     7734              
  Branches        981      981              
============================================
+ Hits           6078     6084       +6     
+ Misses         1126     1122       -4     
+ Partials        530      528       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@WillChilds-Klein

Copy link
Copy Markdown
Contributor Author

Superseded by #557 (top of stacked PR #558), stacked on #556. Recreated as a same-repo PR with base jca-conformance-scaffolding so GitHub can stack the two layers; the branch and commits are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant