8157417: Some of SecureRandom test might get timed out in linux

Reviewed-by: weijun
This commit is contained in:
Sibabrata Sahoo 2016-05-20 09:57:01 -07:00
parent 4880e22424
commit ea82a852dd
4 changed files with 12 additions and 13 deletions

View File

@ -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,}) {

View File

@ -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 {

View File

@ -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;

View File

@ -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
*/