diff mbox series

[ovs-dev,1/6] tests: Complain if key and certs not provided for SSL connection

Message ID 20180418160115.16204-2-jkbs@redhat.com
State Accepted
Headers show
Series Run Python IDL checks using SSL | expand

Commit Message

Jakub Sitnicki April 18, 2018, 4:01 p.m. UTC
Add an argument check to test-ovsdb.py to ensure that the user has
provided the private key, the certificate, and the peer CA certificate
needed to set up an SSL connection.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
 tests/test-ovsdb.py | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ben Pfaff April 18, 2018, 6:16 p.m. UTC | #1
On Wed, Apr 18, 2018 at 06:01:10PM +0200, Jakub Sitnicki wrote:
> Add an argument check to test-ovsdb.py to ensure that the user has
> provided the private key, the certificate, and the peer CA certificate
> needed to set up an SSL connection.
> 
> Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>

Applied to master, thanks!
diff mbox series

Patch

diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
index 45341dfdf..8dba9f85f 100644
--- a/tests/test-ovsdb.py
+++ b/tests/test-ovsdb.py
@@ -555,6 +555,11 @@  def do_idl(schema_file, remote, *commands):
     track_notify = False
 
     if remote.startswith("ssl:"):
+        if len(commands) < 3:
+            sys.stderr.write("SSL connection requires private key, "
+                             "certificate for private key, and peer CA "
+                             "certificate as arguments\n")
+            sys.exit(1)
         ovs.stream.Stream.ssl_set_private_key_file(commands[0])
         ovs.stream.Stream.ssl_set_certificate_file(commands[1])
         ovs.stream.Stream.ssl_set_ca_cert_file(commands[2])