How to use _set_aggregate_metadata method in tempest

Best Python code snippet using tempest_python

test_aggregates_basic_ops.py

Source:test_aggregates_basic_ops.py Github

copy

Full Screen

...66 for meta_key in metadata.keys():67 self.assertIn(meta_key, aggregate['metadata'])68 self.assertEqual(metadata[meta_key],69 aggregate['metadata'][meta_key])70 def _set_aggregate_metadata(self, aggregate, meta):71 _, aggregate = self.aggregates_client.set_metadata(aggregate['id'],72 meta)73 for key, value in meta.items():74 self.assertEqual(meta[key], aggregate['metadata'][key])75 def _update_aggregate(self, aggregate, aggregate_name,76 availability_zone):77 _, aggregate = self.aggregates_client.update_aggregate(78 aggregate['id'], name=aggregate_name,79 availability_zone=availability_zone)80 self.assertEqual(aggregate['name'], aggregate_name)81 self.assertEqual(aggregate['availability_zone'], availability_zone)82 return aggregate83 @test.services('compute')84 def test_aggregate_basic_ops(self):85 self.useFixture(fixtures.LockFixture('availability_zone'))86 az = 'foo_zone'87 aggregate_name = data_utils.rand_name('aggregate-scenario')88 aggregate = self._create_aggregate(name=aggregate_name,89 availability_zone=az)90 metadata = {'meta_key': 'meta_value'}91 self._set_aggregate_metadata(aggregate, metadata)92 host = self._get_host_name()93 self._add_host(aggregate['id'], host)94 self._check_aggregate_details(aggregate, aggregate_name, az, [host],95 metadata)96 aggregate_name = data_utils.rand_name('renamed-aggregate-scenario')97 # Updating the name alone. The az must be specified again otherwise98 # the tempest client would send None in the put body99 aggregate = self._update_aggregate(aggregate, aggregate_name, az)100 new_metadata = {'foo': 'bar'}101 self._set_aggregate_metadata(aggregate, new_metadata)102 self._check_aggregate_details(aggregate, aggregate['name'], az,...

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