How to use test_show_host_detail method in tempest

Best Python code snippet using tempest_python

test_hosts.py

Source:test_hosts.py Github

copy

Full Screen

...44 # successful and no hosts will be retured45 hosts = self.client.list_hosts(zone='xxx')['hosts']46 self.assertEqual(0, len(hosts))47 @test.idempotent_id('38adbb12-aee2-4498-8aec-329c72423aa4')48 def test_show_host_detail(self):49 hosts = self.client.list_hosts()['hosts']50 hosts = [host for host in hosts if host['service'] == 'compute']51 self.assertTrue(len(hosts) >= 1)52 for host in hosts:53 hostname = host['host_name']54 resources = self.client.show_host(hostname)['host']55 self.assertTrue(len(resources) >= 1)56 host_resource = resources[0]['resource']57 self.assertIsNotNone(host_resource)58 self.assertIsNotNone(host_resource['cpu'])59 self.assertIsNotNone(host_resource['disk_gb'])60 self.assertIsNotNone(host_resource['memory_mb'])61 self.assertIsNotNone(host_resource['project'])62 self.assertEqual(hostname, host_resource['host'])

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