Risk: Low
Visibility: Anyone writing their own (complicated) control files.

Add a run_sequentially to our 'run_randomly' class to make certain types
of control file debugging easier.

Signed-off-by: Jeremy Orlow <jorlow@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1595 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index c5f9933..00454f8 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -512,10 +512,10 @@
 
 
 class run_randomly:
-
-
-	def __init__(self):
+	def __init__(self, run_sequentially=False):
+		# Run sequentially is for debugging control files
 		self.test_list = []
+		self.run_sequentially = run_sequentially
 
 
 	def add(self, *args, **dargs):
@@ -526,5 +526,7 @@
 	def run(self, fn):
 		while self.test_list:
 			test_index = random.randint(0, len(self.test_list)-1)
+			if self.run_sequentially:
+				test_index = 0
 			(args, dargs) = self.test_list.pop(test_index)
 			fn(*args, **dargs)