How to use cleanup_default_secgroup method in tempest

Best Python code snippet using tempest_python

dynamic_creds.py

Source:dynamic_creds.py Github

copy

Full Screen

...519 # cause "circular dependency". So here just use try...except to520 # ensure tenant deletion without big changes.521 try:522 if self.neutron_available:523 self.cleanup_default_secgroup(524 self.security_groups_admin_client, creds.tenant_id)525 except lib_exc.NotFound:526 LOG.warning("failed to cleanup tenant %s's secgroup",527 creds.tenant_name)528 try:529 self.creds_client.delete_project(creds.tenant_id)530 except lib_exc.NotFound:531 LOG.warning("tenant with name: %s not found for delete",532 creds.tenant_name)533 # if cred is domain scoped, delete ephemeral domain534 # do not delete default domain535 if (hasattr(creds, 'domain_id') and536 creds.domain_id != creds.project_domain_id):537 try:...

Full Screen

Full Screen

cred_provider.py

Source:cred_provider.py Github

copy

Full Screen

...99 return100 @abc.abstractmethod101 def is_role_available(self, role):102 return103 def cleanup_default_secgroup(self, security_group_client, tenant):104 resp_body = security_group_client.list_security_groups(105 tenant_id=tenant,106 name="default")107 secgroups_to_delete = resp_body['security_groups']108 for secgroup in secgroups_to_delete:109 try:110 security_group_client.delete_security_group(secgroup['id'])111 except exceptions.NotFound:112 LOG.warning('Security group %s, id %s not found for clean-up',113 secgroup['name'], secgroup['id'])114class TestResources(object):115 """Readonly Credentials, with network resources added."""116 def __init__(self, credentials):117 self._credentials = credentials...

Full Screen

Full Screen

test_negative_quotas.py

Source:test_negative_quotas.py Github

copy

Full Screen

...43 self.addCleanup(identity.identity_utils(self.os_admin).delete_project,44 self.project['id'])45 def tearDown(self):46 super(QuotasNegativeTest, self).tearDown()47 self.credentials_provider.cleanup_default_secgroup(48 self.os_admin.security_groups_client, self.project['id'])49 @decorators.attr(type=['negative'])50 @decorators.idempotent_id('644f4e1b-1bf9-4af0-9fd8-eb56ac0f51cf')51 def test_network_quota_exceeding(self):52 """Test creating network when exceeding network quota will fail"""53 # Set the network quota to two54 self.admin_quotas_client.update_quotas(self.project['id'], network=2)55 # Create two networks56 n1 = self.admin_networks_client.create_network(57 project_id=self.project['id'])58 self.addCleanup(test_utils.call_and_ignore_notfound_exc,59 self.admin_networks_client.delete_network,60 n1['network']['id'])61 n2 = self.admin_networks_client.create_network(...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful