qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1664740 - in /qpid/dispatch/trunk: config.sh tests/CMakeLists.txt tests/system_tests_qdstat.py
Date Fri, 06 Mar 2015 22:39:52 GMT
Author: aconway
Date: Fri Mar  6 22:39:51 2015
New Revision: 1664740

URL: http://svn.apache.org/r1664740
Log:
NO-JIRA: Don't install run.py with tests.

Testing on an install should use only standard locations and system envionment variables
to locate everything needed.

Modified:
    qpid/dispatch/trunk/config.sh
    qpid/dispatch/trunk/tests/CMakeLists.txt
    qpid/dispatch/trunk/tests/system_tests_qdstat.py

Modified: qpid/dispatch/trunk/config.sh
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/config.sh?rev=1664740&r1=1664739&r2=1664740&view=diff
==============================================================================
--- qpid/dispatch/trunk/config.sh (original)
+++ qpid/dispatch/trunk/config.sh Fri Mar  6 22:39:51 2015
@@ -28,7 +28,6 @@ export INSTALL_DIR=$SOURCE_DIR/${2:-inst
 
 PYTHON_LIB=$(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='$INSTALL_DIR')")
 
-export QPID_DISPATCH_HOME=$INSTALL_DIR/lib/qpid-dispatch
 export LD_LIBRARY_PATH=$INSTALL_DIR/lib64:$INSTALL_DIR/lib:$LD_LIBRARY_PATH
 export PYTHONPATH=$PYTHON_LIB:$PYTHONPATH
 export PATH=$INSTALL_DIR/sbin:$INSTALL_DIR/bin:$SOURCE_DIR/bin:$PATH

Modified: qpid/dispatch/trunk/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/CMakeLists.txt?rev=1664740&r1=1664739&r2=1664740&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/tests/CMakeLists.txt Fri Mar  6 22:39:51 2015
@@ -80,8 +80,11 @@ add_system_test(system_tests_qdmanage)
 add_system_test(system_tests_qdstat)
 add_system_test(system_tests_two_routers)
 
+# NOTE: Don't install run.py. A system test of a dispatch installation should pick everything
+# up from standard install locations.
+#
 set(SYSTEM_TEST_FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/run.py run_system_tests.py system_test.py
+  run_system_tests.py system_test.py
   system_tests_one_router.py system_tests_two_routers.py
   system_tests_broker.py system_tests_management.py
   system_tests_qdstat.py system_tests_qdmanage.py)

Modified: qpid/dispatch/trunk/tests/system_tests_qdstat.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_qdstat.py?rev=1664740&r1=1664739&r2=1664740&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_tests_qdstat.py (original)
+++ qpid/dispatch/trunk/tests/system_tests_qdstat.py Fri Mar  6 22:39:51 2015
@@ -96,58 +96,99 @@ class QdstatTest(system_test.TestCase):
     def test_log(self):
         self.run_qdstat(['--log',  '--limit=5'], r'AGENT \(trace\).*GET-LOG')
 
-    def test_ssl(self):
+    def ssl_test(self, url_name, arg_names):
+        """Run simple SSL connection test with supplied parameters.
+        See test_ssl_* below.
         """
-        Test the matrix of dispatch and client SSL configuratoin and ensure we 
-        can/can't connect as expected.
-        """
-
-        def do_test(url, args):
-            self.run_qdstat(['--general'] + args,
-                            regexp=r'(?s)Router Statistics.*Mode\s*Standalone',
-                            address=str(url))
-
-        trustfile = ['--ssl-trustfile', self.ssl_file('ca-certificate.pem')]
-        bad_trustfile = ['--ssl-trustfile', self.ssl_file('bad-ca-certificate.pem')]
-        client_cert = ['--ssl-certificate', self.ssl_file('client-certificate.pem')]
-        client_key = ['--ssl-key', self.ssl_file('client-private-key.pem')]
-        client_pass = ['--ssl-password', 'client-password']
-        client_cert_all = client_cert + client_key + client_pass
+        args = dict(
+            trustfile = ['--ssl-trustfile', self.ssl_file('ca-certificate.pem')],
+            bad_trustfile = ['--ssl-trustfile', self.ssl_file('bad-ca-certificate.pem')],
+            client_cert = ['--ssl-certificate', self.ssl_file('client-certificate.pem')],
+            client_key = ['--ssl-key', self.ssl_file('client-private-key.pem')],
+            client_pass = ['--ssl-password', 'client-password'])
+        args['client_cert_all'] = args['client_cert'] + args['client_key'] + args['client_pass']
 
         addrs = [self.router.addresses[i] for i in xrange(4)];
-        none, strict, unsecured, auth = addrs
-        none_s, strict_s, unsecured_s, auth_s = (Url(a, scheme="amqps") for a in addrs)
+        urls = dict(zip(['none', 'strict', 'unsecured', 'auth'], addrs) +
+                    zip(['none_s', 'strict_s', 'unsecured_s', 'auth_s'],
+                        (Url(a, scheme="amqps") for a in addrs)))
+
+        self.run_qdstat(['--general'] + sum([args[n] for n in arg_names], []),
+                        regexp=r'(?s)Router Statistics.*Mode\s*Standalone',
+                        address=str(urls[url_name]))
+
+    def ssl_test_bad(self, url_name, arg_names):
+        self.assertRaises(AssertionError, self.ssl_test, url_name, arg_names)
+
+    # Non-SSL enabled listener should fail SSL connections.
+    def test_ssl_none(self):
+        self.ssl_test('none', [])
+
+    def test_ssl_scheme_to_none(self):
+        self.ssl_test_bad('none_s', [])
+
+    def test_ssl_cert_to_none(self):
+        self.ssl_test_bad('none', ['client_cert'])
+
+    # Strict SSL listener, SSL only
+    def test_ssl_none_to_strict(self):
+        self.ssl_test_bad('strict', [])
+
+    def test_ssl_schema_to_strict(self):
+        self.ssl_test('strict_s', [])
+
+    def test_ssl_cert_to_strict(self):
+        self.ssl_test('strict_s', ['client_cert_all'])
+
+    def test_ssl_trustfile_to_strict(self):
+        self.ssl_test('strict_s', ['trustfile'])
+
+    def test_ssl_trustfile_cert_to_strict(self):
+        self.ssl_test('strict_s', ['trustfile', 'client_cert_all'])
+
+    def test_ssl_bad_trustfile_to_strict(self):
+        self.ssl_test_bad('strict_s', ['bad_trustfile'])
+
+
+    # Require-auth SSL listener
+    def test_ssl_none_to_auth(self):
+        self.ssl_test_bad('auth', [])
+
+    def test_ssl_schema_to_auth(self):
+        self.ssl_test_bad('auth_s', [])
+
+    def test_ssl_trustfile_to_auth(self):
+        self.ssl_test_bad('auth_s', ['trustfile'])
+
+    def test_ssl_cert_to_auth(self):
+        self.ssl_test('auth_s', ['client_cert_all'])
+
+    def test_ssl_trustfile_cert_to_auth(self):
+        self.ssl_test('auth_s', ['trustfile', 'client_cert_all'])
+
+    def test_ssl_bad_trustfile_to_auth(self):
+        self.ssl_test_bad('auth_s', ['bad_trustfile', 'client_cert_all'])
+
+
+    # Unsecured SSL listener, allows non-SSL
+    def test_ssl_none_to_unsecured(self):
+        self.ssl_test('unsecured', [])
+
+    def test_ssl_schema_to_unsecured(self):
+        self.ssl_test('unsecured_s', [])
+
+    def test_ssl_cert_to_unsecured(self):
+        self.ssl_test('unsecured_s', ['client_cert_all'])
+
+    def test_ssl_trustfile_to_unsecured(self):
+        self.ssl_test('unsecured_s', ['trustfile'])
+
+    def test_ssl_trustfile_cert_to_unsecured(self):
+        self.ssl_test('unsecured_s', ['trustfile', 'client_cert_all'])
+
+    def test_ssl_bad_trustfile_to_unsecured(self):
+        self.ssl_test_bad('unsecured_s', ['bad_trustfile'])
 
-        # Non-SSL enabled listener should fail SSL connections.
-        do_test(none, [])
-        self.assertRaises(AssertionError, do_test, none_s, [])
-        self.assertRaises(AssertionError, do_test, none, client_cert)
-
-        # Strict SSL listener, SSL only
-        self.assertRaises(AssertionError, do_test, strict, [])
-        do_test(strict_s, [])
-        do_test(strict_s, client_cert_all)
-        do_test(strict, client_cert_all)
-        do_test(strict, trustfile)
-        do_test(strict, trustfile + client_cert_all)
-        self.assertRaises(AssertionError, do_test, strict, bad_trustfile)
-
-        # Requre-auth SSL listener
-        self.assertRaises(AssertionError, do_test, auth, [])
-        self.assertRaises(AssertionError, do_test, auth_s, [])
-        self.assertRaises(AssertionError, do_test, auth, trustfile)
-        do_test(auth, client_cert_all)
-        do_test(auth, client_cert_all + trustfile)
-        self.assertRaises(AssertionError, do_test, auth, client_cert_all + bad_trustfile)
-
-        # Unsecured SSL listener, allows non-SSL
-        do_test(unsecured_s, [])
-        do_test(unsecured_s, client_cert_all)
-        do_test(unsecured_s, trustfile)
-        do_test(unsecured_s, client_cert_all + trustfile)
-        do_test(unsecured_s, [])
-        do_test(unsecured, []) # Allow unsecured
-        self.assertRaises(AssertionError, do_test, auth, client_cert_all + bad_trustfile)
 
 if __name__ == '__main__':
     unittest.main(system_test.main_module())



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message