From 06834871348ac2c23418064a3e04d769ac5373ec Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 21 Sep 2012 11:16:34 -0700 Subject: [PATCH] ovsdb-server: Add --enable-dummy option for unit tests. This will allow an upcoming unit test to use the "time/warp" ovs-appctl command with ovsdb-server. Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- ovsdb/ovsdb-server.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 32e2eb02..0baf9fcf 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -25,6 +25,7 @@ #include "command-line.h" #include "daemon.h" #include "dirs.h" +#include "dummy.h" #include "file.h" #include "hash.h" #include "json.h" @@ -729,11 +730,11 @@ parse_options(int argc, char *argv[], char **file_namep, char **run_command) { enum { - OPT_DUMMY = UCHAR_MAX + 1, - OPT_REMOTE, + OPT_REMOTE = UCHAR_MAX + 1, OPT_UNIXCTL, OPT_RUN, OPT_BOOTSTRAP_CA_CERT, + OPT_ENABLE_DUMMY, VLOG_OPTION_ENUMS, LEAK_CHECKER_OPTION_ENUMS, DAEMON_OPTION_ENUMS @@ -751,6 +752,7 @@ parse_options(int argc, char *argv[], char **file_namep, {"private-key", required_argument, NULL, 'p'}, {"certificate", required_argument, NULL, 'c'}, {"ca-cert", required_argument, NULL, 'C'}, + {"enable-dummy", optional_argument, NULL, OPT_ENABLE_DUMMY}, {NULL, 0, NULL, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -806,6 +808,10 @@ parse_options(int argc, char *argv[], char **file_namep, bootstrap_ca_cert = true; break; + case OPT_ENABLE_DUMMY: + dummy_enable(optarg && !strcmp(optarg, "override")); + break; + case '?': exit(EXIT_FAILURE); -- 2.30.2