summaryrefslogtreecommitdiffstats
path: root/base/kra
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-02-20 17:26:24 -0500
committerAde Lee <alee@redhat.com>2014-02-26 01:17:29 -0500
commit0900a0a7e12064171d60345f448b983e91b56239 (patch)
tree33181ed8a6f1cf28353b1ceb81315f884c684e54 /base/kra
parent640584b8047126b7892e8c635063df4ea11c1faa (diff)
downloadpki-0900a0a7e12064171d60345f448b983e91b56239.tar.gz
pki-0900a0a7e12064171d60345f448b983e91b56239.tar.xz
pki-0900a0a7e12064171d60345f448b983e91b56239.zip
Add getActiveKey() to the python client
Diffstat (limited to 'base/kra')
-rw-r--r--base/kra/functional/drmtest.py15
1 files changed, 14 insertions, 1 deletions
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()