Best Python code snippet using tempest_python
test_migrations.py
Source:test_migrations.py
...72 waiters.wait_for_server_status(self.servers_client, server['id'],73 'VERIFY_RESIZE')74 # Now revert the resize, it should be OK even though the original75 # flavor used to boot the server was deleted.76 self.servers_client.revert_resize_server(server['id'])77 waiters.wait_for_server_status(self.servers_client, server['id'],78 'ACTIVE')79 server = self.servers_client.show_server(server['id'])['server']80 self.assertEqual(flavor['id'], server['flavor']['id'])81 def _test_cold_migrate_server(self, revert=False):82 if CONF.compute.min_compute_nodes < 2:83 msg = "Less than 2 compute nodes, skipping multinode tests."84 raise self.skipException(msg)85 server = self.create_test_server(wait_until="ACTIVE")86 src_host = self.admin_servers_client.show_server(87 server['id'])['server']['OS-EXT-SRV-ATTR:host']88 self.admin_servers_client.migrate_server(server['id'])89 waiters.wait_for_server_status(self.servers_client,90 server['id'], 'VERIFY_RESIZE')91 if revert:92 self.servers_client.revert_resize_server(server['id'])93 assert_func = self.assertEqual94 else:95 self.servers_client.confirm_resize_server(server['id'])96 assert_func = self.assertNotEqual97 waiters.wait_for_server_status(self.servers_client,98 server['id'], 'ACTIVE')99 dst_host = self.admin_servers_client.show_server(100 server['id'])['server']['OS-EXT-SRV-ATTR:host']101 assert_func(src_host, dst_host)102 @decorators.idempotent_id('4bf0be52-3b6f-4746-9a27-3143636fe30d')103 @testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,104 'Cold migration not available.')105 def test_cold_migration(self):106 self._test_cold_migrate_server(revert=False)...
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!!