8157417: Some of SecureRandom test might get timed out in linux
Reviewed-by: weijun
This commit is contained in:
parent
4880e22424
commit
ea82a852dd
@ -36,12 +36,9 @@ import java.security.NoSuchProviderException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.SecureRandomParameters;
|
||||
import java.security.DrbgParameters;
|
||||
|
||||
import static java.security.DrbgParameters.Capability.*;
|
||||
|
||||
import java.security.Security;
|
||||
import java.util.Arrays;
|
||||
|
||||
import jdk.testlibrary.Asserts;
|
||||
|
||||
public class GetInstanceTest {
|
||||
@ -77,13 +74,16 @@ public class GetInstanceTest {
|
||||
+ "strong algorithm through security Property: "
|
||||
+ "'securerandom.strongAlgorithms'.");
|
||||
}
|
||||
Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:SUN");
|
||||
sr = matchExc(() -> SecureRandom.getInstanceStrong(),
|
||||
PASS, NoSuchAlgorithmException.class,
|
||||
"PASS - Undefined security Property "
|
||||
+ "'securerandom.strongAlgorithms'");
|
||||
checkAttributes(sr, "DRBG");
|
||||
Security.setProperty(STRONG_ALG_SEC_PROP, origDRBGConfig);
|
||||
try {
|
||||
Security.setProperty(STRONG_ALG_SEC_PROP, "DRBG:SUN");
|
||||
sr = matchExc(() -> SecureRandom.getInstanceStrong(),
|
||||
PASS, NoSuchAlgorithmException.class,
|
||||
"PASS - Undefined security Property "
|
||||
+ "'securerandom.strongAlgorithms'");
|
||||
checkAttributes(sr, "DRBG");
|
||||
} finally {
|
||||
Security.setProperty(STRONG_ALG_SEC_PROP, origDRBGConfig);
|
||||
}
|
||||
|
||||
for (String mech : new String[]{
|
||||
"SHA1PRNG", "Hash_DRBG", "HMAC_DRBG", "CTR_DRBG", INVALID_ALGO,}) {
|
||||
|
@ -41,7 +41,7 @@ import static java.lang.Math.*;
|
||||
* @library /lib/testlibrary
|
||||
* @summary Test behavior of a shared SecureRandom object when it is operated
|
||||
* by multiple threads concurrently.
|
||||
* @run main MultiThreadTest
|
||||
* @run main/othervm -Djava.security.egd=file:/dev/urandom MultiThreadTest
|
||||
*/
|
||||
public class MultiThreadTest {
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
* as well from it's serialized instance in the same time then the
|
||||
* generated random numbers should be different when one or both are
|
||||
* reseeded.
|
||||
* @run main SerializedSeedTest
|
||||
* @run main/othervm -Djava.security.egd=file:/dev/urandom SerializedSeedTest
|
||||
*/
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @bug 6998583 8141039
|
||||
* @summary NativeSeedGenerator is making 8192 byte read requests from
|
||||
* entropy pool on each init.
|
||||
* @run main SeedGeneratorChoice
|
||||
* @run main/othervm -Djava.security.egd=file:/dev/random SeedGeneratorChoice
|
||||
* @run main/othervm -Djava.security.egd=file:filename SeedGeneratorChoice
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user