Skip to content

Commit 899c5c7

Browse files
borisstoyanovRohit Yadav
authored andcommitted
CLOUDSTACK-10014: fix components/test_accounts.py test_user_key_renew_same_account: use new api getUserKeys to get secrett key
1 parent 055ae07 commit 899c5c7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/integration/component/test_accounts.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from marvin.cloudstackTestCase import cloudstackTestCase
2121
from marvin.lib.utils import (random_gen,
2222
cleanup_resources)
23+
from marvin.cloudstackAPI import *
2324
from marvin.lib.base import (Domain,
2425
Account,
2526
ServiceOffering,
@@ -43,6 +44,8 @@
4344
from marvin.cloudstackException import CloudstackAPIException
4445
import time
4546

47+
from pyVmomi.VmomiSupport import GetVersionFromVersionUri
48+
4649

4750
class 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

Comments
 (0)