diff options
author | Stefan Hoffmann <stefan.hoffmann@cloudandheat.com> | 2023-05-11 15:38:50 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-05-11 21:41:03 +0200 |
commit | 965c2955e6750f503b55d5c0af516cbb7b45f7ae (patch) | |
tree | 7c4d4473fc3b9e6c7407b2071f2f160604e0403e /tests/test-stream.c | |
parent | f3f3be682dfaaf13cecb69a17767151d18787a57 (diff) | |
download | openvswitch-master.tar.gz |
This tests stream.c and stream.py with ssl connection at
CHECK_STREAM_OPEN_BLOCK.
For the tests, ovsdb needs to be build with libssl.
Signed-off-by: Stefan Hoffmann <stefan.hoffmann@cloudandheat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests/test-stream.c')
-rw-r--r-- | tests/test-stream.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test-stream.c b/tests/test-stream.c index 68ce2c544..14e3bfe38 100644 --- a/tests/test-stream.c +++ b/tests/test-stream.c @@ -19,6 +19,7 @@ #include "fatal-signal.h" #include "openvswitch/vlog.h" #include "stream.h" +#include "stream-ssl.h" #include "util.h" VLOG_DEFINE_THIS_MODULE(test_stream); @@ -33,7 +34,16 @@ main(int argc, char *argv[]) set_program_name(argv[0]); if (argc < 2) { - ovs_fatal(0, "usage: %s REMOTE", argv[0]); + ovs_fatal(0, "usage: %s REMOTE [SSL_KEY] [SSL_CERT] [SSL_CA]", + argv[0]); + } + if (strncmp("ssl:", argv[1], 4) == 0) { + if (argc < 5) { + ovs_fatal(0, "usage with ssl: %s REMOTE SSL_KEY SSL_CERT SSL_CA", + argv[0]); + } + stream_ssl_set_ca_cert_file(argv[4], false); + stream_ssl_set_key_and_cert(argv[2], argv[3]); } error = stream_open_block(stream_open(argv[1], &stream, DSCP_DEFAULT), |