git » libjio » commit bc79292

tests/stress: Do not depend on libfiu if not asked for it

author Alberto Bertogli
2011-02-27 12:01:59 UTC
committer Alberto Bertogli
2011-02-27 21:23:34 UTC
parent d3dbfecd3bf139f10a51e062fd06904845073bd3

tests/stress: Do not depend on libfiu if not asked for it

If the --fi command line option is not passed to jiostress, it won't use it,
so there's no need to depend on it.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

tests/stress/jiostress +9 -5

diff --git a/tests/stress/jiostress b/tests/stress/jiostress
index 5584023..faa5d06 100755
--- a/tests/stress/jiostress
+++ b/tests/stress/jiostress
@@ -20,11 +20,10 @@ import libjio
 try:
 	import fiu
 except ImportError:
-	print()
-	print("Error: unable to load fiu module. This test needs libfiu")
-	print("support. Please install libfiu and recompile libjio with FI=1.")
-	print()
-	raise
+	# It may be mandatory if the appropriate command line options are
+	# given, but we will check later once we have parsed them
+	fiu = None
+
 
 #
 # Auxiliary stuff
@@ -677,6 +676,11 @@ def main():
 			print("Error: --fi cannot be used with multiple processes")
 			return 1
 
+	if options.use_fi and not fiu:
+		print("Error: unable to load fiu module, but use_fi was")
+		print("enabled. Please install libfiu and recompile libjio with FI=1.")
+		return 1
+
 	if not options.use_internal_locks:
 		options.do_verify = False