You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2018/01/24 22:02:45 UTC
qpid-dispatch git commit: DISPATCH-916 - Honor the type argument to
qdmanage get-attributes and get-operations
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 765d663e0 -> cf10d5c15
DISPATCH-916 - Honor the type argument to qdmanage get-attributes and get-operations
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/cf10d5c1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/cf10d5c1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/cf10d5c1
Branch: refs/heads/master
Commit: cf10d5c15f78ae3d771b8ba67dee209041233f5d
Parents: 765d663
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Fri Jan 19 11:09:36 2018 -0500
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Wed Jan 24 16:55:31 2018 -0500
----------------------------------------------------------------------
tests/system_tests_qdmanage.py | 34 ++++++++++++++++++++++++++++++++++
tools/qdmanage | 13 +++++++++----
2 files changed, 43 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/cf10d5c1/tests/system_tests_qdmanage.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index 9c73db6..e4c50c7 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -179,6 +179,40 @@ class QdmanageTest(TestCase):
out = json.loads(self.run_qdmanage("get-types"))
self.assertEqual(len(out), 26)
+ def test_get_attributes(self):
+ out = json.loads(self.run_qdmanage("get-attributes"))
+ self.assertEqual(len(out), 26)
+
+ def test_get_operations(self):
+ out = json.loads(self.run_qdmanage("get-operations"))
+ self.assertEqual(len(out), 26)
+ self.assertEqual(out['org.apache.qpid.dispatch.sslProfile'], [u'CREATE', u'DELETE', u'READ'])
+
+ def test_get_types_with_ssl_profile_type(self):
+ out = json.loads(self.run_qdmanage("get-types --type=org.apache.qpid.dispatch.sslProfile"))
+ self.assertEqual(out['org.apache.qpid.dispatch.sslProfile'], [u'org.apache.qpid.dispatch.configurationEntity', u'org.apache.qpid.dispatch.entity'])
+
+ def test_get_ssl_profile_type_attributes(self):
+ out = json.loads(self.run_qdmanage('get-attributes --type=org.apache.qpid.dispatch.sslProfile'))
+ self.assertEqual(len(out), 1)
+ self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 12)
+
+ def test_get_ssl_profile_attributes(self):
+ out = json.loads(self.run_qdmanage('get-attributes org.apache.qpid.dispatch.sslProfile'))
+ self.assertEqual(len(out), 1)
+ self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 12)
+
+ def test_get_ssl_profile_type_operations(self):
+ out = json.loads(self.run_qdmanage('get-operations --type=org.apache.qpid.dispatch.sslProfile'))
+ self.assertEqual(len(out), 1)
+ self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 3)
+
+ def test_get_ssl_profile_operations(self):
+ out = json.loads(self.run_qdmanage('get-operations org.apache.qpid.dispatch.sslProfile'))
+ self.assertEqual(len(out), 1)
+ self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 3)
+
+
def test_get_log(self):
log = json.loads(self.run_qdmanage("get-log limit=1"))[0]
self.assertEquals(['AGENT', 'trace'], log[0:2])
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/cf10d5c1/tools/qdmanage
----------------------------------------------------------------------
diff --git a/tools/qdmanage b/tools/qdmanage
index 33c1756..35b4485 100755
--- a/tools/qdmanage
+++ b/tools/qdmanage
@@ -87,6 +87,7 @@ class QdManage():
self.node = Node.connect(opts_url(self.opts), self.opts.router, self.opts.timeout,
opts_ssl_domain(self.opts),
opts_sasl(self.opts))
+
operation = self.args.pop(0)
method = operation.lower().replace('-','_')
if operation.upper() in self.operations and hasattr(self, method):
@@ -182,22 +183,26 @@ class QdManage():
def get_types(self):
"""get-types [TYPE] List entity types with their base types."""
- self.opts.type = check_args(self.args, 1)[0]
+ if not self.opts.type:
+ self.opts.type = check_args(self.args, 1)[0]
self.print_json(self.call_node('get_types', 'type'))
def get_annotations(self):
"""get-annotations [TYPE] List entity types with the annotations they implement."""
- self.opts.type = check_args(self.args, 1)[0]
+ if not self.opts.type:
+ self.opts.type = check_args(self.args, 1)[0]
self.print_json(self.call_node('get_annotations', 'type'))
def get_attributes(self):
"""get-attributes [TYPE] List entity types with their attributes."""
- self.opts.type = check_args(self.args, 1)[0]
+ if not self.opts.type:
+ self.opts.type = check_args(self.args, 1)[0]
self.print_json(self.call_node('get_attributes', 'type'))
def get_operations(self):
"""get-operations [TYPE] List entity types with their operations."""
- self.opts.type = check_args(self.args, 1)[0]
+ if not self.opts.type:
+ self.opts.type = check_args(self.args, 1)[0]
self.print_json(self.call_node('get_operations', 'type'))
def get_mgmt_nodes(self):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org