How to use list_qos_policies method in tempest

Best Python code snippet using tempest_python

test_qos_policy.py

Source:test_qos_policy.py Github

copy

Full Screen

...27 self.policy_name = self.getUniqueString('qos_policy')28 self.addCleanup(self._cleanup_policies)29 def _cleanup_policies(self):30 exception_list = list()31 for policy in self.operator_cloud.list_qos_policies():32 if policy['name'].startswith(self.policy_name):33 try:34 self.operator_cloud.delete_qos_policy(policy['id'])35 except Exception as e:36 exception_list.append(str(e))37 continue38 if exception_list:39 raise OpenStackCloudException('\n'.join(exception_list))40 def test_create_qos_policy_basic(self):41 policy = self.operator_cloud.create_qos_policy(name=self.policy_name)42 self.assertIn('id', policy)43 self.assertEqual(self.policy_name, policy['name'])44 self.assertFalse(policy['shared'])45 self.assertFalse(policy['is_default'])46 def test_create_qos_policy_shared(self):47 policy = self.operator_cloud.create_qos_policy(48 name=self.policy_name, shared=True)49 self.assertIn('id', policy)50 self.assertEqual(self.policy_name, policy['name'])51 self.assertTrue(policy['shared'])52 self.assertFalse(policy['is_default'])53 def test_create_qos_policy_default(self):54 if not self.operator_cloud._has_neutron_extension('qos-default'):55 self.skipTest("'qos-default' network extension not supported "56 "by cloud")57 policy = self.operator_cloud.create_qos_policy(58 name=self.policy_name, default=True)59 self.assertIn('id', policy)60 self.assertEqual(self.policy_name, policy['name'])61 self.assertFalse(policy['shared'])62 self.assertTrue(policy['is_default'])63 def test_update_qos_policy(self):64 policy = self.operator_cloud.create_qos_policy(name=self.policy_name)65 self.assertEqual(self.policy_name, policy['name'])66 self.assertFalse(policy['shared'])67 self.assertFalse(policy['is_default'])68 updated_policy = self.operator_cloud.update_qos_policy(69 policy['id'], shared=True, default=True)70 self.assertEqual(self.policy_name, updated_policy['name'])71 self.assertTrue(updated_policy['shared'])72 self.assertTrue(updated_policy['is_default'])73 def test_list_qos_policies_filtered(self):74 policy1 = self.operator_cloud.create_qos_policy(name=self.policy_name)75 self.assertIsNotNone(policy1)76 policy2 = self.operator_cloud.create_qos_policy(77 name=self.policy_name + 'other')78 self.assertIsNotNone(policy2)79 match = self.operator_cloud.list_qos_policies(80 filters=dict(name=self.policy_name))81 self.assertEqual(1, len(match))...

Full Screen

Full Screen

test_qos.py

Source:test_qos.py Github

copy

Full Screen

...60 assert rse['qos_class'] is None61 def test_qos_policies(self):62 """ QoS (CLIENT): Add QoS policy for RSE """63 self.rse_client.add_qos_policy(self.tmp_rse_name, 'FOO')64 policies = self.rse_client.list_qos_policies(self.tmp_rse_name)65 assert policies == ['FOO']66 self.rse_client.add_qos_policy(self.tmp_rse_name, 'BAR')67 policies = sorted(self.rse_client.list_qos_policies(self.tmp_rse_name))68 assert policies == ['BAR', 'FOO']69 self.rse_client.delete_qos_policy(self.tmp_rse_name, 'BAR')70 policies = self.rse_client.list_qos_policies(self.tmp_rse_name)71 assert policies == ['FOO']72 self.rse_client.delete_qos_policy(self.tmp_rse_name, 'FOO')73 policies = self.rse_client.list_qos_policies(self.tmp_rse_name)...

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