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.py | |
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.py')
-rw-r--r-- | tests/test-stream.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test-stream.py b/tests/test-stream.py index 93d63c019..a6a9c18b2 100644 --- a/tests/test-stream.py +++ b/tests/test-stream.py @@ -15,10 +15,28 @@ import sys import ovs.stream +import ovs.util def main(argv): + if len(argv) < 2: + ovs.util.ovs_fatal(0, + "usage: %s REMOTE [SSL_KEY] [SSL_CERT] [SSL_CA]", + argv[0], + ) remote = argv[1] + + if remote.startswith("ssl:"): + if len(argv) < 5: + ovs.util.ovs_fatal( + 0, + "usage with ssl: %s REMOTE [SSL_KEY] [SSL_CERT] [SSL_CA]", + argv[0], + ) + ovs.stream.SSLStream.ssl_set_ca_cert_file(argv[4]) + ovs.stream.SSLStream.ssl_set_certificate_file(argv[3]) + ovs.stream.SSLStream.ssl_set_private_key_file(argv[2]) + err, stream = ovs.stream.Stream.open_block( ovs.stream.Stream.open(remote), 10000) |