ovsdb-server: Add --enable-dummy option for unit tests.
authorBen Pfaff <blp@nicira.com>
Fri, 21 Sep 2012 18:16:34 +0000 (11:16 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 25 Sep 2012 05:39:18 +0000 (22:39 -0700)
This will allow an upcoming unit test to use the "time/warp" ovs-appctl
command with ovsdb-server.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb/ovsdb-server.c

index 32e2eb02f8a8ea9a608923d93fbc56ecf935276d..0baf9fcf15ebbceee1f0cc10f110d28b5f0d87e4 100644 (file)
@@ -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);