How to use verify_networkdata_on_config_drive method in tempest

Best Python code snippet using tempest_python

test_server_basic_ops.py

Source:test_server_basic_ops.py Github

copy

Full Screen

...83 self.assertIn('meta', result)84 msg = ('Failed while verifying metadata on config_drive on server.'85 ' Result of command "%s" is NOT "%s".' % (cmd_md, self.md))86 self.assertEqual(self.md, result['meta'], msg)87 def verify_networkdata_on_config_drive(self):88 if self.run_ssh and CONF.compute_feature_enabled.config_drive:89 # Verify network data on config_drive90 self._mount_config_drive()91 cmd_md = 'sudo cat /mnt/openstack/latest/network_data.json'92 result = self.ssh_client.exec_command(cmd_md)93 self._unmount_config_drive()94 result = json.loads(result)95 self.assertIn('services', result)96 self.assertIn('links', result)97 self.assertIn('networks', result)98 # TODO(clarkb) construct network_data from known network99 # instance info and do direct comparison.100 @test.idempotent_id('7fff3fb3-91d8-4fd0-bd7d-0204f1f180ba')101 @test.attr(type='smoke')102 @test.services('compute', 'network')103 def test_server_basic_ops(self):104 keypair = self.create_keypair()105 security_group = self._create_security_group()106 self.md = {'meta1': 'data1', 'meta2': 'data2', 'metaN': 'dataN'}107 self.instance = self.create_server(108 image_id=self.image_ref,109 flavor=self.flavor_ref,110 key_name=keypair['name'],111 security_groups=[{'name': security_group['name']}],112 config_drive=CONF.compute_feature_enabled.config_drive,113 metadata=self.md,114 wait_until='ACTIVE')115 self.verify_ssh(keypair)116 self.verify_metadata()117 self.verify_metadata_on_config_drive()118 self.verify_networkdata_on_config_drive()...

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