RFR: 8365863: /test/jdk/sun/security/pkcs11/Cipher tests skip without SkippedException [v4]
Weijun Wang
weijun at openjdk.org
Fri Aug 22 12:31:57 UTC 2025
On Fri, 22 Aug 2025 11:10:39 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
>> * cleanup
>> * changed tests hiding errors and skips to be different `@test`, so the errors could be thrown
>> * tests affected:
>> - /test/jdk/sun/security/pkcs11/Cipher/TestChaChaPoly.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestCipherMode.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestChaChaPolyNoReuse.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestChaChaPolyKAT.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestRSACipherWrap.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestChaChaPolyOutputSize.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestRSACipher.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java
>> - /test/jdk/sun/security/pkcs11/Cipher/ReinitCipher.java
>> - /test/jdk/sun/security/pkcs11/Cipher/TestRawRSACipher.java
>> - /test/jdk/sun/security/pkcs11/Cipher/Test4512704.java
>
> Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision:
>
> Changed tests from multiple to one with tracking skipped exception
test/jdk/sun/security/pkcs11/Cipher/TestCipherMode.java line 101:
> 99: // P11RSACipher
> 100: for (String t : TRANSFORMATIONS) {
> 101: checkModes(t, p);
Can we add the catch and set flag actions in this loop so there is no need to change the structure of the test? Something like this:
SkippedException skipped = null;
for (String t : TRANSFORMATIONS) {
try {
checkModes(t, p);
} catch (SkippedException se) {
se.printStackTrace();
skipped = se;
}
}
if (skipped != null) throw skipped;
else System.out.println("All tests passed");
test/jdk/sun/security/pkcs11/Cipher/TestSymmCiphers.java line 143:
> 141: cipher.init(mode, key, params);
> 142: int outLen = cipher.getOutputSize(in.length);
> 143: //debugOut("Estimated output size = " + outLen + "\n");
I usually do not want to comment out code. Maybe when this test fails one day, the author meant to uncomment them to debug the issue.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26875#discussion_r2293590708
PR Review Comment: https://git.openjdk.org/jdk/pull/26875#discussion_r2293600608
More information about the security-dev
mailing list