ganeshmurthy commented on a change in pull request #979:
URL: https://github.com/apache/qpid-dispatch/pull/979#discussion_r556847894



##########
File path: tests/system_tests_ssl.py
##########
@@ -452,6 +458,76 @@ def get_expected_tls_result(self, expected_results):
                 self.OPENSSL_ALLOW_TLSV1_2 and tlsv1_2,
                 self.OPENSSL_ALLOW_TLSV1_3 and tlsv1_3]
 
+    def inject_file(self, source_file, dest_file):
+        source_path = self.ssl_file(source_file)
+        url         = Url("amqp://0.0.0.0:%d" % self.PORT_CLEAR)
+        try:
+            connection = BlockingConnection(url, sasl_enabled=False, 
timeout=self.TIMEOUT)
+            sender     = connection.create_sender('_$qd.store_file')
+            fd         = open(source_path, "r")
+            body       = fd.read()
+            fd.close()
+            sender.send(Message(subject=dest_file, body=body))
+            connection.close()
+        except proton.Timeout:
+            return False
+        except proton.ConnectionException:
+            return False
+        except Exception as e:
+            print("Exception: %r" % e)
+            return False
+        return True
+
+    def create_ssl_profile(self, name, args):
+        url = Url("amqp://0.0.0.0:%d" % self.PORT_CLEAR)
+        try:
+            connection = BlockingConnection(url, sasl_enabled=False, 
timeout=self.TIMEOUT)
+            receiver   = connection.create_receiver(None, dynamic=True)
+            sender     = connection.create_sender('$management')
+            sender.send(Message(properties={'operation': 'CREATE',
+                                            'type': 
'org.apache.qpid.dispatch.sslProfile',
+                                            'name': name},
+                                reply_to=receiver.remote_source.address,
+                                body=args))
+            reply = receiver.receive()
+            connection.close()
+            if reply.properties['statusCode'] > 299:
+                print("Create error: %d %s" % (reply.properties['statusCode'], 
reply.properties['statusDescription']))
+                return False
+        except proton.Timeout:
+            return False
+        except proton.ConnectionException:
+            return False
+        except Exception as e:
+            print("Exception: %r" % e)
+            return False
+        return True
+
+    def create_listener(self, name, args):
+        url = Url("amqp://0.0.0.0:%d" % self.PORT_CLEAR)
+        try:
+            connection = BlockingConnection(url, sasl_enabled=False, 
timeout=self.TIMEOUT)
+            receiver   = connection.create_receiver(None, dynamic=True)
+            sender     = connection.create_sender('$management')
+            sender.send(Message(properties={'operation': 'CREATE',

Review comment:
       This too can use the QdManager class in system_test.py




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to