add --default-timeout option
diff --git a/tests/oft b/tests/oft
index dbc9588..f8c4205 100755
--- a/tests/oft
+++ b/tests/oft
@@ -131,6 +131,7 @@
sys.path.insert(0, pydir)
import testutils
+import oftest.ofutils
try:
import scapy.all as scapy
@@ -180,6 +181,7 @@
"profile" : None,
"allow_user" : False,
"fail_skipped" : False,
+ "default_timeout" : 2,
}
# Default test priority
@@ -269,6 +271,8 @@
help="Proceed even if oftest is not run as root")
parser.add_option("--fail-skipped", action="store_true",
help="Return failure if any test was skipped")
+ parser.add_option("--default-timeout", type="int",
+ help="Timeout in seconds for most operations")
# Might need this if other parsers want command line
# parser.allow_interspersed_args = False
(options, args) = parser.parse_args()
@@ -560,6 +564,8 @@
else:
_verb = 2
+oftest.ofutils.default_timeout = config["default_timeout"]
+
if os.getuid() != 0 and not config["allow_user"]:
print "ERROR: Super-user privileges required. Please re-run with " \
"sudo or as root."