Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
proton-0.12.0
Description
A couple of tests in the MessengerSSLTests (in tests/python/proton_tests/ssl.py) hard code the port numbers as 12345
def test_server_credentials(self, cert="server-certificate.pem", key="server-private-key.pem", password="server-password", exception=None): import sys # java doesn't do validation in the same way (yet) if exception and "java" in sys.platform: raise Skipped() self.server.certificate = _testpath(cert) self.server.private_key = _testpath(key) self.server.password = password try: self.server.start() self.server.subscribe("amqps://~0.0.0.0:12345") if exception is not None: assert False, "expected failure did not occur" except MessengerException: e = sys.exc_info()[1] if exception: assert exception in str(e), str(e) else: raise e
Hard coding the port sometimes leads to errors if port 12345 is already bound.
File "./tests/python/proton-test", line 362, in run phase() File "<http://mrg23.lab.bos.redhat.com:8080/job/proton-c-master-rhel-cxx/label=rhel7-64/ws/qpid-proton/tests/python/proton_tests/ssl.py",> line 992, in test_client_credentials self.server.subscribe("amqps://~0.0.0.0:12345") File "<http://mrg23.lab.bos.redhat.com:8080/job/proton-c-master-rhel-cxx/label=rhel7-64/ws/qpid-proton/proton-c/bindings/python/proton/__init__.py",> line 496, in subscribe self._check(pn_error_code(pn_messenger_error(self._mng))) File "<http://mrg23.lab.bos.redhat.com:8080/job/proton-c-master-rhel-cxx/label=rhel7-64/ws/qpid-proton/proton-c/bindings/python/proton/__init__.py",> line 300, in _check raise exc("[%s]: %s" % (err, pn_error_text(pn_messenger_error(self._mng)))) MessengerException: [-2]: CONNECTION ERROR (0.0.0.0:12345): bind: errno: 98 proton_tests.ssl.MessengerSSLTests.test_client_credentials_bad_cert ..... fail
Remove all occurrences of hard coded ports in MessengerSSLTests
Attachments
Issue Links
- links to