Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: cts by xunsun from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Fri, 24 Feb 2006 23:53:59 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by xunsun from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : xunsun
Host    : 
Project : linux-ha
Module  : cts

Dir     : linux-ha/cts


Modified Files:
        CTSlab.py.in OCFIPraTest.py.in 


Log Message:
Avoid using /dev/urandom: the random module can seed itself well enough with 
system time
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTSlab.py.in,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- CTSlab.py.in        20 Feb 2006 05:38:03 -0000      1.48
+++ CTSlab.py.in        25 Feb 2006 06:53:59 -0000      1.49
@@ -26,7 +26,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 from UserDict import UserDict
-import sys, time, types, syslog, random, os, struct, string, signal, traceback
+import sys, time, types, syslog, random, os, string, signal, traceback
 from CTS  import ClusterManager
 from CM_hb import HeartbeatCM
 from CTStests import BSC_AddResource
@@ -360,16 +360,10 @@
 
         if self.has_key("RandSeed"):
             randseed = self["RandSeed"]
+            self.log("Random seed is: " + str(randseed))
+            self.RandomGen.seed(randseed) 
         else:
-            f=open("/dev/urandom", "r")
-            string=f.read(3)
-            f.close()
-            randseed=struct.unpack("BBB", string)
-
-        self.log("Random seed is: " + str(randseed))
-        self.randseed=randseed
-
-        self.RandomGen.seed(randseed[0]) 
+            self.RandomGen.seed()
 
     def log(self, args):
         "Log using each of the supplied logging methods"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/OCFIPraTest.py.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- OCFIPraTest.py.in   20 Feb 2006 05:38:03 -0000      1.2
+++ OCFIPraTest.py.in   25 Feb 2006 06:53:59 -0000      1.3
@@ -23,7 +23,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-import string,sys,struct,os,random,time,syslog
+import string,sys,os,random,time,syslog
 
 def usage():
     print "usage: " + sys.argv[0]  \
@@ -129,13 +129,8 @@
     log("Test Count:" + str(itnum))
         
     # Prepare Random
-    f = open("/dev/urandom", "r")
-    seed=struct.unpack("BBB", f.read(3))
-    f.close()
-    #seed=(123,321,231)
     rand = random.Random()
-    rand.seed(seed[0]) 
-    log("Test Random Seed:" + str(seed))
+    rand.seed() 
     
     #
     # Begin Tests
@@ -172,4 +167,4 @@
     log("start:\t" + str(summary["start"]))
     log("stop: \t" + str(summary["stop"]))
     log("audit:\t" + str(summary["audit"]))
-    
\ No newline at end of file
+    




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 27, Issue 98
********************************************

Reply via email to