2020from marvin .cloudstackTestCase import cloudstackTestCase
2121from marvin .lib .utils import (random_gen ,
2222 cleanup_resources )
23+ from marvin .cloudstackAPI import *
2324from marvin .lib .base import (Domain ,
2425 Account ,
2526 ServiceOffering ,
4344from marvin .cloudstackException import CloudstackAPIException
4445import time
4546
47+ from pyVmomi .VmomiSupport import GetVersionFromVersionUri
48+
4649
4750class Services :
4851
@@ -1653,6 +1656,11 @@ def test_user_key_renew_same_account(self):
16531656 user .apikey ,
16541657 userkeys .apikey ,
16551658 "Check User api key" )
1659+ user .secretkey = self .get_secret_key (user .id )
1660+ self .assertEqual (
1661+ user .secretkey ,
1662+ userkeys .secretkey ,
1663+ "Check User having secret key" )
16561664
16571665 self .debug ("Get test client with user keys" )
16581666 cs_api = self .testClient .getUserApiClient (
@@ -1664,6 +1672,17 @@ def test_user_key_renew_same_account(self):
16641672 userkeys .apikey ,
16651673 new_keys .apikey ,
16661674 "Check API key is different" )
1675+ new_keys .secretkey = self .get_secret_key (user_1 .id )
1676+ self .assertNotEqual (
1677+ userkeys .secretkey ,
1678+ new_keys .secretkey ,
1679+ "Check secret key is different" )
1680+
1681+ def get_secret_key (self , id ):
1682+ cmd = getUserKeys .getUserKeysCmd ()
1683+ cmd .id = id
1684+ keypair = self .apiclient .getUserKeys (cmd )
1685+ return keypair .secretkey
16671686
16681687 @attr (tags = [
16691688 "role" ,
@@ -2062,3 +2081,4 @@ def test_DeleteDomain(self):
20622081 with self .assertRaises (Exception ):
20632082 domain .delete (self .apiclient , cleanup = False )
20642083 return
2084+
0 commit comments