summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2009-12-21 13:13:48 -0800
committerBen Pfaff <blp@nicira.com>2010-01-06 14:30:29 -0800
commit9467fe624698a9b72f81bb1ddfce33a5fc85281c (patch)
tree097e842d92c17e42e41bd5addddbd32e885d30d2 /tests
parentd474bd01bbdbbbdc94de525cef4099cb06cabf22 (diff)
downloadopenvswitch-9467fe624698a9b72f81bb1ddfce33a5fc85281c.tar.gz
Add SSL support to "stream" library and OVSDB.
Diffstat (limited to 'tests')
-rw-r--r--tests/automake.mk2
-rw-r--r--tests/test-jsonrpc.c18
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/automake.mk b/tests/automake.mk
index 60c0393a3..0c81f3fc9 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -97,7 +97,7 @@ tests_test_json_LDADD = lib/libopenvswitch.a
noinst_PROGRAMS += tests/test-jsonrpc
tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
-tests_test_jsonrpc_LDADD = lib/libopenvswitch.a
+tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
noinst_PROGRAMS += tests/test-list
tests_test_list_SOURCES = tests/test-list.c
diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c
index 42d2c3904..da92cec90 100644
--- a/tests/test-jsonrpc.c
+++ b/tests/test-jsonrpc.c
@@ -28,6 +28,7 @@
#include "daemon.h"
#include "json.h"
#include "poll-loop.h"
+#include "stream-ssl.h"
#include "stream.h"
#include "timeval.h"
#include "util.h"
@@ -52,10 +53,17 @@ main(int argc, char *argv[])
static void
parse_options(int argc, char *argv[])
{
+ enum {
+ OPT_BOOTSTRAP_CA_CERT = UCHAR_MAX + 1
+ };
static struct option long_options[] = {
{"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
DAEMON_LONG_OPTIONS,
+#ifdef HAVE_OPENSSL
+ {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT},
+ STREAM_SSL_LONG_OPTIONS
+#endif
{0, 0, 0, 0},
};
char *short_options = long_options_to_short_options(long_options);
@@ -76,6 +84,14 @@ parse_options(int argc, char *argv[])
DAEMON_OPTION_HANDLERS
+#ifdef HAVE_OPENSSL
+ STREAM_SSL_OPTION_HANDLERS
+
+ case OPT_BOOTSTRAP_CA_CERT:
+ stream_ssl_set_ca_cert_file(optarg, true);
+ break;
+#endif
+
case '?':
exit(EXIT_FAILURE);
@@ -95,7 +111,7 @@ usage(void)
" request REMOTE METHOD PARAMS send request, print reply\n"
" notify REMOTE METHOD PARAMS send notification and exit\n",
program_name, program_name);
- stream_usage("JSON-RPC", true, true);
+ stream_usage("JSON-RPC", true, true, true);
daemon_usage();
vlog_usage();
printf("\nOther options:\n"