[jdk11u-dev] RFR: 8266182: Automate manual steps listed in the test jdk/sun/security/pkcs12/ParamsTest.java

Jonathan Dowland jdowland at openjdk.java.net
Tue Sep 21 12:57:24 UTC 2021


On Mon, 20 Sep 2021 09:46:33 GMT, Jonathan Dowland <jdowland at openjdk.org> wrote:

> Hello,
> 
> This pull request is a backport of commit https://github.com/openjdk/jdk/commit/ed57cf1cf3f2d107e085ecdae38a63e66ab2fa30 from openjdk/jdk,
> authored by Abdul Kolarkunnu and reviewed by hchao, ssahoo, xuelei, weijun.
> 
> The backport is not clean: 11u differs from newer JDKs in keytool defaults (see [JDK-8267599](https://bugs.openjdk.java.net/browse/JDK-8267599)), and the test needed adjusting to account for this in two places: 
> 
> 
> --- a/test/jdk/sun/security/pkcs12/KeytoolOpensslInteropTest.java
> +++ b/test/jdk/sun/security/pkcs12/KeytoolOpensslInteropTest.java
> @@ -456,7 +456,7 @@ public class KeytoolOpensslInteropTest {
>                  "pkcs12", "-in", "ksnormal", "-passin", "pass:changeit",
>                  "-info", "-nokeys", "-nocerts");
>          output1.shouldHaveExitValue(0)
> -            .shouldContain("MAC: sha256, Iteration 10000")
> +            .shouldContain("MAC: sha1, Iteration 100000")
>              .shouldContain("Shrouded Keybag: PBES2, PBKDF2, AES-256-CBC,"
>                      + " Iteration 10000, PRF hmacWithSHA256")
>              .shouldContain("PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC,"
> @@ -499,7 +499,7 @@ public class KeytoolOpensslInteropTest {
>                  "ksnewic", "-passin", "pass:changeit", "-info", "-nokeys",
>                  "-nocerts");
>          output1.shouldHaveExitValue(0)
> -            .shouldContain("MAC: sha256, Iteration 5555")
> +            .shouldContain("MAC: sha1, Iteration 5555")
>              .shouldContain("Shrouded Keybag: PBES2, PBKDF2, AES-256-CBC,"
>                      + " Iteration 7777, PRF hmacWithSHA256")
>              .shouldContain("Shrouded Keybag: pbeWithSHA1And128BitRC4,"
> 
> 
> The test in this PR passes for 11u.
> 
> (I will immediately begin on the related backport [JDK-8272581](https://bugs.openjdk.java.net/browse/JDK-8272581))

I've taken a look at JDK-8180571 which is in scope for backporting and will resolve this issue by deleting those two shell tests, however it's not a trivial backport. In the meantime I've force-pushed the following two line fix to those shell tests for 8266182. This gets them passing again. Please let me know what you think.


--- a/test/jdk/sun/security/pkcs11/Provider/ConfigQuotedString.sh
+++ b/test/jdk/sun/security/pkcs11/Provider/ConfigQuotedString.sh
@@ -104,7 +104,7 @@ esac
 # compile test
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-        -classpath ${TESTSRC}${FS}.. \
+        -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
         ${TESTSRC}${FS}ConfigQuotedString.java \
diff --git a/test/jdk/sun/security/pkcs11/Provider/Login.sh b/test/jdk/sun/security/pkcs11/Provider/Login.sh
index 53be7bb61e7..2f942d66ce9 100644
--- a/test/jdk/sun/security/pkcs11/Provider/Login.sh
+++ b/test/jdk/sun/security/pkcs11/Provider/Login.sh
@@ -113,7 +113,7 @@ ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
 # compile test
 
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-        -classpath ${TESTSRC}${FS}.. \
+        -classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
         ${TESTSRC}${FS}Login.java \

-------------

PR: https://git.openjdk.java.net/jdk11u-dev/pull/376


More information about the jdk-updates-dev mailing list