summaryrefslogtreecommitdiff
path: root/utilities/ovs-appctl.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-03-06 16:10:46 -0800
committerEthan Jackson <ethan@nicira.com>2012-03-07 12:50:15 -0800
commitf4ec6ff479ace8f9b893f883557235f2ea6bab8f (patch)
tree083fd765ee48cf0d52ea384adb86fd77cbbcfe8a /utilities/ovs-appctl.c
parent87cf07675bf45a0b15735d28380263a8d4da8642 (diff)
downloadopenvswitch-f4ec6ff479ace8f9b893f883557235f2ea6bab8f.tar.gz
unixctl: Timeout unit tests instead of hanging.
We've seen some unixctl tests hang indefinitely which makes them difficult to debug. ovs-appctl and appctl.py calls to timeout instead. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'utilities/ovs-appctl.c')
-rw-r--r--utilities/ovs-appctl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c
index 241b6c043..f761d5ac2 100644
--- a/utilities/ovs-appctl.c
+++ b/utilities/ovs-appctl.c
@@ -97,6 +97,7 @@ Common commands:\n\
'off', 'emer', 'err', 'warn', 'info', or 'dbg' ('dbg', bydefault)\n\
vlog/reopen Make the program reopen its log file\n\
Other options:\n\
+ --timeout=SECS wait at most SECS seconds for a response\n\
-h, --help Print this helpful information\n\
-V, --version Display ovs-appctl version information\n",
program_name, program_name);
@@ -111,6 +112,7 @@ parse_command_line(int argc, char *argv[])
{"execute", no_argument, NULL, 'e'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
+ {"timeout", required_argument, NULL, 'T'},
{NULL, 0, NULL, 0},
};
const char *target;
@@ -147,6 +149,10 @@ parse_command_line(int argc, char *argv[])
usage();
break;
+ case 'T':
+ time_alarm(atoi(optarg));
+ break;
+
case 'V':
ovs_print_version(0, 0);
exit(EXIT_SUCCESS);