How to use verify_glance_api_versions method in tempest

Best Python code snippet using tempest_python

verify_tempest_config.py

Source:verify_tempest_config.py Github

copy

Full Screen

...22 'disk_config': 'DiskConfig',23 'change_password': 'ServerPassword',24 'flavor_extra': 'FlavorExtraSpecs'25}26def verify_glance_api_versions(os):27 # Check glance api versions28 __, versions = os.image_client.get_versions()29 if CONF.image_feature_enabled.api_v1 != ('v1.1' in versions or 'v1.0' in30 versions):31 print('Config option image api_v1 should be change to: %s' % (32 not CONF.image_feature_enabled.api_v1))33 if CONF.image_feature_enabled.api_v2 != ('v2.0' in versions):34 print('Config option image api_v2 should be change to: %s' % (35 not CONF.image_feature_enabled.api_v2))36def verify_extensions(os):37 results = {}38 extensions_client = os.extensions_client39 __, resp = extensions_client.list_extensions()40 resp = resp['extensions']41 extensions = map(lambda x: x['name'], resp)42 results['nova_features'] = {}43 for extension in NOVA_EXTENSIONS.keys():44 if NOVA_EXTENSIONS[extension] in extensions:45 results['nova_features'][extension] = True46 else:47 results['nova_features'][extension] = False48 return results49def display_results(results):50 for option in NOVA_EXTENSIONS.keys():51 config_value = getattr(CONF.compute_feature_enabled, option)52 if config_value != results['nova_features'][option]:53 print("Config option: %s should be changed to: %s" % (54 option, not config_value))55def main(argv):56 os = clients.ComputeAdminManager(interface='json')57 results = verify_extensions(os)58 verify_glance_api_versions(os)59 display_results(results)60if __name__ == "__main__":...

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