test: fix component tests test_acl_isolatednetwork and test_acl_isolatednetwork_delete (#9571)

* test: fix component tests test_acl_isolatednetwork and test_acl_isolatednetwork_delete

* Update test/integration/component/test_acl_isolatednetwork.py
This commit is contained in:
Wei Zhou 2024-08-23 19:27:11 +02:00 committed by GitHub
parent 1a403f1a9d
commit 0597def630
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View File

@ -799,7 +799,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Domain admin is allowed to deploy vm for users not in hos domain ") self.fail("Domain admin is allowed to deploy vm for users not in hos domain ")
except Exception as e: except Exception as e:
self.debug("When Domain admin tries to deploy vm for users in their sub domain %s" % e) self.debug("When Domain admin tries to deploy vm for users in their sub domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Domain admin tries to deploy vm for users not in hos domain ") self.fail("Error message validation failed when Domain admin tries to deploy vm for users not in hos domain ")
@attr("simulator_only", tags=["advanced"], required_hardware="false") @attr("simulator_only", tags=["advanced"], required_hardware="false")
@ -876,7 +876,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Regular user is allowed to deploy vm for other users in their domain ") self.fail("Regular user is allowed to deploy vm for other users in their domain ")
except Exception as e: except Exception as e:
self.debug("When user tries to deploy vm for users in their domain %s" % e) self.debug("When user tries to deploy vm for users in their domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Regular user tries to deploy vm for other users in their domain ") self.fail("Error message validation failed when Regular user tries to deploy vm for other users in their domain ")
@attr("simulator_only", tags=["advanced"], required_hardware="false") @attr("simulator_only", tags=["advanced"], required_hardware="false")
@ -903,7 +903,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Regular user is allowed to deploy vm for users not in their domain ") self.fail("Regular user is allowed to deploy vm for users not in their domain ")
except Exception as e: except Exception as e:
self.debug("When user tries to deploy vm for users n different domain %s" % e) self.debug("When user tries to deploy vm for users n different domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Regular user tries to deploy vm for users not in their domain ") self.fail("Error message validation failed when Regular user tries to deploy vm for users not in their domain ")
@attr("simulator_only", tags=["advanced"], required_hardware="false") @attr("simulator_only", tags=["advanced"], required_hardware="false")
@ -1030,7 +1030,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Domain admin is allowed to restart network for users not in their domain ") self.fail("Domain admin is allowed to restart network for users not in their domain ")
except Exception as e: except Exception as e:
self.debug("When Domain admin tries to restart network for users in their sub domain %s" % e) self.debug("When Domain admin tries to restart network for users in their sub domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Domain admin tries to restart network for users not in their domain ") self.fail("Error message validation failed when Domain admin tries to restart network for users not in their domain ")
## Test cases relating restart network as regular user ## Test cases relating restart network as regular user
@ -1061,7 +1061,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Regular user is allowed to restart network for users in their domain ") self.fail("Regular user is allowed to restart network for users in their domain ")
except Exception as e: except Exception as e:
self.debug("When user tries to restart network for users in their domain %s" % e) self.debug("When user tries to restart network for users in their domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Regular user tries to restart network for users in their domain ") self.fail("Error message validation failed when Regular user tries to restart network for users in their domain ")
@attr("simulator_only", tags=["advanced"], required_hardware="false") @attr("simulator_only", tags=["advanced"], required_hardware="false")
@ -1077,7 +1077,7 @@ class TestIsolatedNetwork(cloudstackTestCase):
self.fail("Regular user is allowed to restart network for users not in their domain ") self.fail("Regular user is allowed to restart network for users not in their domain ")
except Exception as e: except Exception as e:
self.debug("When user tries to restart network for users in other domain %s" % e) self.debug("When user tries to restart network for users in other domain %s" % e)
if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e, CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Regular user is allowed to restart network for users not in their domain ") self.fail("Error message validation failed when Regular user is allowed to restart network for users not in their domain ")
@staticmethod @staticmethod

View File

@ -455,7 +455,7 @@ class TestIsolatedNetworkDelete(cloudstackTestCase):
self.fail("Domain admin is allowed to delete network for users not in their domain ") self.fail("Domain admin is allowed to delete network for users not in their domain ")
except Exception as e: except Exception as e:
self.debug ("When Domain admin tries to delete network for user in a different domain %s" %e) self.debug ("When Domain admin tries to delete network for user in a different domain %s" %e)
if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_DOMAIN): if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Domain admin tries to delete network for users not in their domain ") self.fail("Error message validation failed when Domain admin tries to delete network for users not in their domain ")
## Test cases relating deleting network as regular user ## Test cases relating deleting network as regular user
@ -490,7 +490,7 @@ class TestIsolatedNetworkDelete(cloudstackTestCase):
self.fail("Regular user is allowed to delete network for users in their domain ") self.fail("Regular user is allowed to delete network for users in their domain ")
except Exception as e: except Exception as e:
self.debug ("When user tries to delete network for users in their domain %s" %e) self.debug ("When user tries to delete network for users in their domain %s" %e)
if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Regular user is allowed to delete network for users in their domain ") self.fail("Regular user is allowed to delete network for users in their domain ")
@attr("simulator_only",tags=["advanced"],required_hardware="false") @attr("simulator_only",tags=["advanced"],required_hardware="false")
@ -508,7 +508,7 @@ class TestIsolatedNetworkDelete(cloudstackTestCase):
self.fail("Regular user is allowed to delete network for users not in their domain ") self.fail("Regular user is allowed to delete network for users not in their domain ")
except Exception as e: except Exception as e:
self.debug ("When user tries to delete network for users in other domain %s" %e) self.debug ("When user tries to delete network for users in other domain %s" %e)
if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_ACCOUNT): if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NO_PERMISSION_TO_OPERATE_SOURCE):
self.fail("Error message validation failed when Regular user tries to delete network for users not in their domain ") self.fail("Error message validation failed when Regular user tries to delete network for users not in their domain ")
@staticmethod @staticmethod