How to use create_namespace_tag method in tempest

Best Python code snippet using tempest_python

test_image_namespace_tags_rbac.py

Source:test_image_namespace_tags_rbac.py Github

copy

Full Screen

...33 cls.__name__ + '-namespace'))['namespace']34 cls.addClassResourceCleanup(35 cls.namespaces_client.delete_namespace,36 cls.namespace)37 def _create_namespace_tag(self, multiple=False):38 tag_count = 2 if multiple else 139 namespace_tag_names = []40 for i in range(tag_count):41 tag_name = data_utils.rand_name(self.__class__.__name__ + '-tag')42 namespace_tag_names.append({'name': tag_name})43 if multiple:44 namespace_tags = self.namespace_tags_client.create_namespace_tags(45 self.namespace, tags=namespace_tag_names)['tags']46 else:47 namespace_tags = self.namespace_tags_client.create_namespace_tag(48 self.namespace, namespace_tag_names[0]['name'])49 self.addCleanup(test_utils.call_and_ignore_notfound_exc,50 self.namespace_tags_client.delete_namespace_tags,51 self.namespace)52 return [nt['name'] for nt in namespace_tags] if multiple \53 else namespace_tags['name']54 @decorators.idempotent_id('50bedccb-9d0b-4138-8d95-31a89250edf6')55 @rbac_rule_validation.action(service="glance",56 rules=["add_metadef_tag"])57 def test_create_namespace_tag(self):58 with self.override_role():59 self._create_namespace_tag()60 @decorators.idempotent_id('4acf70cc-05da-4b1e-87b2-d5e4475164e7')61 @rbac_rule_validation.action(service="glance",62 rules=["get_metadef_tag"])63 def test_show_namespace_tag(self):64 tag_name = self._create_namespace_tag()65 with self.override_role():66 self.namespace_tags_client.show_namespace_tag(self.namespace,67 tag_name)68 @decorators.idempotent_id('01593828-3edb-461e-8abc-8fdeb3927e37')69 @rbac_rule_validation.action(service="glance",70 rules=["modify_metadef_tag"])71 def test_update_namespace_tag(self):72 tag_name = self._create_namespace_tag()73 updated_tag_name = data_utils.rand_name(74 self.__class__.__name__ + '-tag')75 with self.override_role():76 self.namespace_tags_client.update_namespace_tag(77 self.namespace, tag_name, name=updated_tag_name)78 @decorators.idempotent_id('20ffaf76-ebdc-4267-a1ad-194346f5cc91')79 @rbac_rule_validation.action(service="glance",80 rules=["add_metadef_tags"])81 def test_create_namespace_tags(self):82 with self.override_role():83 self._create_namespace_tag(multiple=True)84 @decorators.idempotent_id('d37c1501-e787-449d-89b3-754a942a459a')85 @rbac_rule_validation.action(service="glance",86 rules=["get_metadef_tags"])87 def test_list_namespace_tags(self):88 with self.override_role():...

Full Screen

Full Screen

test_images_metadefs_namespace_tags.py

Source:test_images_metadefs_namespace_tags.py Github

copy

Full Screen

...59 namespace = self.create_namespace()60 self._create_namespace_tags(namespace)61 # Create a tag62 tag_name = data_utils.rand_name('tag_name')63 self.namespace_tags_client.create_namespace_tag(64 namespace=namespace['namespace'], tag_name=tag_name)65 body = self.namespace_tags_client.show_namespace_tag(66 namespace['namespace'], tag_name)67 self.assertEqual(tag_name, body['name'])68 # Update tag definition69 update_tag_definition = data_utils.rand_name('update-tag')70 body = self.namespace_tags_client.update_namespace_tag(71 namespace['namespace'], tag_name=tag_name,72 name=update_tag_definition)73 self.assertEqual(update_tag_definition, body['name'])74 # Delete tag definition75 self.namespace_tags_client.delete_namespace_tag(76 namespace['namespace'], update_tag_definition)77 # List namespace tags and validate deletion...

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