From ccbc5c76c8080e241d764a839355494ae4634506 Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Sun, 4 Apr 2010 03:03:03 -0300
Subject: [PATCH 14/15] tests/stress: Add a --force option

Sometimes it can be useful to force the tests to run, even if conflicting
options are selected.

Even if they're known to be broken, the way they break can be interesting when
developing.

This patch adds an --force option to jiostress to let the user do that in an
easy way.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
 tests/stress/jiostress |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/stress/jiostress b/tests/stress/jiostress
index ad499fd..8f0773e 100755
--- a/tests/stress/jiostress
+++ b/tests/stress/jiostress
@@ -650,6 +650,10 @@ def main():
 	parser.add_option("", "--keep", dest = "keep",
 		action = "store_true", default = False,
 		help = "keep the file after completing the test")
+	parser.add_option("", "--force", dest = "force",
+		action = "store_true", default = False,
+		help = "force the tests to run, even if conflicting"
+			+ " options are selected")
 
 	options, args = parser.parse_args()
 
@@ -664,13 +668,14 @@ def main():
 		print("Error: the size of the file must be numeric")
 		return 1
 
-	if options.use_fi and options.use_as:
-		print("Error: --fi and --as cannot be used together")
-		return 1
+	if not options.force:
+		if options.use_fi and options.use_as:
+			print("Error: --fi and --as cannot be used together")
+			return 1
 
-	if options.use_fi and options.nproc > 1:
-		print("Error: --fi cannot be used with multiple processes")
-		return 1
+		if options.use_fi and options.nproc > 1:
+			print("Error: --fi cannot be used with multiple processes")
+			return 1
 
 	if not options.use_internal_locks:
 		options.do_verify = False
-- 
1.6.2.2.646.gb214

