summaryrefslogtreecommitdiff
path: root/utilities/ovs-appctl.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2018-08-14 10:53:16 +0300
committerBen Pfaff <blp@ovn.org>2018-08-15 11:36:18 -0700
commit9551e80befc0f8ecc5ee8a7e025147358c2753ee (patch)
tree02defe18c297a92f9426f74918ed2f4bb335f51d /utilities/ovs-appctl.c
parentcbcf40a847c0539fec36e82410f0966f13517964 (diff)
downloadopenvswitch-9551e80befc0f8ecc5ee8a7e025147358c2753ee.tar.gz
tests: Use environment variable for default timeout.
Introduce new 'OVS_CTL_TIMEOUT' environment variable that, if set, will be used as a default timeout for OVS control utilities. Setting it in 'atlocal.in' will cover all the hangs inside the testsuite, even when utils called in a subshell. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities/ovs-appctl.c')
-rw-r--r--utilities/ovs-appctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c
index d6408ea9d..ba0c172e6 100644
--- a/utilities/ovs-appctl.c
+++ b/utilities/ovs-appctl.c
@@ -128,12 +128,12 @@ parse_command_line(int argc, char *argv[])
char *short_options = xasprintf("+%s", short_options_);
const char *target;
int e_options;
+ unsigned int timeout = 0;
target = NULL;
e_options = 0;
for (;;) {
int option;
- unsigned int timeout = 0;
option = getopt_long(argc, argv, short_options, long_options, NULL);
if (option == -1) {
@@ -168,8 +168,6 @@ parse_command_line(int argc, char *argv[])
case 'T':
if (!str_to_uint(optarg, 10, &timeout) || !timeout) {
ovs_fatal(0, "value %s on -T or --timeout is invalid", optarg);
- } else {
- time_alarm(timeout);
}
break;
@@ -189,6 +187,8 @@ parse_command_line(int argc, char *argv[])
free(short_options_);
free(short_options);
+ ctl_timeout_setup(timeout);
+
if (optind >= argc) {
ovs_fatal(0, "at least one non-option argument is required "
"(use --help for help)");