Best Python code snippet using tempest_python
test_disk_config.py
Source:test_disk_config.py
...83 self.client.resize_server(self.server_id, flavor_id,84 disk_config='AUTO')85 waiters.wait_for_server_status(self.client, self.server_id,86 'VERIFY_RESIZE')87 self.client.confirm_resize_server(self.server_id)88 waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')89 server = self.client.show_server(self.server_id)['server']90 self.assertEqual('AUTO', server['OS-DCF:diskConfig'])91 @test.idempotent_id('693d16f3-556c-489a-8bac-3d0ca2490bad')92 @testtools.skipUnless(CONF.compute_feature_enabled.resize,93 'Resize not available.')94 def test_resize_server_from_auto_to_manual(self):95 # A server should be resized from auto to manual disk config96 self._update_server_with_disk_config(disk_config='AUTO')97 # Resize with manual option98 flavor_id = self._get_alternative_flavor()99 self.client.resize_server(self.server_id, flavor_id,100 disk_config='MANUAL')101 waiters.wait_for_server_status(self.client, self.server_id,102 'VERIFY_RESIZE')103 self.client.confirm_resize_server(self.server_id)104 waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')105 server = self.client.show_server(self.server_id)['server']106 self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])107 @test.idempotent_id('5ef18867-358d-4de9-b3c9-94d4ba35742f')108 def test_update_server_from_auto_to_manual(self):109 # A server should be updated from auto to manual disk config110 self._update_server_with_disk_config(disk_config='AUTO')111 # Update the disk_config attribute to manual112 server = self.client.update_server(self.server_id,113 disk_config='MANUAL')['server']114 waiters.wait_for_server_status(self.client, server['id'], 'ACTIVE')115 # Verify the disk_config attribute is set correctly116 server = self.client.show_server(server['id'])['server']117 self.assertEqual('MANUAL', server['OS-DCF:diskConfig'])
migrate.py
Source:migrate.py
...26 def _migrate_server(self, server_tuple):27 server = server_tuple.server28 self.admin_servers_client.migrate_server(server['id'])29 self._wait_for_server_status(server, 'VERIFY_RESIZE')30 self.servers_client.confirm_resize_server(server['id'])31 @testtools.skipUnless(CONF.compute.min_compute_nodes >= 2,32 'Expected at least 2 compute nodes.')33 def test_migration(self):34 server_tuple = self._create_server()35 self._migrate_server(server_tuple)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!