Skip to content

Commit bf11676

Browse files
test: fix component test test_acl_sharednetwork_deployVM-impersonation.py (#9499)
1 parent 21f3fde commit bf11676

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

test/integration/component/test_acl_sharednetwork_deployVM-impersonation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_all_ROOTuser(self):
11711171
self.fail("Domain admin is NOT able to deploy a VM for user in ROOT domain in a shared network with scope=all")
11721172
except Exception as e:
11731173
self.debug("When a Domain admin user deploys a VM for ROOT user in a shared network with scope=all %s" % e)
1174-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1174+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
11751175
self.fail("Error message validation failed when Domain admin is NOT able to deploy a VM for user in ROOT domain in a shared network with scope=all")
11761176

11771177
@attr("simulator_only", tags=["advanced"], required_hardware="false")
@@ -1199,7 +1199,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_all_crossdomainuser(self
11991199
self.fail("Domain admin user is able to Deploy VM for a domain user, but there is no access to in a shared network with scope=domain with no subdomain access ")
12001200
except Exception as e:
12011201
self.debug("When a Domain admin user deploys a VM for a domain user, but there is no access to in a shared network with scope=domain with no subdomain access %s" % e)
1202-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1202+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
12031203
self.fail(
12041204
"Error mesage validation failed when Domain admin user tries to Deploy VM for a domain user, but there is no access to in a shared network with scope=domain with no subdomain access ")
12051205

@@ -1405,7 +1405,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_domain_nosubdomainaccess
14051405
self.fail("Domain admin is able to deploy a VM for user in ROOT domain in a shared network with scope=Domain and no subdomain access")
14061406
except Exception as e:
14071407
self.debug("When a regular user from ROOT domain deploys a VM in a shared network with scope=domain with no subdomain access %s" % e)
1408-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1408+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
14091409
self.fail(
14101410
"Error message validation failed when Domain admin tries to deploy a VM for user in ROOT domain in a shared network with scope=Domain and no subdomain access")
14111411

@@ -1601,7 +1601,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_domain_withsubdomainacce
16011601
self.fail("Domain admin is able to deploy a VM for user in ROOT domain in a shared network with scope=Domain and subdomain access")
16021602
except Exception as e:
16031603
self.debug("When a user from ROOT domain deploys a VM in a shared network with scope=domain with subdomain access %s" % e)
1604-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1604+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
16051605
self.fail(
16061606
"Error message validation failed when Domain admin tries to deploy a VM for user in ROOT domain in a shared network with scope=Domain and subdomain access")
16071607

@@ -1717,7 +1717,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_account_differentdomain(
17171717
self.fail("Domain admin is able to deploy a VM for an regular user from a differnt domain in a shared network with scope=account")
17181718
except Exception as e:
17191719
self.debug("When a user from different domain deploys a VM in a shared network with scope=account %s" % e)
1720-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1720+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
17211721
self.fail(
17221722
"Error message validation failed when Domain admin tries to deploy a VM for an regular user from a differnt domain in a shared network with scope=account")
17231723

@@ -1746,7 +1746,7 @@ def test_deployVM_in_sharedNetwork_as_domainadmin_scope_account_ROOTuser(self):
17461746
self.fail("Domain admin is able to deploy a VM for an regular user in ROOT domain in a shared network with scope=account")
17471747
except Exception as e:
17481748
self.debug("When a user from ROOT domain deploys a VM in a shared network with scope=account %s" % e)
1749-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN):
1749+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
17501750
self.fail("Error message validation failed when Domain admin tries to deploy a VM for an regular user in ROOT domain in a shared network with scope=account")
17511751

17521752
## Test cases relating to deploying Virtual Machine as Regular user for other users in shared network with scope=all
@@ -1776,7 +1776,7 @@ def test_deployVM_in_sharedNetwork_as_regularuser_scope_all_anotherusersamedomai
17761776
self.fail("Regular user is allowed to deploy a VM for another user in the same domain in a shared network with scope=all")
17771777
except Exception as e:
17781778
self.debug("When a regular user deploys a VM for another user in the same domain in a shared network with scope=all %s" % e)
1779-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT):
1779+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
17801780
self.fail("Error message validation failed when Regular user tries to deploy a VM for another user in the same domain in a shared network with scope=all")
17811781

17821782
@attr("simulator_only", tags=["advanced"], required_hardware="false")
@@ -1804,7 +1804,7 @@ def test_deployVM_in_sharedNetwork_as_regularuser_scope_all_crossdomain(self):
18041804
self.fail("Regular user is allowed to deploy a VM for another user in the same domain in a shared network with scope=all")
18051805
except Exception as e:
18061806
self.debug("When a regular user deploys a VM for another user in the same domain in a shared network with scope=all %s" % e)
1807-
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT):
1807+
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
18081808
self.fail("Error message validation failed when Regular user tries to deploy a VM for another user in the same domain in a shared network with scope=all")
18091809

18101810
@staticmethod

tools/marvin/marvin/cloudstackException.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class CloudstackAclException():
7777
UNABLE_TO_LIST_NETWORK_ACCOUNT = "Can't create/list resources for account"
7878
NO_PERMISSION_TO_ACCESS_ACCOUNT = "does not have permission to access resource Acct"
7979
NOT_AVAILABLE_IN_DOMAIN = "not available in domain"
80+
NO_PERMISSION_TO_OPERATE_SOURCE = "does not have permission to operate with provided resource"
8081

8182
@staticmethod
8283
def verifyMsginException(e,message):

0 commit comments

Comments
 (0)