Skip to content

Commit

Permalink
rename property names, add an example
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed Nov 1, 2024
1 parent 1f6126f commit 9b04ea1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/jdk/sun/security/provider/acvp/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
public class Launcher {

private static final String ONLY_ALG
= System.getProperty("acvp.test.alg");
= System.getProperty("test.acvp.alg");

private static final Provider PROVIDER;

static {
var provProp = System.getProperty("acvp.test.provider");
var provProp = System.getProperty("test.acvp.provider");
PROVIDER = provProp != null
? Security.getProvider(provProp)
: null;
Expand All @@ -52,25 +52,32 @@ public static void main(String[] args) throws Exception {
// by NIST's ACVP Server. See https://github.com/usnistgov/ACVP-Server.
//
// The files are either put into the "data" directory or another
// directory specified by the "acvp.test.data" system property.
// directory specified by the "test.acvp.data" test property.
// The test walks through the directory recursively and looks for
// file names equals to or ending with "internalProjection.json" and
// runs test on them.
//
// Set the "acvp.test.alg" system property to only test this algorithm.
// Set the "test.acvp.alg" test property to only test this algorithm.
//
// Sample files can be downloaded from
// https://github.com/usnistgov/ACVP-Server/tree/master/gen-val/json-files.
//
// By default, the test uses system-preferred implementations.
// If you want to test on a specific provider, set the
// "acvp.test.provider" system property. The provider must be
// "test.acvp.provider" test property. The provider must be
// registered.
//
// Tests for each algorithm must be compliant to its specification linked from
// https://github.com/usnistgov/ACVP?tab=readme-ov-file#supported-algorithms.
//
// Example:
//
// jtreg -Dtest.acvp.provider=SunJCE \
// -Dtest.acvp.alg=ML-KEM \
// -Dtest.acvp.data=/path/to/json-files/ \
// -jdk:/path/to/jdk Launcher.java

var testDataProp = System.getProperty("acvp.test.data");
var testDataProp = System.getProperty("test.acvp.data");
Path dataPath = testDataProp != null
? Path.of(testDataProp)
: Path.of(System.getProperty("test.src"), "data");
Expand Down

0 comments on commit 9b04ea1

Please sign in to comment.