Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@ sun/security/smartcardio/TestTransmit.java 8039280 generic-

sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le

sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java 8370852 generic-all

############################################################################

# jdk_sound
Expand Down
59 changes: 34 additions & 25 deletions test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* @test
* @bug 8350582 8340312
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no bug ID should be inserted for test only fixes (AFAIK)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I didn't put the current bug ID (test only one), only the product bug id which caused the error to occur. So I believe it's justified in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see - yes, that seems fine then

* @bug 8350582 8340312 8369995
* @library /test/lib /javax/net/ssl/templates
* @summary Correct the parsing of the ssl value in javax.net.debug
* @run junit DebugPropertyValuesTest
Expand All @@ -50,24 +50,27 @@
public class DebugPropertyValuesTest extends SSLSocketTemplate {

private static final Path LOG_FILE = Path.of("logging.conf");
private static final HashMap<String, List<String>> debugMessages = new HashMap<>();
private static final HashMap<String, List<String>> debugMessages =
new HashMap<>();
private static final String DATE_REGEX = "\\d{4}-\\d{2}-\\d{2}";

static {


debugMessages.put("handshake",
List.of("Produced ClientHello handshake message",
"supported_versions"));
debugMessages.put("keymanager", List.of("choosing key:"));
debugMessages.put("keymanager", List.of("Choosing key:"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what caused the test to fail? everything else looks like formatting changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was changed in JDK-8369995

debugMessages.put("packet", List.of("Raw write"));
debugMessages.put("plaintext", List.of("Plaintext before ENCRYPTION"));
debugMessages.put("plaintext",
List.of("Plaintext before ENCRYPTION"));
debugMessages.put("record", List.of("handshake, length =", "WRITE:"));
debugMessages.put("session", List.of("Session initialized:"));
debugMessages.put("sslctx", List.of("trigger seeding of SecureRandom"));
debugMessages.put("sslctx",
List.of("trigger seeding of SecureRandom"));
debugMessages.put("ssl", List.of("jdk.tls.keyLimits:"));
debugMessages.put("trustmanager", List.of("adding as trusted certificates"));
debugMessages.put("verbose", List.of("Ignore unsupported cipher suite:"));
debugMessages.put("trustmanager",
List.of("adding as trusted certificates"));
debugMessages.put("verbose",
List.of("Ignore unsupported cipher suite:"));
debugMessages.put("handshake-expand",
List.of("\"logger\".*: \"javax.net.ssl\",",
"\"specifics\" : \\[",
Expand Down Expand Up @@ -114,15 +117,18 @@ private static Stream<Arguments> patternMatches() {
"record", "session", "ssl",
"sslctx", "trustmanager", "verbose")),
// allow expand option for more verbose output
Arguments.of(List.of("-Djavax.net.debug=ssl,handshake,expand"),
List.of("handshake", "handshake-expand", "keymanager",
"record", "session", "record-expand", "ssl",
"sslctx", "trustmanager", "verbose")),
Arguments.of(
List.of("-Djavax.net.debug=ssl,handshake,expand"),
List.of("handshake", "handshake-expand",
"keymanager", "record", "session",
"record-expand", "ssl", "sslctx",
"trustmanager", "verbose")),
// filtering on record option, with expand
Arguments.of(List.of("-Djavax.net.debug=ssl:record,expand"),
List.of("handshake", "handshake-expand", "keymanager",
"record", "record-expand", "session", "ssl",
"sslctx", "trustmanager", "verbose")),
List.of("handshake", "handshake-expand",
"keymanager", "record", "record-expand",
"session", "ssl", "sslctx", "trustmanager",
"verbose")),
// this test is equivalent to ssl:record mode
Arguments.of(List.of("-Djavax.net.debug=ssl,record"),
List.of("handshake", "keymanager", "record",
Expand All @@ -147,30 +153,33 @@ private static Stream<Arguments> patternMatches() {
"record", "session", "ssl",
"sslctx", "trustmanager", "verbose")),
// plaintext is valid for record option
Arguments.of(List.of("-Djavax.net.debug=ssl:record:plaintext"),
Arguments.of(
List.of("-Djavax.net.debug=ssl:record:plaintext"),
List.of("handshake", "keymanager", "plaintext",
"record", "session", "ssl",
"sslctx", "trustmanager", "verbose")),
Arguments.of(List.of("-Djavax.net.debug=ssl:trustmanager"),
List.of("handshake", "keymanager", "record", "session",
"ssl", "sslctx", "trustmanager", "verbose")),
List.of("handshake", "keymanager", "record",
"session", "ssl", "sslctx", "trustmanager",
"verbose")),
Arguments.of(List.of("-Djavax.net.debug=ssl:sslctx"),
List.of("handshake", "keymanager", "record", "session",
"ssl", "sslctx", "trustmanager", "verbose")),
List.of("handshake", "keymanager", "record",
"session", "ssl", "sslctx", "trustmanager",
"verbose")),
// help message test. Should exit without running test
Arguments.of(List.of("-Djavax.net.debug=help"),
List.of("help")),
// add in javax.net.debug sanity test
Arguments.of(List.of("-Djavax.net.debug=ssl:trustmanager",
"-Djava.security.debug=all"),
List.of("handshake", "java.security.debug", "keymanager",
"record", "session", "ssl", "sslctx",
"trustmanager", "verbose")),
List.of("handshake", "java.security.debug",
"keymanager", "record", "session", "ssl",
"sslctx", "trustmanager", "verbose")),
// empty invokes System.Logger use
Arguments.of(List.of("-Djavax.net.debug",
"-Djava.util.logging.config.file=" + LOG_FILE),
List.of("handshake", "javax.net.debug.logger",
"keymanager", "packet", "plaintext",
"keymanager", "packet", "plaintext",
"record", "session", "ssl",
"sslctx", "trustmanager", "verbose"))
);
Expand Down