Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliult committed Dec 4, 2024
1 parent 014057a commit 74a1a74
Showing 1 changed file with 64 additions and 63 deletions.
127 changes: 64 additions & 63 deletions closed/test/jdk/openj9/internal/security/TestProviders.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,76 +47,76 @@ private static Stream<Arguments> patternMatches_expectedExitValue0() {
return Stream.of(
// Test strict profile provider list.
Arguments.of("TestBase.Version",
System.getProperty("test.src") + "/provider-java.security",
"(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunJSSE)"),
// Test default profile provider list.
Arguments.of("TestBase",
System.getProperty("test.src") + "/provider-java.security",
"(?s)(?=.*Sun)(?=.*SunRsaSign)(?=.*SunEC)(?=.*SunJSSE)"
+ "(?=.*SunJCE)(?=.*SunJGSS)(?=.*SunSASL)"
+ "(?=.*XMLDSig)(?=.*SunPCSC)(?=.*JdkLDAP)(?=.*JdkSASL)"),
// Test extended profile provider list.
Arguments.of("TestBase.Version-Extended",
System.getProperty("test.src") + "/provider-java.security",
"(?s)(?=.*Sun)(?=.*SunRsaSign)(?=.*SunEC)(?=.*SunJSSE)"
+ "(?=.*SunJCE)(?=.*SunJGSS)(?=.*SunSASL)"
+ "(?=.*XMLDSig)(?=.*SunPCSC)(?=.*JdkLDAP)(?=.*JdkSASL)"),
// Test update provider list with value.
Arguments.of("Test-Profile.Updated_1",
System.getProperty("test.src") + "/provider-java.security",
"(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunSASL)"),
// Test update provider list with null.
Arguments.of("Test-Profile.Updated_2",
System.getProperty("test.src") + "/provider-java.security",
"(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunJSSE)")
// // Test default profile provider list.
// Arguments.of("TestBase",
// System.getProperty("test.src") + "/provider-java.security",
// "(?s)(?=.*Sun)(?=.*SunRsaSign)(?=.*SunEC)(?=.*SunJSSE)"
// + "(?=.*SunJCE)(?=.*SunJGSS)(?=.*SunSASL)"
// + "(?=.*XMLDSig)(?=.*SunPCSC)(?=.*JdkLDAP)(?=.*JdkSASL)"),
// // Test extended profile provider list.
// Arguments.of("TestBase.Version-Extended",
// System.getProperty("test.src") + "/provider-java.security",
// "(?s)(?=.*Sun)(?=.*SunRsaSign)(?=.*SunEC)(?=.*SunJSSE)"
// + "(?=.*SunJCE)(?=.*SunJGSS)(?=.*SunSASL)"
// + "(?=.*XMLDSig)(?=.*SunPCSC)(?=.*JdkLDAP)(?=.*JdkSASL)"),
// // Test update provider list with value.
// Arguments.of("Test-Profile.Updated_1",
// System.getProperty("test.src") + "/provider-java.security",
// "(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunSASL)"),
// // Test update provider list with null.
// Arguments.of("Test-Profile.Updated_2",
// System.getProperty("test.src") + "/provider-java.security",
// "(?s)(?=.*Sun)(?=.*\\bSunJCE\\b)(?=.*SunJSSE)")
);
}

private static Stream<Arguments> patternMatches_expectedExitValue1() {
return Stream.of(
// Test base profile - provider order numbers are not consecutive.
Arguments.of("Test-Profile.Base",
System.getProperty("test.src") + "/provider-java.security",
"The order numbers of providers in profile RestrictedSecurity.Test-Profile.Base "
+ "\\(or a base profile\\) are not consecutive"),
// Test extended profile, provider order numbers are not consecutive.
Arguments.of("Test-Profile.Extended_1",
System.getProperty("test.src") + "/provider-java.security",
"The order numbers of providers in profile RestrictedSecurity.Test-Profile.Extended_1 "
+ "\\(or a base profile\\) are not consecutive."),
// Test extended profile from another extended profile, provider order numbers are not consecutive.
Arguments.of("Test-Profile.Extended_2",
System.getProperty("test.src") + "/provider-java.security",
"The order numbers of providers in profile RestrictedSecurity.Test-Profile.Extended_2 "
+ "\\(or a base profile\\) are not consecutive."),
// Test update provider list with empty, the empty is the last one in base profile.
Arguments.of("Test-Profile.Updated_3",
System.getProperty("test.src") + "/provider-java.security",
"Cannot add a provider in position \\d+ after removing the ones in previous positions"),
// Test update provider list with empty, the empty is NOT the last one in base profile.
Arguments.of("Test-Profile.Updated_4",
System.getProperty("test.src") + "/provider-java.security",
"Cannot specify an empty provider in position \\d+ when non-empty ones are specified after it"),
// Test base profile - one of the provider in list empty.
Arguments.of("Test-Profile.BaseOneProviderEmpty",
System.getProperty("test.src") + "/provider-java.security",
"Cannot specify an empty provider in position \\d+. Nothing specified before"),
// Test extended profile - one of the provider in list empty.
Arguments.of("Test-Profile.ExtendedOneProviderEmpty",
System.getProperty("test.src") + "/provider-java.security",
"Cannot specify an empty provider in position \\d+. Nothing specified before"),
// Test base profile - no provider list.
Arguments.of("Test-Profile.BaseNoProviderList",
System.getProperty("test.src") + "/provider-java.security",
"No providers are specified as part of the Restricted Security profile"),
// Test profile - provider must be specified using the fully-qualified class name.
Arguments.of("Test-Profile.ProviderClassName",
System.getProperty("test.src") + "/provider-java.security",
"Provider must be specified using the fully-qualified class name"),
// Test profile - provider format is incorrect.
Arguments.of("Test-Profile.ProviderFormat",
System.getProperty("test.src") + "/provider-java.security",
"Provider format is incorrect")
// // Test base profile - provider order numbers are not consecutive.
// Arguments.of("Test-Profile.Base",
// System.getProperty("test.src") + "/provider-java.security",
// "The order numbers of providers in profile RestrictedSecurity.Test-Profile.Base "
// + "\\(or a base profile\\) are not consecutive"),
// // Test extended profile, provider order numbers are not consecutive.
// Arguments.of("Test-Profile.Extended_1",
// System.getProperty("test.src") + "/provider-java.security",
// "The order numbers of providers in profile RestrictedSecurity.Test-Profile.Extended_1 "
// + "\\(or a base profile\\) are not consecutive."),
// // Test extended profile from another extended profile, provider order numbers are not consecutive.
// Arguments.of("Test-Profile.Extended_2",
// System.getProperty("test.src") + "/provider-java.security",
// "The order numbers of providers in profile RestrictedSecurity.Test-Profile.Extended_2 "
// + "\\(or a base profile\\) are not consecutive."),
// // Test update provider list with empty, the empty is the last one in base profile.
// Arguments.of("Test-Profile.Updated_3",
// System.getProperty("test.src") + "/provider-java.security",
// "Cannot add a provider in position \\d+ after removing the ones in previous positions"),
// // Test update provider list with empty, the empty is NOT the last one in base profile.
// Arguments.of("Test-Profile.Updated_4",
// System.getProperty("test.src") + "/provider-java.security",
// "Cannot specify an empty provider in position \\d+ when non-empty ones are specified after it"),
// // Test base profile - one of the provider in list empty.
// Arguments.of("Test-Profile.BaseOneProviderEmpty",
// System.getProperty("test.src") + "/provider-java.security",
// "Cannot specify an empty provider in position \\d+. Nothing specified before"),
// // Test extended profile - one of the provider in list empty.
// Arguments.of("Test-Profile.ExtendedOneProviderEmpty",
// System.getProperty("test.src") + "/provider-java.security",
// "Cannot specify an empty provider in position \\d+. Nothing specified before"),
// // Test base profile - no provider list.
// Arguments.of("Test-Profile.BaseNoProviderList",
// System.getProperty("test.src") + "/provider-java.security",
// "No providers are specified as part of the Restricted Security profile"),
// // Test profile - provider must be specified using the fully-qualified class name.
// Arguments.of("Test-Profile.ProviderClassName",
// System.getProperty("test.src") + "/provider-java.security",
// "Provider must be specified using the fully-qualified class name"),
// // Test profile - provider format is incorrect.
// Arguments.of("Test-Profile.ProviderFormat",
// System.getProperty("test.src") + "/provider-java.security",
// "Provider format is incorrect")
);
}

Expand All @@ -127,6 +127,7 @@ public void shouldContain_expectedExitValue0(String customprofile, String securi
"-Dsemeru.fips=true",
"-Dsemeru.customprofile=" + customprofile,
"-Djava.security.properties=" + securityPropertyFile,
"-Djava.security.debug=semerufips",
"TestProviders"
);
outputAnalyzer.reportDiagnosticSummary();
Expand Down

0 comments on commit 74a1a74

Please sign in to comment.