[sheepdog] [PATCH] test: Implentment fast random on AES

Joseph Glanville joseph at cloudscaling.com
Mon May 6 09:36:53 CEST 2013


---
 tests/008        | 2 +-
 tests/009        | 2 +-
 tests/018        | 2 +-
 tests/019        | 2 +-
 tests/020        | 2 +-
 tests/030        | 6 +++---
 tests/035        | 2 +-
 tests/049        | 2 +-
 tests/055        | 6 +++---
 tests/056        | 2 +-
 tests/fastrandom | 2 ++
 11 files changed, 16 insertions(+), 14 deletions(-)
 create mode 100755 tests/fastrandom

diff --git a/tests/008 b/tests/008
index 1af5bcf..adec553 100755
--- a/tests/008
+++ b/tests/008
@@ -33,7 +33,7 @@ for i in `seq 0 4`; do
 done
 
 for i in `seq 0 4`; do
-    dd if=/dev/urandom | $COLLIE vdi write test$i -p 7000 &
+    ./fastrandom | $COLLIE vdi write test$i -p 7000 &
 done
 
 sleep 3
diff --git a/tests/009 b/tests/009
index e139524..29dec5c 100755
--- a/tests/009
+++ b/tests/009
@@ -31,7 +31,7 @@ $COLLIE vdi create test 80M -P
 _kill_sheep 2
 
 # write data to the vdi
-cat /dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 
 # restart the 3rd node
 _start_sheep 2
diff --git a/tests/018 b/tests/018
index d8af69b..6f18516 100755
--- a/tests/018
+++ b/tests/018
@@ -25,7 +25,7 @@ $COLLIE cluster format -c 2
 
 $COLLIE vdi create test 4M
 
-dd if=/dev/urandom | $COLLIE vdi write -w test
+./fastrandom | $COLLIE vdi write -w test
 
 $COLLIE vdi flush test
 
diff --git a/tests/019 b/tests/019
index 98fc2b8..78b91f9 100755
--- a/tests/019
+++ b/tests/019
@@ -25,7 +25,7 @@ $COLLIE cluster format -c 2
 
 $COLLIE vdi create test 4M
 
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 
 for port in `seq 0 2`; do
     $COLLIE vdi read test -p 700$port | md5sum > /tmp/csum.$port
diff --git a/tests/020 b/tests/020
index 6fe2e32..b6d00bc 100755
--- a/tests/020
+++ b/tests/020
@@ -25,7 +25,7 @@ $COLLIE cluster format -c 2
 
 $COLLIE vdi create test 40M
 
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 
 # check cache size, should be 20 * 80%
 nr=`ls $STORE/0/cache/7c2b25 | wc -l`
diff --git a/tests/030 b/tests/030
index 7c5ed98..f693183 100755
--- a/tests/030
+++ b/tests/030
@@ -25,15 +25,15 @@ $COLLIE cluster format -c 2
 
 $COLLIE vdi create test 8M
 
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 $COLLIE cluster snapshot
 $COLLIE vdi read test | md5sum > /tmp/csum.1
 
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 $COLLIE cluster snapshot
 $COLLIE vdi read test | md5sum > /tmp/csum.2
 
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 $COLLIE cluster snapshot -l | _filter_date
 
 $COLLIE cluster snapshot -R 2
diff --git a/tests/035 b/tests/035
index 5b948c9..0dee9ee 100755
--- a/tests/035
+++ b/tests/035
@@ -35,7 +35,7 @@ _wait_for_sheep 6
 $COLLIE cluster format -c 3 -m unsafe
 
 $COLLIE vdi create test 40M
-dd if=/dev/urandom | $COLLIE vdi write test &
+./fastrandom | $COLLIE vdi write test &
 
 sleep 3
 # Test write timeout
diff --git a/tests/049 b/tests/049
index 1336b5f..e95f643 100755
--- a/tests/049
+++ b/tests/049
@@ -25,7 +25,7 @@ $COLLIE cluster format -c 1
 sleep 1
 
 $COLLIE vdi create test 20M
-dd if=/dev/urandom | $COLLIE vdi write -w test
+./fastrandom | $COLLIE vdi write -w test
 
 $COLLIE cluster shutdown
 _wait_for_sheep_stop
diff --git a/tests/055 b/tests/055
index 6b99552..6959b89 100755
--- a/tests/055
+++ b/tests/055
@@ -25,14 +25,14 @@ $COLLIE vdi create test 200M -P
 
 # simulate one disk failure
 rm $STORE/0/d0 -rf
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 _wait_for_sheep_recovery 0
 $COLLIE vdi check test
 $COLLIE cluster info | _filter_cluster_info
 
 # simulate multiple disk failure
 rm $STORE/1/d0 -rf
-dd if=/dev/urandom | $COLLIE vdi write test &
+./fastrandom | $COLLIE vdi write test &
 sleep 1
 rm $STORE/1/d1 -rf
 _wait_for_sheep_recovery 0
@@ -42,7 +42,7 @@ $COLLIE cluster info | _filter_cluster_info
 
 # simulate all disks failure
 rm $STORE/1/d2 -rf
-dd if=/dev/urandom | $COLLIE vdi write test
+./fastrandom | $COLLIE vdi write test
 $COLLIE vdi check test
 $COLLIE cluster info | _filter_cluster_info
 
diff --git a/tests/056 b/tests/056
index 25dd22f..64b6398 100755
--- a/tests/056
+++ b/tests/056
@@ -25,7 +25,7 @@ $COLLIE vdi create test 200M -P
 
 # node event after disk failure
 rm $STORE/0/d0 -rf
-dd if=/dev/urandom | $COLLIE vdi write test &
+./fastrandom | $COLLIE vdi write test &
 sleep 1
 _start_sheep 3
 _wait_for_sheep 4
diff --git a/tests/fastrandom b/tests/fastrandom
new file mode 100755
index 0000000..547ffff
--- /dev/null
+++ b/tests/fastrandom
@@ -0,0 +1,2 @@
+#!/bin/bash
+openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero | cat
-- 
1.8.1.2




More information about the sheepdog mailing list