Whamcloud - gitweb
LU-7103 test: avoid cat of /dev/urandom 50/17350/3
authorBob Glossman <bob.glossman@intel.com>
Tue, 24 Nov 2015 19:29:43 +0000 (11:29 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 2 Dec 2015 03:55:28 +0000 (03:55 +0000)
Use a different command to generate a random number.
Using cat /dev/urandom doesn't work in all cases.

Test-Parameters: clientdistro=el7
testlist=ost-pools,ost-pools,ost-pools,ost-pools,ost-pools,ost-pools,ost-pools,
ost-pools,ost-pools,ost-pools,ost-pools,ost-pools,ost-pools,ost-pools

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I63cfad2654cf654460263529457538965e373f82
Reviewed-on: http://review.whamcloud.com/17350
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/ost-pools.sh

index a53fa90..eb2ec58 100644 (file)
@@ -683,7 +683,8 @@ test_7a()
 
        # Generate pool with random name from 1 to 15 characters
        for i in 1 9 15 ; do
-               POOLNAME=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $i |
+               POOLNAME=$(echo $$$RANDOM$RANDOM |
+                          tr -dc 'a-zA-Z0-9' | fold -w $i |
                           head -n 1)
                echo set poolname to $POOLNAME
                helper_test_7a $POOLNAME