How to use mount_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

...81 self.assertEqual(data, result['password'])82 def verify_metadata_on_config_drive(self):83 if self.run_ssh and CONF.compute_feature_enabled.config_drive:84 # Verify metadata on config_drive85 self.ssh_client.mount_config_drive()86 cmd_md = 'sudo cat /mnt/openstack/latest/meta_data.json'87 result = self.ssh_client.exec_command(cmd_md)88 self.ssh_client.unmount_config_drive()89 result = json.loads(result)90 self.assertIn('meta', result)91 msg = ('Failed while verifying metadata on config_drive on server.'92 ' Result of command "%s" is NOT "%s".' % (cmd_md, self.md))93 self.assertEqual(self.md, result['meta'], msg)94 def verify_networkdata_on_config_drive(self):95 if self.run_ssh and CONF.compute_feature_enabled.config_drive:96 # Verify network data on config_drive97 self.ssh_client.mount_config_drive()98 cmd_md = 'sudo cat /mnt/openstack/latest/network_data.json'99 result = self.ssh_client.exec_command(cmd_md)100 self.ssh_client.unmount_config_drive()101 result = json.loads(result)102 self.assertIn('services', result)103 self.assertIn('links', result)104 self.assertIn('networks', result)105 # TODO(clarkb) construct network_data from known network106 # instance info and do direct comparison.107 @decorators.idempotent_id('7fff3fb3-91d8-4fd0-bd7d-0204f1f180ba')108 @decorators.attr(type='smoke')109 @utils.services('compute', 'network')110 def test_server_basic_ops(self):111 keypair = self.create_keypair()112 security_group = self._create_security_group()113 self.md = {'meta1': 'data1', 'meta2': 'data2', 'metaN': 'dataN'}114 self.instance = self.create_server(...

Full Screen

Full Screen

test_config_drive_directory_structure.py

Source:test_config_drive_directory_structure.py Github

copy

Full Screen

...40 def test_create_server_config_drive_openstack_directory(self):41 """Verify that config drive can be mounted"""42 remote_client = self.server_behaviors.get_remote_instance_client(43 self.server, self.servers_config, key=self.key.private_key)44 self.config_drive_behaviors.mount_config_drive(45 server=self.server, servers_config=self.servers_config,46 key=self.key.private_key,47 source_path=self.config_drive_config.mount_source_path,48 destination_path=self.config_drive_config.base_path_to_mount)49 dir_openstack_present = remote_client.is_directory_present(50 directory_path='{0}/openstack/latest'.format(51 self.config_drive_config.base_path_to_mount))52 self.assertTrue(dir_openstack_present,53 msg="Directory Openstack is present")54 dir_openstack_content_present = remote_client.is_directory_present(55 directory_path='{0}/openstack/content'.format(56 self.config_drive_config.base_path_to_mount))57 self.assertTrue(dir_openstack_content_present,58 msg="Directory Openstack is present")59 @tags(type='smoke', net='yes')60 def test_create_server_config_drive_ec2_directory(self):61 """Verify that config drive can be mounted"""62 remote_client = self.server_behaviors.get_remote_instance_client(63 self.server, self.servers_config, key=self.key.private_key)64 self.config_drive_behaviors.mount_config_drive(65 server=self.server, servers_config=self.servers_config,66 key=self.key.private_key,67 source_path=self.config_drive_config.mount_source_path,68 destination_path=self.config_drive_config.base_path_to_mount)69 dir_openstack_present = remote_client.is_directory_present(70 directory_path='{0}/ec2/latest'.format(71 self.config_drive_config.base_path_to_mount))72 self.assertTrue(dir_openstack_present,73 msg="Directory Openstack is present")74 @tags(type='smoke', net='yes')75 def test_create_server_config_drive_user_data_not_present(self):76 """Verify that user_data is empty as expected"""77 remote_client = self.server_behaviors.get_remote_instance_client(78 self.server, self.servers_config, key=self.key.private_key)79 self.config_drive_behaviors.mount_config_drive(80 server=self.server, servers_config=self.servers_config,81 key=self.key.private_key,82 source_path=self.config_drive_config.mount_source_path,83 destination_path=self.config_drive_config.base_path_to_mount)84 with self.assertRaises(FileNotFoundException):85 remote_client.get_file_details(...

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