You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2020/08/04 18:57:50 UTC

[qpid-dispatch] 04/32: Dataplane: Improved sasl-plain test by using symbolic attribute names, not positional indices.

This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 4c7b94dca62e7e2a78ad71eda93fa3cf9b611895
Author: Ted Ross <tr...@apache.org>
AuthorDate: Tue Jun 2 08:08:54 2020 -0400

    Dataplane: Improved sasl-plain test by using symbolic attribute names, not positional indices.
---
 tests/system_tests_sasl_plain.py | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py
index ff6c5d0..8283250 100644
--- a/tests/system_tests_sasl_plain.py
+++ b/tests/system_tests_sasl_plain.py
@@ -505,19 +505,19 @@ class RouterTestPlainSaslOverSsl(RouterTestPlainSaslCommon):
 
         """
         local_node = Node.connect(self.routers[0].addresses[1], timeout=TIMEOUT)
-        results = local_node.query(type='org.apache.qpid.dispatch.connection').results
+        results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities()
 
         # sslProto should be TLSv1.x
-        self.assertTrue(u'TLSv1' in results[0][10])
+        self.assertTrue(u'TLSv1' in results[0].sslProto)
 
         # role should be inter-router
-        self.assertEqual(u'inter-router', results[0][3])
+        self.assertEqual(u'inter-router', results[0].role)
 
         # sasl must be plain
-        self.assertEqual(u'PLAIN', results[0][6])
+        self.assertEqual(u'PLAIN', results[0].sasl)
 
         # user must be test@domain.com
-        self.assertEqual(u'test@domain.com', results[0][8])
+        self.assertEqual(u'test@domain.com', results[0].user)
 
 
 class RouterTestVerifyHostNameYes(RouterTestPlainSaslCommon):
@@ -604,15 +604,16 @@ class RouterTestVerifyHostNameYes(RouterTestPlainSaslCommon):
         due to setting 'verifyHostname': 'yes'
         """
         local_node = Node.connect(self.routers[1].addresses[0], timeout=TIMEOUT)
-        results = local_node.query(type='org.apache.qpid.dispatch.connection').results
+        results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities()
+
         # There should be only two connections.
         # There will be no inter-router connection
         self.assertEqual(2, len(results))
-        self.assertEqual('in', results[0][4])
-        self.assertEqual('normal', results[0][3])
-        self.assertEqual('anonymous', results[0][8])
-        self.assertEqual('normal', results[1][3])
-        self.assertEqual('anonymous', results[1][8])
+        self.assertEqual('in', results[0].dir)
+        self.assertEqual('normal', results[0].role)
+        self.assertEqual('anonymous', results[0].user)
+        self.assertEqual('normal', results[1].role)
+        self.assertEqual('anonymous', results[1].user)
 
 class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
 
@@ -700,23 +701,23 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
         found = False
 
         for N in range(0, len(results)):
-            if results[N][5] == search:
+            if results[N].container == search:
                 found = True
                 break
 
         self.assertTrue(found, "Connection to %s not found" % search)
 
         # sslProto should be TLSv1.x
-        self.assertTrue(u'TLSv1' in results[N][10])
+        self.assertTrue(u'TLSv1' in results[N].sslProto)
 
         # role should be inter-router
-        self.assertEqual(u'inter-router', results[N][3])
+        self.assertEqual(u'inter-router', results[N].role)
 
         # sasl must be plain
-        self.assertEqual(u'PLAIN', results[N][6])
+        self.assertEqual(u'PLAIN', results[N].sasl)
 
         # user must be test@domain.com
-        self.assertEqual(u'test@domain.com', results[N][8])
+        self.assertEqual(u'test@domain.com', results[N].user)
 
     @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
     def test_inter_router_plain_over_ssl_exists(self):
@@ -725,7 +726,7 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
         """
         local_node = Node.connect(self.routers[1].addresses[0], timeout=TIMEOUT)
 
-        results = local_node.query(type='org.apache.qpid.dispatch.connection').results
+        results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities()
 
         self.common_asserts(results)
 
@@ -763,7 +764,7 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
                      'saslUsername': 'test@domain.com',
                      'saslPassword': 'password'})
         self.routers[1].wait_connectors()
-        results = local_node.query(type='org.apache.qpid.dispatch.connection').results
+        results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities()
 
         self.common_asserts(results)
 


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