[ovs-dev] [multi-dbs v2 2/3] ovsdb-server: Add --enable-dummy option for unit tests.
Ben Pfaff
blp at nicira.com
Fri Sep 21 18:26:52 UTC 2012
This will allow an upcoming unit test to use the "time/warp" ovs-appctl
command with ovsdb-server.
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
ovsdb/ovsdb-server.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 32e2eb0..0baf9fc 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);
--
1.7.2.5
More information about the dev
mailing list