Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266182: Automate manual steps listed in the test jdk/sun/security/pkcs12/ParamsTest.java #376

Closed
wants to merge 1 commit into from

Conversation

jmtd
Copy link

@jmtd jmtd commented Sep 20, 2021

Hello,

This pull request is a backport of commit openjdk/jdk@ed57cf1 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), 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)


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8266182: Automate manual steps listed in the test jdk/sun/security/pkcs12/ParamsTest.java

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk11u-dev pull/376/head:pull/376
$ git checkout pull/376

Update a local copy of the PR:
$ git checkout pull/376
$ git pull https://git.openjdk.java.net/jdk11u-dev pull/376/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 376

View PR using the GUI difftool:
$ git pr show -t 376

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk11u-dev/pull/376.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 20, 2021

👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@jmtd jmtd changed the title Backport 9248bd08cf6d16aca27ea1b00506736fc0544070 Backport ed57cf1cf3f2d107e085ecdae38a63e66ab2fa30 Sep 20, 2021
@openjdk openjdk bot changed the title Backport ed57cf1cf3f2d107e085ecdae38a63e66ab2fa30 8266182: Automate manual steps listed in the test jdk/sun/security/pkcs12/ParamsTest.java Sep 20, 2021
@openjdk
Copy link

openjdk bot commented Sep 20, 2021

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Sep 20, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 20, 2021

Webrevs

@mlbridge
Copy link

mlbridge bot commented Sep 20, 2021

Mailing list message from Jonathan Dowland on jdk-updates-dev:

Hi folks,

after 8266182 is merged, in theory JDK-8272581 should be considered very
shortly afterwards

https://bugs.openjdk.java.net/browse/JDK-8272581
"sun/security/pkcs11/Provider/MultipleLogins.sh fails after JDK-8266182"

Upstream, merging 8266182 broke MultipleLogins.sh, and 8272581 fixes it.

In my testing for jdk11u-dev, however, MultipleLogins.sh passes both
prior to and after merging 8266182. So strictly I don't think 8272581
needs to be backported to 11u, except that the test *should* have
broke, and something else is amiss.

--
???? Jonathan Dowland <jdowland at redhat.com>
Senior Software Engineer, OpenJDK, Red Hat

Copy link
Member

@GoeLin GoeLin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for downporting!

@openjdk
Copy link

openjdk bot commented Sep 21, 2021

@jmtd This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8266182: Automate manual steps listed in the test jdk/sun/security/pkcs12/ParamsTest.java

Reviewed-by: goetz, clanger

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 11 new commits pushed to the master branch:

  • 28dec4f: 8223139: Rename mandatory policy-do routines.
  • e1cbfa5: 8248187: [TESTBUG] javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java fails with String is not properly drawn
  • 6a784d2: 8143021: [TEST_BUG] Test javax/swing/JColorChooser/Test6541987.java fails
  • 09ad2c0: 8256152: tests fail because of ambiguous method resolution
  • 2990ff0: 8211171: move JarUtils to top-level testlibrary
  • f7a75de: 8265524: Upgrading JSZip from v3.2.2 to v3.6.0
  • 9f8c13c: 8233569: [TESTBUG] JTextComponent test bug6361367.java fails on macos
  • a6ee356: 8234823: java/net/Socket/Timeouts.java testcase testTimedConnect2() fails on Windows 10
  • 23c3845: 8229935: [TEST_BUG]: bug8132119.java inconsistently positions text
  • ed98060: 8223137: Rename predicate 'do_unroll_only()' to 'is_unroll_only()'.
  • ... and 1 more: https://git.openjdk.java.net/jdk11u-dev/compare/b9f01439e9277be2b990ed3bfc513a05651c3c29...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@GoeLin, @RealCLanger) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 21, 2021
@RealCLanger
Copy link
Contributor

RealCLanger commented Sep 21, 2021

Hi, we tested the PR and looks like we're seeing failures in these tests because OpensslArtifactFetcher.java does not compile:
sun/security/pkcs11/Provider/ConfigQuotedString.sh
sun/security/pkcs11/Provider/Login.sh

@jmtd
Copy link
Author

jmtd commented Sep 21, 2021

@RealCLanger thanks for catching these.
Both of those shell script tests are rewritten to Java tests in https://bugs.openjdk.java.net/browse/JDK-8180571 , which was backported to 11.0.13-oracle. I'll see if backporting resolves this issue.

@jmtd
Copy link
Author

jmtd commented Sep 21, 2021

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 \

@RealCLanger
Copy link
Contributor

I would prefer if JDK-8180571 could be backported first. It was done for 11.0.13-oracle anyway, so we should get to it soon. Let's defer this one until after the JDK-8180571 backport.

@jmtd
Copy link
Author

jmtd commented Sep 22, 2021

@RealCLanger:

I would prefer if JDK-8180571 could be backported first. It was done for 11.0.13-oracle anyway, so we should get to it soon. Let's defer this one until after the JDK-8180571 backport.

Sure ok. I've started work on that one.

@RealCLanger
Copy link
Contributor

@jmtd Now, after JDK-8180571 was merged, is this one good to go as well? Does it need rebasing?

@jmtd
Copy link
Author

jmtd commented Sep 30, 2021

@jmtd Now, after JDK-8180571 was merged, is this one good to go as well? Does it need rebasing?

I think rebasing is necessary, yes: I've just pushed a rebase.

@jmtd
Copy link
Author

jmtd commented Sep 30, 2021

GHA tests re-running of course but in the meantime I ran jtreg on the tests this patch touches as well as 8180571, 7/7 passed.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

OK, I found a small nit. There's one bug id that shouldn't be mentioned in 11. Other than that, I'll run it through SAP's testing tonight and will let you know the results tomorrow.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

Looks good. SAP tests show no regressions.

@jmtd
Copy link
Author

jmtd commented Oct 2, 2021

/integrate

@RealCLanger
Copy link
Contributor

/sponsor

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@jmtd
Your change (at version a560f63) is now ready to be sponsored by a Committer.

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

Going to push as commit f12af7e.
Since your change was applied there have been 11 commits pushed to the master branch:

  • 28dec4f: 8223139: Rename mandatory policy-do routines.
  • e1cbfa5: 8248187: [TESTBUG] javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java fails with String is not properly drawn
  • 6a784d2: 8143021: [TEST_BUG] Test javax/swing/JColorChooser/Test6541987.java fails
  • 09ad2c0: 8256152: tests fail because of ambiguous method resolution
  • 2990ff0: 8211171: move JarUtils to top-level testlibrary
  • f7a75de: 8265524: Upgrading JSZip from v3.2.2 to v3.6.0
  • 9f8c13c: 8233569: [TESTBUG] JTextComponent test bug6361367.java fails on macos
  • a6ee356: 8234823: java/net/Socket/Timeouts.java testcase testTimedConnect2() fails on Windows 10
  • 23c3845: 8229935: [TEST_BUG]: bug8132119.java inconsistently positions text
  • ed98060: 8223137: Rename predicate 'do_unroll_only()' to 'is_unroll_only()'.
  • ... and 1 more: https://git.openjdk.java.net/jdk11u-dev/compare/b9f01439e9277be2b990ed3bfc513a05651c3c29...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 4, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@RealCLanger @jmtd Pushed as commit f12af7e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
3 participants