From b02d89967e9a62dbdf205a758683a2c1af972c94 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Mon, 20 Aug 2018 16:54:46 +0100 Subject: [PATCH] Use /dev/urandom for tests. --- .gitlab-ci.yml | 4 ++-- bramble-android/build.gradle | 5 +++++ bramble-api/build.gradle | 5 +++++ bramble-core/build.gradle | 5 +++++ bramble-j2se/build.gradle | 2 ++ briar-android/build.gradle | 5 ++++- briar-api/build.gradle | 5 +++++ briar-core/build.gradle | 7 +++---- .../briar/introduction/IntroductionIntegrationTest.java | 2 -- 9 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91e7b8462..2256a2f1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,8 @@ test: - .gradle/caches script: - - ./gradlew --no-daemon animalSnifferMain animalSnifferTest - - ./gradlew --no-daemon briar-core:test + - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest + - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom test after_script: # these file change every time but should not be cached diff --git a/bramble-android/build.gradle b/bramble-android/build.gradle index 09129b5a6..56e36842b 100644 --- a/bramble-android/build.gradle +++ b/bramble-android/build.gradle @@ -55,3 +55,8 @@ project.afterEvaluate { into 'src/main/res/raw' } } + +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') +} diff --git a/bramble-api/build.gradle b/bramble-api/build.gradle index fc1634e8c..520d5bf88 100644 --- a/bramble-api/build.gradle +++ b/bramble-api/build.gradle @@ -31,3 +31,8 @@ task jarTest(type: Jar, dependsOn: testClasses) { artifacts { testOutput jarTest } + +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') +} diff --git a/bramble-core/build.gradle b/bramble-core/build.gradle index 1a5e234b9..eec6c4387 100644 --- a/bramble-core/build.gradle +++ b/bramble-core/build.gradle @@ -44,3 +44,8 @@ task jarTest(type: Jar, dependsOn: testClasses) { artifacts { testOutput jarTest } + +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') +} diff --git a/bramble-j2se/build.gradle b/bramble-j2se/build.gradle index 405795bb4..e77258601 100644 --- a/bramble-j2se/build.gradle +++ b/bramble-j2se/build.gradle @@ -26,5 +26,7 @@ dependencies { } tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') systemProperty 'java.library.path', 'libs' } diff --git a/briar-android/build.gradle b/briar-android/build.gradle index 152fe1708..d5836587d 100644 --- a/briar-android/build.gradle +++ b/briar-android/build.gradle @@ -186,4 +186,7 @@ project.afterEvaluate { preBuild.dependsOn.add(verifyTranslations) } - +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') +} diff --git a/briar-api/build.gradle b/briar-api/build.gradle index 6331e5edd..e5f288e55 100644 --- a/briar-api/build.gradle +++ b/briar-api/build.gradle @@ -11,3 +11,8 @@ dependencies { signature 'org.codehaus.mojo.signature:java16:1.1@signature' } + +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') +} diff --git a/briar-core/build.gradle b/briar-core/build.gradle index e12e0c9f6..6fb4231dc 100644 --- a/briar-core/build.gradle +++ b/briar-core/build.gradle @@ -33,8 +33,7 @@ dependencies { signature 'org.codehaus.mojo.signature:java16:1.1@signature' } -test { - testLogging { - events "passed", "skipped", "failed", "standardOut", "standardError" - } +tasks.withType(Test) { + // Use entropy-gathering device specified on command line, if any + systemProperty 'java.security.egd', System.getProperty('java.security.egd') } diff --git a/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java b/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java index 96d75f5e0..b3161af64 100644 --- a/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java +++ b/briar-core/src/test/java/org/briarproject/briar/introduction/IntroductionIntegrationTest.java @@ -34,7 +34,6 @@ import org.briarproject.briar.api.introduction.event.IntroductionResponseReceive import org.briarproject.briar.api.introduction.event.IntroductionSucceededEvent; import org.briarproject.briar.test.BriarIntegrationTest; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -71,7 +70,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -@Ignore public class IntroductionIntegrationTest extends BriarIntegrationTest {