How to use test_suspend_resume_server method in tempest

Best Python code snippet using tempest_python

test_server_actions.py

Source:test_server_actions.py Github

copy

Full Screen

...197 resp, server = self.client.unpause_server(self.server_id)198 self.assertEqual(202, resp.status)199 self.client.wait_for_server_status(self.server_id, 'ACTIVE')200 @attr(type='gate')201 def test_suspend_resume_server(self):202 resp, server = self.client.suspend_server(self.server_id)203 self.assertEqual(202, resp.status)204 self.client.wait_for_server_status(self.server_id, 'SUSPENDED')205 resp, server = self.client.resume_server(self.server_id)206 self.assertEqual(202, resp.status)207 self.client.wait_for_server_status(self.server_id, 'ACTIVE')208 @attr(type='gate')209 def test_stop_start_server(self):210 resp, server = self.servers_client.stop(self.server_id)211 self.assertEqual(202, resp.status)212 self.servers_client.wait_for_server_status(self.server_id, 'SHUTOFF')213 resp, server = self.servers_client.start(self.server_id)214 self.assertEqual(202, resp.status)215 self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')...

Full Screen

Full Screen

test_suspend_server.py

Source:test_suspend_server.py Github

copy

Full Screen

...24 cls.ping_ip = cls.server.addresses.get_by_name(25 cls.servers_config.network_for_ssh).ipv426 cls.verify_server_reachable(cls.ping_ip)27 @tags(type='smoke', net='no')28 def test_suspend_resume_server(self):29 """Verify that a server can be suspended and then resumed"""30 response = self.admin_servers_client.suspend_server(self.server.id)31 self.assertEqual(response.status_code, 202)32 self.admin_server_behaviors.wait_for_server_status(33 self.server.id, ServerStates.SUSPENDED)34 PingClient.ping_until_unreachable(35 self.ping_ip, timeout=60, interval_time=5)36 response = self.admin_servers_client.resume_server(self.server.id)37 self.assertEqual(response.status_code, 202)38 self.admin_server_behaviors.wait_for_server_status(39 self.server.id, ServerStates.ACTIVE)40 PingClient.ping_until_reachable(41 self.ping_ip, timeout=60, interval_time=5)42 self.assertTrue(self.server_behaviors.get_remote_instance_client(...

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