diff --git a/tempest/api/compute/certificates/test_certificates.py b/tempest/api/compute/certificates/test_certificates.py index 0e6c016136..59179310cd 100644 --- a/tempest/api/compute/certificates/test_certificates.py +++ b/tempest/api/compute/certificates/test_certificates.py @@ -21,6 +21,7 @@ CONF = config.CONF class CertificatesV2TestJSON(base.BaseV2ComputeTest): + """Test Certificates API""" @classmethod def skip_checks(cls): @@ -30,10 +31,10 @@ class CertificatesV2TestJSON(base.BaseV2ComputeTest): @decorators.idempotent_id('c070a441-b08e-447e-a733-905909535b1b') def test_create_root_certificate(self): - # create certificates + """Test creating root certificate""" self.certificates_client.create_certificate() @decorators.idempotent_id('3ac273d0-92d2-4632-bdfc-afbc21d4606c') def test_get_root_certificate(self): - # get the root certificate + """Test getting root certificate details""" self.certificates_client.show_certificate('root') diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py index 66abb2168a..8df2e842c3 100644 --- a/tempest/api/compute/keypairs/test_keypairs.py +++ b/tempest/api/compute/keypairs/test_keypairs.py @@ -19,11 +19,16 @@ from tempest.lib import decorators class KeyPairsV2TestJSON(base.BaseKeypairTest): + """Test keypairs API with compute microversion less than 2.2""" + max_microversion = '2.1' @decorators.idempotent_id('1d1dbedb-d7a0-432a-9d09-83f543c3c19b') def test_keypairs_create_list_delete(self): - # Keypairs created should be available in the response list + """Test create/list/delete keypairs + + Keypairs created should be available in the response list + """ # Create 3 keypairs key_list = list() for _ in range(3): @@ -48,7 +53,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest): @decorators.idempotent_id('6c1d3123-4519-4742-9194-622cb1714b7d') def test_keypair_create_delete(self): - # Keypair should be created, verified and deleted + """Test create/delete keypair""" k_name = data_utils.rand_name('keypair') keypair = self.create_keypair(k_name) key_name = keypair['name'] @@ -58,7 +63,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest): @decorators.idempotent_id('a4233d5d-52d8-47cc-9a25-e1864527e3df') def test_get_keypair_detail(self): - # Keypair should be created, Got details by name and deleted + """Test getting keypair detail by keypair name""" k_name = data_utils.rand_name('keypair') self.create_keypair(k_name) keypair_detail = self.keypairs_client.show_keypair(k_name)['keypair'] @@ -68,7 +73,7 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest): @decorators.idempotent_id('39c90c6a-304a-49dd-95ec-2366129def05') def test_keypair_create_with_pub_key(self): - # Keypair should be created with a given public key + """Test creating keypair with a given public key""" k_name = data_utils.rand_name('keypair') pub_key = ("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs" "Ne3/1ILNCqFyfYWDeTKLD6jEXC2OQHLmietMWW+/vd" diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py index 81635caafb..40bea3f1eb 100644 --- a/tempest/api/compute/keypairs/test_keypairs_negative.py +++ b/tempest/api/compute/keypairs/test_keypairs_negative.py @@ -21,10 +21,12 @@ from tempest.lib import exceptions as lib_exc class KeyPairsNegativeTestJSON(base.BaseKeypairTest): + """Negative tests of keypairs API""" + @decorators.attr(type=['negative']) @decorators.idempotent_id('29cca892-46ae-4d48-bc32-8fe7e731eb81') def test_keypair_create_with_invalid_pub_key(self): - # Keypair should not be created with a non RSA public key + """Test keypair should not be created with a non RSA public key""" pub_key = "ssh-rsa JUNK nova@ubuntu" self.assertRaises(lib_exc.BadRequest, self.create_keypair, pub_key=pub_key) @@ -32,7 +34,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('7cc32e47-4c42-489d-9623-c5e2cb5a2fa5') def test_keypair_delete_nonexistent_key(self): - # Non-existent key deletion should throw a proper error + """Test non-existent key deletion should throw a proper error""" k_name = data_utils.rand_name("keypair-non-existent") self.assertRaises(lib_exc.NotFound, self.keypairs_client.delete_keypair, @@ -41,7 +43,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('dade320e-69ca-42a9-ba4a-345300f127e0') def test_create_keypair_with_empty_public_key(self): - # Keypair should not be created with an empty public key + """Test keypair should not be created with an empty public key""" pub_key = ' ' self.assertRaises(lib_exc.BadRequest, self.create_keypair, pub_key=pub_key) @@ -49,7 +51,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('fc100c19-2926-4b9c-8fdc-d0589ee2f9ff') def test_create_keypair_when_public_key_bits_exceeds_maximum(self): - # Keypair should not be created when public key bits are too long + """Test keypair should not be created when public key are too long""" pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu' self.assertRaises(lib_exc.BadRequest, self.create_keypair, pub_key=pub_key) @@ -57,7 +59,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('0359a7f1-f002-4682-8073-0c91e4011b7c') def test_create_keypair_with_duplicate_name(self): - # Keypairs with duplicate names should not be created + """Test keypairs with duplicate names should not be created""" k_name = data_utils.rand_name('keypair') self.keypairs_client.create_keypair(name=k_name) # Now try the same keyname to create another key @@ -68,14 +70,14 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('1398abe1-4a84-45fb-9294-89f514daff00') def test_create_keypair_with_empty_name_string(self): - # Keypairs with name being an empty string should not be created + """Test keypairs with empty name should not be created""" self.assertRaises(lib_exc.BadRequest, self.create_keypair, '') @decorators.attr(type=['negative']) @decorators.idempotent_id('3faa916f-779f-4103-aca7-dc3538eee1b7') def test_create_keypair_with_long_keynames(self): - # Keypairs with name longer than 255 chars should not be created + """Test keypairs with name longer than 255 should not be created""" k_name = 'keypair-'.ljust(260, '0') self.assertRaises(lib_exc.BadRequest, self.create_keypair, k_name) @@ -83,7 +85,7 @@ class KeyPairsNegativeTestJSON(base.BaseKeypairTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('45fbe5e0-acb5-49aa-837a-ff8d0719db91') def test_create_keypair_invalid_name(self): - # Keypairs with name being an invalid name should not be created + """Test keypairs with an invalid name should not be created""" k_name = r'key_/.\@:' self.assertRaises(lib_exc.BadRequest, self.create_keypair, k_name) diff --git a/tempest/api/compute/keypairs/test_keypairs_v22.py b/tempest/api/compute/keypairs/test_keypairs_v22.py index 1aff262848..e229c374d5 100644 --- a/tempest/api/compute/keypairs/test_keypairs_v22.py +++ b/tempest/api/compute/keypairs/test_keypairs_v22.py @@ -18,6 +18,8 @@ from tempest.lib import decorators class KeyPairsV22TestJSON(test_keypairs.KeyPairsV2TestJSON): + """Test keypairs API with compute microversion greater than 2.1""" + min_microversion = '2.2' max_microversion = 'latest' @@ -43,9 +45,11 @@ class KeyPairsV22TestJSON(test_keypairs.KeyPairsV2TestJSON): @decorators.idempotent_id('8726fa85-7f98-4b20-af9e-f710a4f3391c') def test_keypairsv22_create_list_show(self): + """Test create/list/show keypair""" self._test_keypairs_create_list_show() @decorators.idempotent_id('89d59d43-f735-441a-abcf-0601727f47b6') def test_keypairsv22_create_list_show_with_type(self): + """Test create/list/show keypair with keypair type""" keypair_type = 'x509' self._test_keypairs_create_list_show(keypair_type=keypair_type) diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py index 4c99ea62bc..59848f66d3 100644 --- a/tempest/api/compute/security_groups/test_security_group_rules.py +++ b/tempest/api/compute/security_groups/test_security_group_rules.py @@ -18,6 +18,10 @@ from tempest.lib import decorators class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): + """Test security group rules API + + Test security group rules API with compute microversion less than 2.36. + """ @classmethod def setup_clients(cls): @@ -55,8 +59,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type='smoke') @decorators.idempotent_id('850795d7-d4d3-4e55-b527-a774c0123d3a') def test_security_group_rules_create(self): - # Positive test: Creation of Security Group rule - # should be successful + """Test creating security group rules""" # Creating a Security Group to add rules to it security_group = self.create_security_group() securitygroup_id = security_group['id'] @@ -72,10 +75,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('7a01873e-3c38-4f30-80be-31a043cfe2fd') def test_security_group_rules_create_with_optional_cidr(self): - # Positive test: Creation of Security Group rule - # with optional argument cidr - # should be successful - + """Test creating security group rules with optional field cidr""" # Creating a Security Group to add rules to it security_group = self.create_security_group() parent_group_id = security_group['id'] @@ -94,10 +94,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('7f5d2899-7705-4d4b-8458-4505188ffab6') def test_security_group_rules_create_with_optional_group_id(self): - # Positive test: Creation of Security Group rule - # with optional argument group_id - # should be successful - + """Test creating security group rules with optional field group id""" # Creating a Security Group to add rules to it security_group = self.create_security_group() parent_group_id = security_group['id'] @@ -122,8 +119,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type='smoke') @decorators.idempotent_id('a6154130-5a55-4850-8be4-5e9e796dbf17') def test_security_group_rules_list(self): - # Positive test: Created Security Group rules should be - # in the list of all rules + """Test listing security group rules""" # Creating a Security Group to add rules to it security_group = self.create_security_group() securitygroup_id = security_group['id'] @@ -159,7 +155,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('fc5c5acf-2091-43a6-a6ae-e42760e9ffaf') def test_security_group_rules_delete_when_peer_group_deleted(self): - # Positive test:rule will delete when peer group deleting + """Test security group rule gets deleted when peer group is deleted""" # Creating a Security Group to add rules to it security_group = self.create_security_group() sg1_id = security_group['id'] diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py index 8283aae22c..3d000caade 100644 --- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py +++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py @@ -20,6 +20,11 @@ from tempest.lib import exceptions as lib_exc class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): + """Negative tests of security group rules API + + Negative tests of security group rules API with compute microversion + less than 2.36. + """ @classmethod def setup_clients(cls): @@ -29,8 +34,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('1d507e98-7951-469b-82c3-23f1e6b8c254') def test_create_security_group_rule_with_non_existent_id(self): - # Negative test: Creation of Security Group rule should FAIL - # with non existent Parent group id + """Test creating security group rule with non existent parent group + + Negative test: Creation of security group rule should fail + with non existent parent group id. + """ # Adding rules to the non existent Security Group id parent_group_id = self.generate_random_security_group_id() ip_protocol = 'tcp' @@ -45,8 +53,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('2244d7e4-adb7-4ecb-9930-2d77e123ce4f') def test_create_security_group_rule_with_invalid_id(self): - # Negative test: Creation of Security Group rule should FAIL - # with Parent group id which is not integer + """Test creating security group rule with invalid parent group id + + Negative test: Creation of security group rule should fail + with parent group id which is not integer. + """ # Adding rules to the non int Security Group id parent_group_id = data_utils.rand_name('non_int_id') ip_protocol = 'tcp' @@ -61,7 +72,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('8bd56d02-3ffa-4d67-9933-b6b9a01d6089') def test_create_security_group_rule_duplicate(self): - # Negative test: Create Security Group rule duplicate should fail + """Test creating duplicate security group rule should fail""" # Creating a Security Group to add rule to it sg = self.create_security_group() # Adding rules to the created Security Group @@ -85,8 +96,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('84c81249-9f6e-439c-9bbf-cbb0d2cddbdf') def test_create_security_group_rule_with_invalid_ip_protocol(self): - # Negative test: Creation of Security Group rule should FAIL - # with invalid ip_protocol + """Test creating security group rule with invalid ip protocol + + Negative test: Creation of security group rule should fail + with invalid ip_protocol. + """ # Creating a Security Group to add rule to it sg = self.create_security_group() # Adding rules to the created Security Group @@ -104,8 +118,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('12bbc875-1045-4f7a-be46-751277baedb9') def test_create_security_group_rule_with_invalid_from_port(self): - # Negative test: Creation of Security Group rule should FAIL - # with invalid from_port + """Test creating security group rule with invalid from_port + + Negative test: Creation of security group rule should fail + with invalid from_port. + """ # Creating a Security Group to add rule to it sg = self.create_security_group() # Adding rules to the created Security Group @@ -122,8 +139,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('ff88804d-144f-45d1-bf59-dd155838a43a') def test_create_security_group_rule_with_invalid_to_port(self): - # Negative test: Creation of Security Group rule should FAIL - # with invalid to_port + """Test creating security group rule with invalid to_port + + Negative test: Creation of security group rule should fail + with invalid to_port. + """ # Creating a Security Group to add rule to it sg = self.create_security_group() # Adding rules to the created Security Group @@ -140,8 +160,11 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('00296fa9-0576-496a-ae15-fbab843189e0') def test_create_security_group_rule_with_invalid_port_range(self): - # Negative test: Creation of Security Group rule should FAIL - # with invalid port range. + """Test creating security group rule with invalid port range + + Negative test: Creation of security group rule should fail + with invalid port range. + """ # Creating a Security Group to add rule to it. sg = self.create_security_group() # Adding a rule to the created Security Group @@ -158,8 +181,7 @@ class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('56fddcca-dbb8-4494-a0db-96e9f869527c') def test_delete_security_group_rule_with_non_existent_id(self): - # Negative test: Deletion of Security Group rule should be FAIL - # with non existent id + """Test deleting non existent security group rule should fail""" non_existent_rule_id = self.generate_random_security_group_id() self.assertRaises(lib_exc.NotFound, self.rules_client.delete_security_group_rule, diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py index 62d5bea7e7..671a7794c7 100644 --- a/tempest/api/compute/security_groups/test_security_groups.py +++ b/tempest/api/compute/security_groups/test_security_groups.py @@ -21,6 +21,7 @@ from tempest.lib import exceptions as lib_exc class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): + """Test security groups API with compute microversion less than 2.36""" @classmethod def setup_clients(cls): @@ -30,7 +31,10 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type='smoke') @decorators.idempotent_id('eb2b087d-633d-4d0d-a7bd-9e6ba35b32de') def test_security_groups_create_list_delete(self): - # Positive test:Should return the list of Security Groups + """Test create/list/delete security groups + + Positive test: Should return the list of security groups. + """ # Create 3 Security Groups security_group_list = [] for _ in range(3): @@ -60,9 +64,11 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('ecc0da4a-2117-48af-91af-993cca39a615') def test_security_group_create_get_delete(self): - # Security Group should be created, fetched and deleted - # with char space between name along with - # leading and trailing spaces + """Test create/get/delete security group + + Security group should be created, fetched and deleted + with char space between name along with leading and trailing spaces. + """ s_name = ' %s ' % data_utils.rand_name('securitygroup ') securitygroup = self.create_security_group(name=s_name) securitygroup_name = securitygroup['name'] @@ -80,8 +86,11 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('fe4abc0d-83f5-4c50-ad11-57a1127297a2') def test_server_security_groups(self): - # Checks that security groups may be added and linked to a server - # and not deleted if the server is active. + """Test adding security groups to a server + + Checks that security groups may be added and linked to a server + and not deleted if the server is active. + """ # Create a couple security groups that we will use # for the server resource this test creates sg = self.create_security_group() @@ -121,7 +130,7 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('7d4e1d3c-3209-4d6d-b020-986304ebad1f') def test_update_security_groups(self): - # Update security group name and description + """Test updating security group name and description""" # Create a security group securitygroup = self.create_security_group() securitygroup_id = securitygroup['id'] @@ -139,6 +148,11 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest): @decorators.idempotent_id('79517d60-535a-438f-af3d-e6feab1cbea7') def test_list_security_groups_by_server(self): + """Test listing security groups by server + + Create security groups and add them to a server, then list security + groups by server, the added security groups should be in the list. + """ # Create a couple security groups that we will use # for the server resource this test creates sg = self.create_security_group() diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py index 9c44bb28ee..4607112562 100644 --- a/tempest/api/compute/security_groups/test_security_groups_negative.py +++ b/tempest/api/compute/security_groups/test_security_groups_negative.py @@ -25,6 +25,11 @@ CONF = config.CONF class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): + """Negative tests of security groups API + + Negative tests of security groups API with compute microversion + less than 2.36. + """ @classmethod def setup_clients(cls): @@ -34,8 +39,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('673eaec1-9b3e-48ed-bdf1-2786c1b9661c') def test_security_group_get_nonexistent_group(self): - # Negative test:Should not be able to GET the details - # of non-existent Security Group + """Test getting non existent security group details should fail""" non_exist_id = self.generate_random_security_group_id() self.assertRaises(lib_exc.NotFound, self.client.show_security_group, non_exist_id) @@ -45,8 +49,12 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('1759c3cb-b0fc-44b7-86ce-c99236be911d') def test_security_group_create_with_invalid_group_name(self): - # Negative test: Security Group should not be created with group name - # as an empty string/with white spaces/chars more than 255 + """Test creating security group with invalid group name should fail + + Negative test: Security group should not be created with group name + as an empty string, or group name with white spaces, or group name + with chars more than 255. + """ s_description = data_utils.rand_name('description') # Create Security Group with empty string as group name self.assertRaises(lib_exc.BadRequest, @@ -67,9 +75,12 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('777b6f14-aca9-4758-9e84-38783cfa58bc') def test_security_group_create_with_invalid_group_description(self): - # Negative test: Security Group should not be created with description - # longer than 255 chars. Empty description is allowed by the API - # reference, however. + """Test creating security group with invalid group description + + Negative test: Security group should not be created with description + longer than 255 chars. Empty description is allowed by the API + reference, however. + """ s_name = data_utils.rand_name('securitygroup') # Create Security Group with group description longer than 255 chars s_description = 'description-'.ljust(260, '0') @@ -82,8 +93,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): "Neutron allows duplicate names for security groups") @decorators.attr(type=['negative']) def test_security_group_create_with_duplicate_name(self): - # Negative test:Security Group with duplicate name should not - # be created + """Test creating security group with duplicate name should fail""" s_name = data_utils.rand_name('securitygroup') s_description = data_utils.rand_name('description') self.create_security_group(name=s_name, description=s_description) @@ -95,7 +105,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('36a1629f-c6da-4a26-b8b8-55e7e5d5cd58') def test_delete_the_default_security_group(self): - # Negative test:Deletion of the "default" Security Group should Fail + """Test deleting "default" security group should fail""" default_security_group_id = None body = self.client.list_security_groups()['security_groups'] for i in range(len(body)): @@ -110,7 +120,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('6727c00b-214c-4f9e-9a52-017ac3e98411') def test_delete_nonexistent_security_group(self): - # Negative test:Deletion of a non-existent Security Group should fail + """Test deleting non existent security group should fail""" non_exist_id = self.generate_random_security_group_id() self.assertRaises(lib_exc.NotFound, self.client.delete_security_group, non_exist_id) @@ -118,8 +128,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('1438f330-8fa4-4aeb-8a94-37c250106d7f') def test_delete_security_group_without_passing_id(self): - # Negative test:Deletion of a Security Group with out passing ID - # should Fail + """Test deleting security group passing empty group id should fail""" self.assertRaises(lib_exc.NotFound, self.client.delete_security_group, '') @@ -128,7 +137,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): "Neutron does not check the security group ID") @decorators.attr(type=['negative']) def test_update_security_group_with_invalid_sg_id(self): - # Update security_group with invalid sg_id should fail + """Test updating security group with invalid group id should fail""" s_name = data_utils.rand_name('sg') s_description = data_utils.rand_name('description') # Create a non int sg_id @@ -142,7 +151,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): "Neutron does not check the security group name") @decorators.attr(type=['negative']) def test_update_security_group_with_invalid_sg_name(self): - # Update security_group with invalid sg_name should fail + """Test updating security group to invalid group name should fail""" securitygroup = self.create_security_group() securitygroup_id = securitygroup['id'] # Update Security Group with group name longer than 255 chars @@ -156,7 +165,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): "Neutron does not check the security group description") @decorators.attr(type=['negative']) def test_update_security_group_with_invalid_sg_des(self): - # Update security_group with invalid sg_des should fail + """Test updating security group to invalid description should fail""" securitygroup = self.create_security_group() securitygroup_id = securitygroup['id'] # Update Security Group with group description longer than 255 chars @@ -168,7 +177,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest): @decorators.attr(type=['negative']) @decorators.idempotent_id('27edee9c-873d-4da6-a68a-3c256efebe8f') def test_update_non_existent_security_group(self): - # Update a non-existent Security Group should Fail + """Test updating a non existent security group should fail""" non_exist_id = self.generate_random_security_group_id() s_name = data_utils.rand_name('sg') s_description = data_utils.rand_name('description') diff --git a/tempest/api/compute/test_extensions.py b/tempest/api/compute/test_extensions.py index 12e7feac7c..3318876660 100644 --- a/tempest/api/compute/test_extensions.py +++ b/tempest/api/compute/test_extensions.py @@ -27,10 +27,11 @@ LOG = logging.getLogger(__name__) class ExtensionsTest(base.BaseV2ComputeTest): + """Tests Compute Extensions API""" @decorators.idempotent_id('3bb27738-b759-4e0d-a5fa-37d7a6df07d1') def test_list_extensions(self): - # List of all extensions + """Test listing compute extensions""" if not CONF.compute_feature_enabled.api_extensions: raise self.skipException('There are not any extensions configured') extensions = self.extensions_client.list_extensions()['extensions'] @@ -50,6 +51,6 @@ class ExtensionsTest(base.BaseV2ComputeTest): @decorators.idempotent_id('05762f39-bdfa-4cdb-9b46-b78f8e78e2fd') @utils.requires_ext(extension='os-consoles', service='compute') def test_get_extension(self): - # get the specified extensions + """Test getting specified compute extension details""" extension = self.extensions_client.show_extension('os-consoles') self.assertEqual('os-consoles', extension['extension']['alias']) diff --git a/tempest/api/compute/test_networks.py b/tempest/api/compute/test_networks.py index 76131e2235..97c26e430b 100644 --- a/tempest/api/compute/test_networks.py +++ b/tempest/api/compute/test_networks.py @@ -20,6 +20,7 @@ CONF = config.CONF class ComputeNetworksTest(base.BaseV2ComputeTest): + """Test compute networks API with compute microversion less than 2.36""" max_microversion = '2.35' @classmethod @@ -35,5 +36,6 @@ class ComputeNetworksTest(base.BaseV2ComputeTest): @decorators.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2') def test_list_networks(self): + """Test listing networks using compute networks API""" networks = self.client.list_networks()['networks'] self.assertNotEmpty(networks, "No networks found.") diff --git a/tempest/api/compute/test_tenant_networks.py b/tempest/api/compute/test_tenant_networks.py index f4eada0585..17f4b80d18 100644 --- a/tempest/api/compute/test_tenant_networks.py +++ b/tempest/api/compute/test_tenant_networks.py @@ -18,6 +18,8 @@ from tempest.lib import decorators class ComputeTenantNetworksTest(base.BaseV2ComputeTest): + """Test compute tenant networks API with microversion less than 2.36""" + max_microversion = '2.35' @classmethod @@ -34,8 +36,11 @@ class ComputeTenantNetworksTest(base.BaseV2ComputeTest): @decorators.idempotent_id('edfea98e-bbe3-4c7a-9739-87b986baff26') @utils.services('network') def test_list_show_tenant_networks(self): - # Fetch all networks that are visible to the tenant: this may include - # shared and external networks + """Test list/show tenant networks + + Fetch all networks that are visible to the tenant: this may include + shared and external networks. + """ tenant_networks = [ n['id'] for n in self.client.list_tenant_networks()['networks'] ]