[sheepdog] [PATCH] tests/functional: use a new variable RANDOM_GEN for _urandom()

Hitoshi Mitake mitake.hitoshi at gmail.com
Sun Jan 12 11:59:51 CET 2014


On my ubuntu box (13.04), the openssl command called by _urandom()
dies with segmentation fault (yes, the walkaround was implemented in
the past but the problem occurs again...). For avoiding this problem,
this patch lets _urandom() use a new variable RANDOM_GEN. If this
variable is set, the function uses the variable as a command for
random number generation.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 tests/functional/common.rc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index 3785bae..d9a3f50 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -486,7 +486,12 @@ _cluster_format()
 
 _random()
 {
+    if [ -z "$RANDOM_GEN" ];
+    then
 	openssl enc -rc4 -pass pass:"$(date)" -nosalt < /dev/zero 2>/dev/null
+    else
+	$RANDOM_GEN < /dev/zero 2> /dev/null
+    fi
 }
 
 _one()
-- 
1.8.1.2




More information about the sheepdog mailing list