From 0900a0a7e12064171d60345f448b983e91b56239 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Thu, 20 Feb 2014 17:26:24 -0500 Subject: Add getActiveKey() to the python client --- base/kra/functional/drmtest.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'base/kra') diff --git a/base/kra/functional/drmtest.py b/base/kra/functional/drmtest.py index f3352b687..f658d06b8 100644 --- a/base/kra/functional/drmtest.py +++ b/base/kra/functional/drmtest.py @@ -167,16 +167,29 @@ def main(): key_info = kraclient.keys.get_key_info(key_id) print_key_info(key_info) - #Test 14: change the key status + # Test 14: get the active key + print "Get the active key for client id: " + client_id + key_info = kraclient.keys.get_active_key_info(client_id) + print_key_info(key_info) + + #Test 15: change the key status print "Change the key status" kraclient.keys.modify_key_status(key_id, "inactive") print_key_info(kraclient.keys.get_key_info(key_id)) + # Test 16: Get key info for non-existent key print "Get key info for non-existent key" try: key_info = kraclient.keys.get_key_info('200004556') except pki.KeyNotFoundException as exc: print "KeyNotFoundException thrown - Code:" + exc.code + " Message: " + exc.message + # Test 17: Get key info for non-existent active key + print "Get non-existent active key" + try: + key_info = kraclient.keys.get_active_key_info(client_id) + except pki.ResourceNotFoundException as exc: + print "ResourceNotFoundException thrown - Code: " + exc.code + "Message: " + exc.message + if __name__ == "__main__": main() -- cgit