Testing: IP allocation simulation - add command line option for random seed.
authorMartin Schwenke <martin@meltin.net>
Sun, 1 Aug 2010 01:53:28 +0000 (11:53 +1000)
committerMartin Schwenke <martin@meltin.net>
Sun, 1 Aug 2010 01:53:28 +0000 (11:53 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/takeover/ctdb_takeover.py

index ce9cc115e6a4ca7f4b3384335d60b2ec8125b832..0457e852f01a23574064ab50a10a775e5d9a202b 100755 (executable)
@@ -58,6 +58,10 @@ def process_args():
                       action="store", type="int", dest="iterations",
                       default=1000,
                       help="number of iterations to run in test")
+    parser.add_option("-s", "--seed",
+                      action="store", type="int", dest="seed",
+                      default=None,
+                      help="number of iterations to run in test")
     parser.add_option("-b", "--balance",
                       action="store_true", dest="balance", default=False,
                       help="show (im)balance information")
@@ -493,3 +497,4 @@ prev = None
 
 options = process_args()
 
+random.seed(options.seed)