git » libjio » commit ccbc5c7

tests/stress: Add a --force option

author Alberto Bertogli
2010-04-04 06:03:03 UTC
committer Alberto Bertogli
2010-04-04 06:06:41 UTC
parent 874131deeecbd57ef2871ac065cf4dbe422bc266

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 +11 -6

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