Best Python code snippet using tempest_python
test_backends_capabilities.py
Source: test_backends_capabilities.py
...30 """Test getting backend capabilities"""31 # Check response schema32 self.admin_capabilities_client.show_backend_capabilities(self.hosts[0])33 @staticmethod34 def _change_capabilities_storage_protocol(capabilities):35 """Convert storage_protocol to its canonical version"""36 # List of storage protocols variants defined in cinder.common.constants37 # The canonical name for storage protocol comes first in the list38 VARIANTS = [['iSCSI', 'iscsi'], ['FC', 'fibre_channel', 'fc'],39 ['NFS', 'nfs'], ['NVMe-oF', 'NVMeOF', 'nvmeof']]40 capabilities = sorted(list(capabilities))41 # Cinder Bug #1966103: Some drivers were reporting different strings42 # to represent the same storage protocol. For backward compatibility,43 # the scheduler can handle the variants, but to standardize this for44 # operators (who may need to refer to the protocol in volume-type45 # extra-specs), the get-pools and get-capabilities response was changed46 # to only report the canonical name for a storage protocol, but these47 # 2 REST API call swere not changed simultaneously, so we may or may48 # not get canonical names, so just convert canonical names.49 for item in range(len(capabilities)):50 for variants in VARIANTS:51 if capabilities[item][2] in variants:52 capabilities[item] = (capabilities[item][0],53 capabilities[item][1],54 variants[0])55 return capabilities56 @decorators.idempotent_id('a9035743-d46a-47c5-9cb7-3c80ea16dea0')57 def test_compare_volume_stats_values(self):58 """Test comparing volume stats values59 Compare volume stats between show_backend_capabilities and show_pools.60 """61 VOLUME_STATS = ('vendor_name',62 'volume_backend_name',63 'storage_protocol')64 # Get list backend capabilities using show_pools65 cinder_pools = [66 pool['capabilities'] for pool in67 self.admin_scheduler_stats_client.list_pools(detail=True)['pools']68 ]69 # Get list backends capabilities using show_backend_capabilities70 capabilities = [71 self.admin_capabilities_client.show_backend_capabilities(72 host=host) for host in self.hosts73 ]74 # Returns a tuple of VOLUME_STATS values75 expected_list = self._change_capabilities_storage_protocol(76 map(operator.itemgetter(*VOLUME_STATS), cinder_pools))77 observed_list = self._change_capabilities_storage_protocol(78 map(operator.itemgetter(*VOLUME_STATS), capabilities))...
Check out the latest blogs from LambdaTest on this topic:
These days, development teams depend heavily on feedback from automated tests to evaluate the quality of the system they are working on.
I think that probably most development teams describe themselves as being “agile” and probably most development teams have standups, and meetings called retrospectives.There is also a lot of discussion about “agile”, much written about “agile”, and there are many presentations about “agile”. A question that is often asked is what comes after “agile”? Many testers work in “agile” teams so this question matters to us.
I routinely come across test strategy documents when working with customers. They are lengthy—100 pages or more—and packed with monotonous text that is routinely reused from one project to another. Yawn once more— the test halt and resume circumstances, the defect management procedure, entrance and exit criteria, unnecessary generic risks, and in fact, one often-used model replicates the requirements of textbook testing, from stress to systems integration.
To understand the agile testing mindset, we first need to determine what makes a team “agile.” To me, an agile team continually focuses on becoming self-organized and cross-functional to be able to complete any challenge they may face during a project.
When working on web automation with Selenium, I encountered scenarios where I needed to refresh pages from time to time. When does this happen? One scenario is that I needed to refresh the page to check that the data I expected to see was still available even after refreshing. Another possibility is to clear form data without going through each input individually.
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!