SingleFeatureTest java.security.egd /dev/urandom 27/50327/1
authorMichael Vorburger <vorburger@redhat.com>
Wed, 11 Jan 2017 22:49:23 +0000 (23:49 +0100)
committerMichael Vorburger <vorburger@redhat.com>
Wed, 11 Jan 2017 22:49:23 +0000 (23:49 +0100)
This prevents SingleFeatureTest getting blocked on Karaf start-up e.g.
in netconf/features/netconf-connector which I just ran into on a build
server, due to very low entropy (cat
/proc/sys/kernel/random/entropy_avail); it was like 40 or so.

Bug: 6790
Change-Id: Iad71b3b3afb3dad64eeebcce2838e88f2f580606
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
.gitignore
features-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java

index 2ef9ec33caab03c9b656b2c806eb81771b0c0396..949335ea215734a058626b35114184b467f026db 100644 (file)
@@ -17,6 +17,7 @@ local.properties
 .classpath
 
 .checkstyle
+.fbExcludeFilterFile
 
 # https://github.com/jbosstools/m2e-apt
 .factorypath
index e15bee243ac052675ac5e2c6ce3d21434efb5d78..6c26bb45152f023e3d6e454ba6c42634fc19a902 100644 (file)
@@ -121,6 +121,13 @@ public class SingleFeatureTest {
         return new Option[] {
             // TODO: Find a way to inherit memory limits from Maven options.
             new VMOption("-Xmx2g"),
+            // inspired by org.apache.commons.lang.SystemUtils
+            when(System.getProperty("os.name").toLowerCase().startsWith("linux")).useOptions(
+                // This prevents low entropy issues on Linux to affect Java random numbers
+                // which can block crypto such as the SSH server in netconf
+                // see https://bugs.opendaylight.org/show_bug.cgi?id=6790
+                new VMOption("-Djava.security.egd=file:/dev/./urandom")
+            ),
             when(Boolean.getBoolean(PROFILE_PROP)).useOptions(
                 new VMOption("-XX:+UnlockCommercialFeatures"),
                 new VMOption("-XX:+FlightRecorder"),