Merge "fix file injection test to not assume /etc is present"
diff --git a/run_tests.sh b/run_tests.sh
index 0df8a99..f50b695 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -77,9 +77,9 @@
srcfiles+=" `find tools -type f -name "*.py"`"
srcfiles+=" setup.py"
- ignore='--ignore=N4,E121,E122,E125,E126'
+ ignore='--ignore=T401,T402,E121,E122,E125,E126'
- ${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
+ ${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
}
NOSETESTS="nosetests $noseargs"
diff --git a/tempest/tests/boto/test_ec2_instance_run.py b/tempest/tests/boto/test_ec2_instance_run.py
index 840d6dd..95ef23c 100644
--- a/tempest/tests/boto/test_ec2_instance_run.py
+++ b/tempest/tests/boto/test_ec2_instance_run.py
@@ -93,7 +93,7 @@
@attr(type='smoke')
def test_run_stop_terminate_instance(self):
- """EC2 run, stop and terminate instance"""
+ # EC2 run, stop and terminate instance
image_ami = self.ec2_client.get_image(self.images["ami"]
["image_id"])
reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
@@ -122,7 +122,7 @@
@attr(type='smoke')
def test_run_terminate_instance(self):
- """EC2 run, terminate immediately"""
+ # EC2 run, terminate immediately
image_ami = self.ec2_client.get_image(self.images["ami"]
["image_id"])
reservation = image_ami.run(kernel_id=self.images["aki"]["image_id"],
@@ -139,7 +139,7 @@
# with normal validation it would fail
@attr("slow", type='smoke')
def test_integration_1(self):
- """EC2 1. integration test (not strict)"""
+ # EC2 1. integration test (not strict)
image_ami = self.ec2_client.get_image(self.images["ami"]["image_id"])
sec_group_name = rand_name("securitygroup-")
group_desc = sec_group_name + " security group description "
diff --git a/tempest/tests/boto/test_ec2_keys.py b/tempest/tests/boto/test_ec2_keys.py
index 162e2fb..fcec02d 100644
--- a/tempest/tests/boto/test_ec2_keys.py
+++ b/tempest/tests/boto/test_ec2_keys.py
@@ -39,7 +39,7 @@
@attr(type='smoke')
def test_create_ec2_keypair(self):
- """EC2 create KeyPair"""
+ # EC2 create KeyPair
key_name = rand_name("keypair-")
self.addResourceCleanUp(self.client.delete_key_pair, key_name)
keypair = self.client.create_key_pair(key_name)
@@ -49,7 +49,7 @@
@attr(type='smoke')
@unittest.skip("Skipped until the Bug #1072318 is resolved")
def test_delete_ec2_keypair(self):
- """EC2 delete KeyPair"""
+ # EC2 delete KeyPair
key_name = rand_name("keypair-")
self.client.create_key_pair(key_name)
self.client.delete_key_pair(key_name)
@@ -57,7 +57,7 @@
@attr(type='smoke')
def test_get_ec2_keypair(self):
- """EC2 get KeyPair"""
+ # EC2 get KeyPair
key_name = rand_name("keypair-")
self.addResourceCleanUp(self.client.delete_key_pair, key_name)
keypair = self.client.create_key_pair(key_name)
@@ -67,7 +67,7 @@
@attr(type='smoke')
@unittest.skip("Skipped until the Bug #1072762 is resolved")
def test_duplicate_ec2_keypair(self):
- """EC2 duplicate KeyPair"""
+ # EC2 duplicate KeyPair
key_name = rand_name("keypair-")
self.addResourceCleanUp(self.client.delete_key_pair, key_name)
keypair = self.client.create_key_pair(key_name)
diff --git a/tempest/tests/boto/test_ec2_network.py b/tempest/tests/boto/test_ec2_network.py
index c544b06..27649e6 100644
--- a/tempest/tests/boto/test_ec2_network.py
+++ b/tempest/tests/boto/test_ec2_network.py
@@ -35,7 +35,7 @@
@unittest.skip("Skipped until the Bug #1080406 is resolved")
@attr(type='smoke')
def test_disassociate_not_associated_floating_ip(self):
- """EC2 disassociate not associated floating ip"""
+ # EC2 disassociate not associated floating ip
ec2_codes = self.ec2_error_code
address = self.client.allocate_address()
public_ip = address.public_ip
diff --git a/tempest/tests/boto/test_ec2_security_groups.py b/tempest/tests/boto/test_ec2_security_groups.py
index c10f1df..09da82c 100644
--- a/tempest/tests/boto/test_ec2_security_groups.py
+++ b/tempest/tests/boto/test_ec2_security_groups.py
@@ -34,7 +34,7 @@
@attr(type='smoke')
def test_create_authorize_security_group(self):
- """EC2 Create, authorize/revoke security group"""
+ # EC2 Create, authorize/revoke security group
group_name = rand_name("securty_group-")
group_description = group_name + " security group description "
group = self.client.create_security_group(group_name,
diff --git a/tempest/tests/boto/test_ec2_volumes.py b/tempest/tests/boto/test_ec2_volumes.py
index 8d6cf6f..7898926 100644
--- a/tempest/tests/boto/test_ec2_volumes.py
+++ b/tempest/tests/boto/test_ec2_volumes.py
@@ -45,7 +45,7 @@
#NOTE(afazekas): as admin it can trigger the Bug #1074901
@attr(type='smoke')
def test_create_get_delete(self):
- """EC2 Create, get, delete Volume"""
+ # EC2 Create, get, delete Volume
volume = self.client.create_volume(1, self.zone)
cuk = self.addResourceCleanUp(self.client.delete_volume, volume.id)
self.assertIn(volume.status, self.valid_volume_status)
@@ -63,7 +63,7 @@
@attr(type='smoke')
def test_create_volme_from_snapshot(self):
- """EC2 Create volume from snapshot"""
+ # EC2 Create volume from snapshot
volume = self.client.create_volume(1, self.zone)
self.addResourceCleanUp(self.client.delete_volume, volume.id)
diff --git a/tempest/tests/boto/test_s3_buckets.py b/tempest/tests/boto/test_s3_buckets.py
index 5587673..beed28b 100644
--- a/tempest/tests/boto/test_s3_buckets.py
+++ b/tempest/tests/boto/test_s3_buckets.py
@@ -36,7 +36,7 @@
@unittest.skip("Skipped until the Bug #1076965 is resolved")
@attr(type='smoke')
def test_create_and_get_delete_bucket(self):
- """S3 Create, get and delete bucket"""
+ # S3 Create, get and delete bucket
bucket_name = rand_name("s3bucket-")
cleanup_key = self.addResourceCleanUp(self.client.delete_bucket,
bucket_name)
diff --git a/tempest/tests/boto/test_s3_ec2_images.py b/tempest/tests/boto/test_s3_ec2_images.py
index 7020f51..f14115a 100644
--- a/tempest/tests/boto/test_s3_ec2_images.py
+++ b/tempest/tests/boto/test_s3_ec2_images.py
@@ -62,7 +62,7 @@
# otherwise I would skip it too
@attr(type='smoke')
def test_register_get_deregister_ami_image(self):
- """Register and deregister ami image"""
+ # Register and deregister ami image
image = {"name": rand_name("ami-name-"),
"location": self.bucket_name + "/" + self.ami_manifest,
"type": "ami"}
@@ -90,7 +90,7 @@
@unittest.skip("Skipped until the Bug #1074904 is resolved")
def test_register_get_deregister_aki_image(self):
- """Register and deregister aki image"""
+ # Register and deregister aki image
image = {"name": rand_name("aki-name-"),
"location": self.bucket_name + "/" + self.ari_manifest,
"type": "aki"}
@@ -118,7 +118,7 @@
@unittest.skip("Skipped until the Bug #1074908 and #1074904 is resolved")
def test_register_get_deregister_ari_image(self):
- """Register and deregister ari image"""
+ # Register and deregister ari image
image = {"name": rand_name("ari-name-"),
"location": "/" + self.bucket_name + "/" + self.ari_manifest,
"type": "ari"}
diff --git a/tempest/tests/boto/test_s3_objects.py b/tempest/tests/boto/test_s3_objects.py
index 94b04dc..6e89539 100644
--- a/tempest/tests/boto/test_s3_objects.py
+++ b/tempest/tests/boto/test_s3_objects.py
@@ -40,7 +40,7 @@
@unittest.skip("Skipped until the Bug #1076534 is resolved")
@attr(type='smoke')
def test_create_get_delete_object(self):
- """S3 Create, get and delete object"""
+ # S3 Create, get and delete object
bucket_name = rand_name("s3bucket-")
object_name = rand_name("s3object-")
content = 'x' * 42
diff --git a/tempest/tests/compute/admin/test_flavors.py b/tempest/tests/compute/admin/test_flavors.py
index e5de0cb..b5ee13a 100644
--- a/tempest/tests/compute/admin/test_flavors.py
+++ b/tempest/tests/compute/admin/test_flavors.py
@@ -47,8 +47,8 @@
@attr(type='positive')
def test_create_flavor(self):
- """Create a flavor and ensure it is listed
- This operation requires the user to have 'admin' role"""
+ # Create a flavor and ensure it is listed
+ # This operation requires the user to have 'admin' role
#Create the flavor
resp, flavor = self.client.create_flavor(self.flavor_name,
self.ram, self.vcpus,
@@ -77,8 +77,8 @@
@attr(type='positive')
def test_create_flavor_verify_entry_in_list_details(self):
- """Create a flavor and ensure it's details are listed
- This operation requires the user to have 'admin' role"""
+ # Create a flavor and ensure it's details are listed
+ # This operation requires the user to have 'admin' role
#Create the flavor
resp, flavor = self.client.create_flavor(self.flavor_name,
self.ram, self.vcpus,
@@ -101,7 +101,7 @@
@attr(type='negative')
def test_get_flavor_details_for_deleted_flavor(self):
- """Delete a flavor and ensure it is not listed"""
+ # Delete a flavor and ensure it is not listed
# Create a test flavor
resp, flavor = self.client.create_flavor(self.flavor_name,
self.ram,
diff --git a/tempest/tests/compute/admin/test_quotas.py b/tempest/tests/compute/admin/test_quotas.py
index b9474e5..452de80 100644
--- a/tempest/tests/compute/admin/test_quotas.py
+++ b/tempest/tests/compute/admin/test_quotas.py
@@ -66,7 +66,7 @@
@attr(type='smoke')
def test_get_default_quotas(self):
- """Admin can get the default resource quota set for a tenant"""
+ # Admin can get the default resource quota set for a tenant
expected_quota_set = self.default_quota_set.copy()
expected_quota_set['id'] = self.demo_tenant_id
try:
@@ -77,7 +77,7 @@
self.fail("Admin could not get the default quota set for a tenant")
def test_update_all_quota_resources_for_tenant(self):
- """Admin can update all the resource quota limits for a tenant"""
+ # Admin can update all the resource quota limits for a tenant
new_quota_set = {'injected_file_content_bytes': 20480,
'metadata_items': 256, 'injected_files': 10,
'ram': 10240, 'floating_ips': 20, 'key_pairs': 200,
@@ -102,7 +102,7 @@
"defaults")
def test_get_updated_quotas(self):
- """Verify that GET shows the updated quota set"""
+ # Verify that GET shows the updated quota set
self.adm_client.update_quota_set(self.demo_tenant_id,
ram='5120')
try:
@@ -120,7 +120,7 @@
"defaults")
def test_create_server_when_cpu_quota_is_full(self):
- """Disallow server creation when tenant's vcpu quota is full"""
+ # Disallow server creation when tenant's vcpu quota is full
resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
default_vcpu_quota = quota_set['cores']
vcpu_quota = 0 # Set the quota to zero to conserve resources
@@ -138,7 +138,7 @@
cores=default_vcpu_quota)
def test_create_server_when_memory_quota_is_full(self):
- """Disallow server creation when tenant's memory quota is full"""
+ # Disallow server creation when tenant's memory quota is full
resp, quota_set = self.client.get_quota_set(self.demo_tenant_id)
default_mem_quota = quota_set['ram']
mem_quota = 0 # Set the quota to zero to conserve resources
diff --git a/tempest/tests/compute/flavors/test_flavors.py b/tempest/tests/compute/flavors/test_flavors.py
index 6423075..53cad65 100644
--- a/tempest/tests/compute/flavors/test_flavors.py
+++ b/tempest/tests/compute/flavors/test_flavors.py
@@ -24,7 +24,7 @@
@attr(type='smoke')
def test_list_flavors(self):
- """List of all flavors should contain the expected flavor"""
+ # List of all flavors should contain the expected flavor
resp, flavors = self.client.list_flavors()
resp, flavor = self.client.get_flavor_details(self.flavor_ref)
flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
@@ -33,40 +33,40 @@
@attr(type='smoke')
def test_list_flavors_with_detail(self):
- """Detailed list of all flavors should contain the expected flavor"""
+ # Detailed list of all flavors should contain the expected flavor
resp, flavors = self.client.list_flavors_with_detail()
resp, flavor = self.client.get_flavor_details(self.flavor_ref)
self.assertTrue(flavor in flavors)
@attr(type='smoke')
def test_get_flavor(self):
- """The expected flavor details should be returned"""
+ # The expected flavor details should be returned
resp, flavor = self.client.get_flavor_details(self.flavor_ref)
self.assertEqual(self.flavor_ref, int(flavor['id']))
@attr(type='negative')
def test_get_non_existant_flavor(self):
- """flavor details are not returned for non existant flavors"""
+ # flavor details are not returned for non existant flavors
self.assertRaises(exceptions.NotFound, self.client.get_flavor_details,
999)
@attr(type='positive', bug='lp912922')
def test_list_flavors_limit_results(self):
- """Only the expected number of flavors should be returned"""
+ # Only the expected number of flavors should be returned
params = {'limit': 1}
resp, flavors = self.client.list_flavors(params)
self.assertEqual(1, len(flavors))
@attr(type='positive', bug='lp912922')
def test_list_flavors_detailed_limit_results(self):
- """Only the expected number of flavors (detailed) should be returned"""
+ # Only the expected number of flavors (detailed) should be returned
params = {'limit': 1}
resp, flavors = self.client.list_flavors_with_detail(params)
self.assertEqual(1, len(flavors))
@attr(type='positive')
def test_list_flavors_using_marker(self):
- """The list of flavors should start from the provided marker"""
+ # The list of flavors should start from the provided marker
resp, flavors = self.client.list_flavors()
flavor_id = flavors[0]['id']
@@ -77,7 +77,7 @@
@attr(type='positive')
def test_list_flavors_detailed_using_marker(self):
- """The list of flavors should start from the provided marker"""
+ # The list of flavors should start from the provided marker
resp, flavors = self.client.list_flavors_with_detail()
flavor_id = flavors[0]['id']
@@ -88,7 +88,7 @@
@attr(type='positive')
def test_list_flavors_detailed_filter_by_min_disk(self):
- """The detailed list of flavors should be filtered by disk space"""
+ # The detailed list of flavors should be filtered by disk space
resp, flavors = self.client.list_flavors_with_detail()
flavors = sorted(flavors, key=lambda k: k['disk'])
flavor_id = flavors[0]['id']
@@ -99,7 +99,7 @@
@attr(type='positive')
def test_list_flavors_detailed_filter_by_min_ram(self):
- """The detailed list of flavors should be filtered by RAM"""
+ # The detailed list of flavors should be filtered by RAM
resp, flavors = self.client.list_flavors_with_detail()
flavors = sorted(flavors, key=lambda k: k['ram'])
flavor_id = flavors[0]['id']
@@ -110,7 +110,7 @@
@attr(type='positive')
def test_list_flavors_filter_by_min_disk(self):
- """The list of flavors should be filtered by disk space"""
+ # The list of flavors should be filtered by disk space
resp, flavors = self.client.list_flavors_with_detail()
flavors = sorted(flavors, key=lambda k: k['disk'])
flavor_id = flavors[0]['id']
@@ -121,7 +121,7 @@
@attr(type='positive')
def test_list_flavors_filter_by_min_ram(self):
- """The list of flavors should be filtered by RAM"""
+ # The list of flavors should be filtered by RAM
resp, flavors = self.client.list_flavors_with_detail()
flavors = sorted(flavors, key=lambda k: k['ram'])
flavor_id = flavors[0]['id']
@@ -132,7 +132,7 @@
@attr(type='negative')
def test_get_flavor_details_for_invalid_flavor_id(self):
- """Ensure 404 returned for non-existant flavor ID"""
+ # Ensure 404 returned for non-existant flavor ID
self.assertRaises(exceptions.NotFound, self.client.get_flavor_details,
9999)
diff --git a/tempest/tests/compute/floating_ips/test_floating_ips_actions.py b/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
index 4e0efaa..9a9914a 100644
--- a/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
@@ -63,10 +63,8 @@
@attr(type='positive')
def test_allocate_floating_ip(self):
- """
- Positive test:Allocation of a new floating IP to a project
- should be successful
- """
+ # Positive test:Allocation of a new floating IP to a project
+ # should be successful
try:
resp, body = self.client.create_floating_ip()
self.assertEqual(200, resp.status)
@@ -82,10 +80,8 @@
@attr(type='positive')
def test_delete_floating_ip(self):
- """
- Positive test:Deletion of valid floating IP from project
- should be successful
- """
+ # Positive test:Deletion of valid floating IP from project
+ # should be successful
#Creating the floating IP that is to be deleted in this method
resp, floating_ip_body = self.client.create_floating_ip()
#Storing the details of floating IP before deleting it
@@ -99,10 +95,9 @@
@attr(type='positive')
def test_associate_disassociate_floating_ip(self):
- """
- Positive test:Associate and disassociate the provided floating IP to a
- specific server should be successful
- """
+ # Positive test:Associate and disassociate the provided floating IP
+ # to a specific server should be successful
+
#Association of floating IP to fixed IP address
resp, body =\
self.client.associate_floating_ip_to_server(self.floating_ip,
@@ -116,11 +111,9 @@
@attr(type='negative')
def test_delete_nonexistant_floating_ip(self):
- """
+ # Negative test:Deletion of a nonexistent floating IP
+ # from project should fail
- Negative test:Deletion of a nonexistent floating IP
- from project should fail
- """
#Deleting the non existent floating IP
try:
resp, body = self.client.delete_floating_ip(self.non_exist_id)
@@ -131,10 +124,8 @@
@attr(type='negative')
def test_associate_nonexistant_floating_ip(self):
- """
- Negative test:Association of a non existent floating IP
- to specific server should fail
- """
+ # Negative test:Association of a non existent floating IP
+ # to specific server should fail
#Associating non existent floating IP
try:
resp, body = \
@@ -148,9 +139,7 @@
@attr(type='negative')
def test_dissociate_nonexistant_floating_ip(self):
- """
- Negative test:Dissociation of a non existent floating IP should fail
- """
+ # Negative test:Dissociation of a non existent floating IP should fail
#Dissociating non existent floating IP
try:
resp, body = \
@@ -164,10 +153,8 @@
@attr(type='positive')
def test_associate_already_associated_floating_ip(self):
- """
- positive test:Association of an already associated floating IP
- to specific server should change the association of the Floating IP
- """
+ # positive test:Association of an already associated floating IP
+ # to specific server should change the association of the Floating IP
#Create server so as to use for Multiple association
resp, body = self.servers_client.create_server('floating-server2',
self.image_ref,
@@ -205,10 +192,8 @@
@attr(type='negative')
def test_associate_ip_to_server_without_passing_floating_ip(self):
- """
- Negative test:Association of empty floating IP to specific server
- should raise NotFound exception
- """
+ # Negative test:Association of empty floating IP to specific server
+ # should raise NotFound exception
try:
resp, body =\
self.client.associate_floating_ip_to_server('',
diff --git a/tempest/tests/compute/floating_ips/test_list_floating_ips.py b/tempest/tests/compute/floating_ips/test_list_floating_ips.py
index 6f74f74..9eec27c 100644
--- a/tempest/tests/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/tests/compute/floating_ips/test_list_floating_ips.py
@@ -43,7 +43,7 @@
@attr(type='positive')
def test_list_floating_ips(self):
- """Positive test:Should return the list of floating IPs"""
+ # Positive test:Should return the list of floating IPs
resp, body = self.client.list_floating_ips()
self.assertEqual(200, resp.status)
floating_ips = body
@@ -54,7 +54,7 @@
@attr(type='positive')
def test_get_floating_ip_details(self):
- """Positive test:Should be able to GET the details of floatingIP"""
+ # Positive test:Should be able to GET the details of floatingIP
#Creating a floating IP for which details are to be checked
try:
resp, body = self.client.create_floating_ip()
@@ -78,10 +78,8 @@
@attr(type='negative')
def test_get_nonexistant_floating_ip_details(self):
- """
- Negative test:Should not be able to GET the details
- of nonexistant floating IP
- """
+ # Negative test:Should not be able to GET the details
+ # of nonexistant floating IP
floating_ip_id = []
resp, body = self.client.list_floating_ips()
for i in range(len(body)):
diff --git a/tempest/tests/compute/images/test_image_metadata.py b/tempest/tests/compute/images/test_image_metadata.py
index 1ac7de7..cdf4249 100644
--- a/tempest/tests/compute/images/test_image_metadata.py
+++ b/tempest/tests/compute/images/test_image_metadata.py
@@ -58,13 +58,13 @@
self.assertEqual(resp.status, 200)
def test_list_image_metadata(self):
- """All metadata key/value pairs for an image should be returned"""
+ # All metadata key/value pairs for an image should be returned
resp, resp_metadata = self.client.list_image_metadata(self.image_id)
expected = {'key1': 'value1', 'key2': 'value2'}
self.assertEqual(expected, resp_metadata)
def test_set_image_metadata(self):
- """The metadata for the image should match the new values"""
+ # The metadata for the image should match the new values
req_metadata = {'meta2': 'value2', 'meta3': 'value3'}
resp, body = self.client.set_image_metadata(self.image_id,
req_metadata)
@@ -73,7 +73,7 @@
self.assertEqual(req_metadata, resp_metadata)
def test_update_image_metadata(self):
- """The metadata for the image should match the updated values"""
+ # The metadata for the image should match the updated values
req_metadata = {'key1': 'alt1', 'key3': 'value3'}
resp, metadata = self.client.update_image_metadata(self.image_id,
req_metadata)
@@ -83,15 +83,14 @@
self.assertEqual(expected, resp_metadata)
def test_get_image_metadata_item(self):
- """The value for a specific metadata key should be returned"""
+ # The value for a specific metadata key should be returned
resp, meta = self.client.get_image_metadata_item(self.image_id,
'key2')
self.assertTrue('value2', meta['key2'])
def test_set_image_metadata_item(self):
- """
- The value provided for the given meta item should be set for the image
- """
+ # The value provided for the given meta item should be set for
+ # the image
meta = {'key1': 'alt'}
resp, body = self.client.set_image_metadata_item(self.image_id,
'key1', meta)
@@ -100,7 +99,7 @@
self.assertEqual(expected, resp_metadata)
def test_delete_image_metadata_item(self):
- """The metadata value/key pair should be deleted from the image"""
+ # The metadata value/key pair should be deleted from the image
resp, body = self.client.delete_image_metadata_item(self.image_id,
'key1')
resp, resp_metadata = self.client.list_image_metadata(self.image_id)
@@ -109,8 +108,8 @@
@attr(type='negative')
def test_list_nonexistant_image_metadata(self):
- """Negative test: List on nonexistant image
- metadata should not happen"""
+ # Negative test: List on nonexistant image
+ # metadata should not happen
try:
resp, resp_metadata = self.client.list_image_metadata(999)
except exceptions.NotFound:
@@ -121,7 +120,7 @@
@attr(type='negative')
def test_update_nonexistant_image_metadata(self):
- """Negative test:An update should not happen for a nonexistant image"""
+ # Negative test:An update should not happen for a nonexistant image
meta = {'key1': 'alt1', 'key2': 'alt2'}
try:
resp, metadata = self.client.update_image_metadata(999, meta)
@@ -132,7 +131,7 @@
@attr(type='negative')
def test_get_nonexistant_image_metadata_item(self):
- """Negative test: Get on nonexistant image should not happen"""
+ # Negative test: Get on nonexistant image should not happen
try:
resp, metadata = self.client.get_image_metadata_item(999, 'key2')
except exceptions.NotFound:
@@ -142,7 +141,7 @@
@attr(type='negative')
def test_set_nonexistant_image_metadata(self):
- """Negative test: Metadata should not be set to a nonexistant image"""
+ # Negative test: Metadata should not be set to a nonexistant image
meta = {'key1': 'alt1', 'key2': 'alt2'}
try:
resp, meta = self.client.set_image_metadata(999, meta)
@@ -153,8 +152,8 @@
@attr(type='negative')
def test_set_nonexistant_image_metadata_item(self):
- """Negative test: Metadata item should not be set to a
- nonexistant image"""
+ # Negative test: Metadata item should not be set to a
+ # nonexistant image
meta = {'key1': 'alt'}
try:
resp, body = self.client.set_image_metadata_item(999, 'key1', meta)
@@ -166,8 +165,8 @@
@attr(type='negative')
def test_delete_nonexistant_image_metadata_item(self):
- """Negative test: Shouldnt be able to delete metadata
- item from nonexistant image"""
+ # Negative test: Shouldnt be able to delete metadata
+ # item from nonexistant image
try:
resp, body = self.client.delete_image_metadata_item(999, 'key1')
resp, metadata = self.client.list_image_metadata(999)
diff --git a/tempest/tests/compute/images/test_images.py b/tempest/tests/compute/images/test_images.py
index 5c07626..46c8eee 100644
--- a/tempest/tests/compute/images/test_images.py
+++ b/tempest/tests/compute/images/test_images.py
@@ -46,7 +46,7 @@
@unittest.skipUnless(compute.CREATE_IMAGE_ENABLED,
'Environment unable to create images.')
def test_create_delete_image(self):
- """An image for the provided server should be created"""
+ # An image for the provided server should be created
server_name = rand_name('server')
resp, server = self.servers_client.create_server(server_name,
self.image_ref,
@@ -77,7 +77,7 @@
@attr(type='negative')
def test_create_image_from_deleted_server(self):
- """An image should not be created if the server instance is removed """
+ # An image should not be created if the server instance is removed
server_name = rand_name('server')
resp, server = self.servers_client.create_server(server_name,
self.image_ref,
@@ -105,7 +105,7 @@
@attr(type='negative')
def test_create_image_from_invalid_server(self):
- """An image should not be created with invalid server id"""
+ # An image should not be created with invalid server id
try:
# Create a new image with invalid server id
name = rand_name('image')
@@ -127,7 +127,7 @@
@attr(type='negative')
@unittest.skipUnless(compute.MULTI_USER, 'Second user not configured')
def test_create_image_for_server_in_another_tenant(self):
- """Creating image of another tenant's server should be return error"""
+ # Creating image of another tenant's server should be return error
server = self.create_server()
snapshot_name = rand_name('test-snap-')
@@ -136,7 +136,7 @@
@attr(type='negative')
def test_create_image_when_server_is_building(self):
- """Return error when creating an image of a server that is building"""
+ # Return error when creating an image of a server that is building
server_name = rand_name('test-vm-')
resp, server = self.servers_client.create_server(server_name,
self.image_ref,
@@ -149,7 +149,7 @@
@unittest.skip("Until Bug 1039739 is fixed")
@attr(type='negative')
def test_create_image_when_server_is_rebooting(self):
- """Return error when creating an image of server that is rebooting"""
+ # Return error when creating an image of server that is rebooting
server = self.create_server()
self.servers_client.reboot(server['id'], 'HARD')
@@ -159,7 +159,7 @@
@attr(type='negative')
def test_create_image_when_server_is_terminating(self):
- """Return an error when creating image of server that is terminating"""
+ # Return an error when creating image of server that is terminating
server = self.create_server()
self.servers_client.delete_server(server['id'])
@@ -169,7 +169,7 @@
@attr(type='negative')
def test_create_second_image_when_first_image_is_being_saved(self):
- """Disallow creating another image when first image is being saved"""
+ # Disallow creating another image when first image is being saved
server = self.create_server()
try:
@@ -192,7 +192,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 1004564 is fixed")
def test_create_image_specify_name_over_256_chars(self):
- """Return an error if snapshot name over 256 characters is passed"""
+ # Return an error if snapshot name over 256 characters is passed
server = self.create_server()
try:
@@ -205,7 +205,7 @@
@attr(type='negative')
def test_create_image_specify_uuid_35_characters_or_less(self):
- """Return an error if Image ID passed is 35 characters or less"""
+ # Return an error if Image ID passed is 35 characters or less
try:
snapshot_name = rand_name('test-snap-')
test_uuid = ('a' * 35)
@@ -217,7 +217,7 @@
@attr(type='negative')
def test_create_image_specify_uuid_37_characters_or_more(self):
- """Return an error if Image ID passed is 37 characters or more"""
+ # Return an error if Image ID passed is 37 characters or more
try:
snapshot_name = rand_name('test-snap-')
test_uuid = ('a' * 37)
@@ -230,7 +230,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 1006725 is fixed")
def test_create_image_specify_multibyte_character_image_name(self):
- """Return an error if the image name has multi-byte characters"""
+ # Return an error if the image name has multi-byte characters
server = self.create_server()
try:
@@ -245,7 +245,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 1005423 is fixed")
def test_create_image_specify_invalid_metadata(self):
- """Return an error when creating image with invalid metadata"""
+ # Return an error when creating image with invalid metadata
server = self.create_server()
try:
@@ -260,7 +260,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 1005423 is fixed")
def test_create_image_specify_metadata_over_limits(self):
- """Return an error when creating image with meta data over 256 chars"""
+ # Return an error when creating image with meta data over 256 chars
server = self.create_server()
try:
@@ -274,7 +274,7 @@
@attr(type='negative')
def test_delete_image_with_invalid_image_id(self):
- """An image should not be deleted with invalid image id"""
+ # An image should not be deleted with invalid image id
try:
# Delete an image with invalid image id
resp, _ = self.client.delete_image('!@$%^&*()')
@@ -288,7 +288,7 @@
@attr(type='negative')
def test_delete_non_existent_image(self):
- """Return an error while trying to delete a non-existent image"""
+ # Return an error while trying to delete a non-existent image
non_existent_image_id = '11a22b9-12a9-5555-cc11-00ab112223fa'
self.assertRaises(exceptions.NotFound, self.client.delete_image,
@@ -296,7 +296,7 @@
@attr(type='negative')
def test_delete_image_blank_id(self):
- """Return an error while trying to delete an image with blank Id"""
+ # Return an error while trying to delete an image with blank Id
try:
self.assertRaises(exceptions.NotFound, self.client.delete_image,
@@ -306,7 +306,7 @@
@attr(type='negative')
def test_delete_image_non_hex_string_id(self):
- """Return an error while trying to delete an image with non hex id"""
+ # Return an error while trying to delete an image with non hex id
image_id = '11a22b9-120q-5555-cc11-00ab112223gj'
try:
@@ -317,7 +317,7 @@
@attr(type='negative')
def test_delete_image_negative_image_id(self):
- """Return an error while trying to delete an image with negative id"""
+ # Return an error while trying to delete an image with negative id
try:
self.assertRaises(exceptions.NotFound, self.client.delete_image,
@@ -327,7 +327,7 @@
@attr(type='negative')
def test_delete_image_id_is_over_35_character_limit(self):
- """Return an error while trying to delete image with id over limit"""
+ # Return an error while trying to delete image with id over limit
try:
self.assertRaises(exceptions.NotFound, self.client.delete_image,
@@ -339,7 +339,7 @@
@attr(type='negative')
@unittest.skipUnless(compute.MULTI_USER, 'Second user not configured')
def test_delete_image_of_another_tenant(self):
- """Return an error while trying to delete another tenant's image"""
+ # Return an error while trying to delete another tenant's image
server = self.create_server()
@@ -356,7 +356,7 @@
@attr(type='negative')
def test_delete_image_that_is_not_yet_active(self):
- """Return an error while trying to delete an active that is creating"""
+ # Return an error while trying to delete an active that is creating
server = self.create_server()
diff --git a/tempest/tests/compute/images/test_images_whitebox.py b/tempest/tests/compute/images/test_images_whitebox.py
index c2a5b05..f409970 100644
--- a/tempest/tests/compute/images/test_images_whitebox.py
+++ b/tempest/tests/compute/images/test_images_whitebox.py
@@ -80,89 +80,89 @@
self.update_state(self.shared_server['id'], 'active', None)
def test_create_image_when_vm_eq_building_task_eq_scheduling(self):
- """409 error when instance states are building,scheduling"""
+ # 409 error when instance states are building,scheduling
self._test_create_image_409_base("building", "scheduling")
def test_create_image_when_vm_eq_building_task_eq_networking(self):
- """409 error when instance states are building,networking"""
+ # 409 error when instance states are building,networking
self._test_create_image_409_base("building", "networking")
def test_create_image_when_vm_eq_building_task_eq_bdm(self):
- """409 error when instance states are building,block_device_mapping"""
+ # 409 error when instance states are building,block_device_mapping
self._test_create_image_409_base("building", "block_device_mapping")
def test_create_image_when_vm_eq_building_task_eq_spawning(self):
- """409 error when instance states are building,spawning"""
+ # 409 error when instance states are building,spawning
self._test_create_image_409_base("building", "spawning")
def test_create_image_when_vm_eq_active_task_eq_image_backup(self):
- """409 error when instance states are active,image_backup"""
+ # 409 error when instance states are active,image_backup
self._test_create_image_409_base("active", "image_backup")
def test_create_image_when_vm_eq_resized_task_eq_resize_prep(self):
- """409 error when instance states are resized,resize_prep"""
+ # 409 error when instance states are resized,resize_prep
self._test_create_image_409_base("resized", "resize_prep")
def test_create_image_when_vm_eq_resized_task_eq_resize_migrating(self):
- """409 error when instance states are resized,resize_migrating"""
+ # 409 error when instance states are resized,resize_migrating
self._test_create_image_409_base("resized", "resize_migrating")
def test_create_image_when_vm_eq_resized_task_eq_resize_migrated(self):
- """409 error when instance states are resized,resize_migrated"""
+ # 409 error when instance states are resized,resize_migrated
self._test_create_image_409_base("resized", "resize_migrated")
def test_create_image_when_vm_eq_resized_task_eq_resize_finish(self):
- """409 error when instance states are resized,resize_finish"""
+ # 409 error when instance states are resized,resize_finish
self._test_create_image_409_base("resized", "resize_finish")
def test_create_image_when_vm_eq_resized_task_eq_resize_reverting(self):
- """409 error when instance states are resized,resize_reverting"""
+ # 409 error when instance states are resized,resize_reverting
self._test_create_image_409_base("resized", "resize_reverting")
def test_create_image_when_vm_eq_resized_task_eq_resize_confirming(self):
- """409 error when instance states are resized,resize_confirming"""
+ # 409 error when instance states are resized,resize_confirming
self._test_create_image_409_base("resized", "resize_confirming")
def test_create_image_when_vm_eq_active_task_eq_resize_verify(self):
- """409 error when instance states are active,resize_verify"""
+ # 409 error when instance states are active,resize_verify
self._test_create_image_409_base("active", "resize_verify")
def test_create_image_when_vm_eq_active_task_eq_updating_password(self):
- """409 error when instance states are active,updating_password"""
+ # 409 error when instance states are active,updating_password
self._test_create_image_409_base("active", "updating_password")
def test_create_image_when_vm_eq_active_task_eq_rebuilding(self):
- """409 error when instance states are active,rebuilding"""
+ # 409 error when instance states are active,rebuilding
self._test_create_image_409_base("active", "rebuilding")
def test_create_image_when_vm_eq_active_task_eq_rebooting(self):
- """409 error when instance states are active,rebooting"""
+ # 409 error when instance states are active,rebooting
self._test_create_image_409_base("active", "rebooting")
def test_create_image_when_vm_eq_building_task_eq_deleting(self):
- """409 error when instance states are building,deleting"""
+ # 409 error when instance states are building,deleting
self._test_create_image_409_base("building", "deleting")
def test_create_image_when_vm_eq_active_task_eq_deleting(self):
- """409 error when instance states are active,deleting"""
+ # 409 error when instance states are active,deleting
self._test_create_image_409_base("active", "deleting")
def test_create_image_when_vm_eq_error_task_eq_building(self):
- """409 error when instance states are error,building"""
+ # 409 error when instance states are error,building
self._test_create_image_409_base("error", "building")
def test_create_image_when_vm_eq_error_task_eq_none(self):
- """409 error when instance states are error,None"""
+ # 409 error when instance states are error,None
self._test_create_image_409_base("error", None)
def test_create_image_when_vm_eq_deleted_task_eq_none(self):
- """409 error when instance states are deleted,None"""
+ # 409 error when instance states are deleted,None
self._test_create_image_409_base("deleted", None)
def test_create_image_when_vm_eq_resized_task_eq_none(self):
- """409 error when instance states are resized,None"""
+ # 409 error when instance states are resized,None
self._test_create_image_409_base("resized", None)
def test_create_image_when_vm_eq_error_task_eq_resize_prep(self):
- """409 error when instance states are error,resize_prep"""
+ # 409 error when instance states are error,resize_prep
self._test_create_image_409_base("error", "resize_prep")
diff --git a/tempest/tests/compute/images/test_list_image_filters.py b/tempest/tests/compute/images/test_list_image_filters.py
index fd19369..26119e3 100644
--- a/tempest/tests/compute/images/test_list_image_filters.py
+++ b/tempest/tests/compute/images/test_list_image_filters.py
@@ -77,15 +77,14 @@
@attr(type='negative')
def test_get_image_not_existing(self):
- """Check raises a NotFound"""
+ # Check raises a NotFound
self.assertRaises(exceptions.NotFound, self.client.get_image,
"nonexistingimageid")
@attr(type='positive')
def test_list_images_filter_by_status(self):
- """
- The list of images should contain only images with the provided status
- """
+ # The list of images should contain only images with the
+ # provided status
params = {'status': 'ACTIVE'}
resp, images = self.client.list_images(params)
@@ -95,9 +94,8 @@
@attr(type='positive')
def test_list_images_filter_by_name(self):
- """
- List of all images should contain the expected images filtered by name
- """
+ # List of all images should contain the expected images filtered
+ # by name
params = {'name': self.image1['name']}
resp, images = self.client.list_images(params)
@@ -107,7 +105,7 @@
@attr(type='positive')
def test_list_images_filter_by_server_id(self):
- """The images should contain images filtered by server id"""
+ # The images should contain images filtered by server id
params = {'server': self.server1['id']}
resp, images = self.client.list_images(params)
@@ -119,7 +117,7 @@
@attr(type='positive')
def test_list_images_filter_by_server_ref(self):
- """The list of servers should be filtered by server ref"""
+ # The list of servers should be filtered by server ref
server_links = self.server2['links']
# Try all server link types
@@ -136,7 +134,7 @@
@attr(type='positive')
def test_list_images_filter_by_type(self):
- """The list of servers should be filtered by image type"""
+ # The list of servers should be filtered by image type
params = {'type': 'snapshot'}
resp, images = self.client.list_images(params)
@@ -147,14 +145,14 @@
@attr(type='positive')
def test_list_images_limit_results(self):
- """Verify only the expected number of results are returned"""
+ # Verify only the expected number of results are returned
params = {'limit': '1'}
resp, images = self.client.list_images(params)
self.assertEqual(1, len(images))
@attr(type='positive')
def test_list_images_filter_by_changes_since(self):
- """Verify only updated images are returned in the detailed list"""
+ # Verify only updated images are returned in the detailed list
#Becoming ACTIVE will modify the updated time
#Filter by the image's created time
@@ -165,10 +163,8 @@
@attr(type='positive')
def test_list_images_with_detail_filter_by_status(self):
- """
- Detailed list of all images should only contain images
- with the provided status
- """
+ # Detailed list of all images should only contain images
+ # with the provided status
params = {'status': 'ACTIVE'}
resp, images = self.client.list_images_with_detail(params)
@@ -178,10 +174,8 @@
@attr(type='positive')
def test_list_images_with_detail_filter_by_name(self):
- """
- Detailed list of all images should contain the expected
- images filtered by name
- """
+ # Detailed list of all images should contain the expected
+ # images filtered by name
params = {'name': self.image1['name']}
resp, images = self.client.list_images_with_detail(params)
@@ -191,17 +185,15 @@
@attr(type='positive')
def test_list_images_with_detail_limit_results(self):
- """
- Verify only the expected number of results (with full details)
- are returned
- """
+ # Verify only the expected number of results (with full details)
+ # are returned
params = {'limit': '1'}
resp, images = self.client.list_images_with_detail(params)
self.assertEqual(1, len(images))
@attr(type='positive')
def test_list_images_with_detail_filter_by_server_ref(self):
- """Detailed list of servers should be filtered by server ref"""
+ # Detailed list of servers should be filtered by server ref
server_links = self.server2['links']
# Try all server link types
@@ -218,7 +210,7 @@
@attr(type='positive')
def test_list_images_with_detail_filter_by_type(self):
- """The detailed list of servers should be filtered by image type"""
+ # The detailed list of servers should be filtered by image type
params = {'type': 'snapshot'}
resp, images = self.client.list_images_with_detail(params)
resp, image4 = self.client.get_image(self.image_ref)
@@ -230,7 +222,7 @@
@attr(type='positive')
def test_list_images_with_detail_filter_by_changes_since(self):
- """Verify an update image is returned"""
+ # Verify an update image is returned
#Becoming ACTIVE will modify the updated time
#Filter by the image's created time
@@ -240,7 +232,7 @@
@attr(type='negative')
def test_get_nonexistant_image(self):
- """Negative test: GET on non existant image should fail"""
+ # Negative test: GET on non existant image should fail
try:
resp, image = self.client.get_image(999)
except Exception:
diff --git a/tempest/tests/compute/images/test_list_images.py b/tempest/tests/compute/images/test_list_images.py
index 838c3a3..da92ca8 100644
--- a/tempest/tests/compute/images/test_list_images.py
+++ b/tempest/tests/compute/images/test_list_images.py
@@ -36,20 +36,20 @@
@attr(type='smoke')
def test_get_image(self):
- """Returns the correct details for a single image"""
+ # Returns the correct details for a single image
resp, image = self.client.get_image(self.image_ref)
self.assertEqual(self.image_ref, image['id'])
@attr(type='smoke')
def test_list_images(self):
- """The list of all images should contain the image"""
+ # The list of all images should contain the image
resp, images = self.client.list_images()
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
@attr(type='smoke')
def test_list_images_with_detail(self):
- """Detailed list of all images should contain the expected images"""
+ # Detailed list of all images should contain the expected images
resp, images = self.client.list_images_with_detail()
found = any([i for i in images if i['id'] == self.image_ref])
self.assertTrue(found)
diff --git a/tempest/tests/compute/keypairs/test_keypairs.py b/tempest/tests/compute/keypairs/test_keypairs.py
index 447d965..7d95a9b 100644
--- a/tempest/tests/compute/keypairs/test_keypairs.py
+++ b/tempest/tests/compute/keypairs/test_keypairs.py
@@ -28,7 +28,7 @@
@attr(type='positive')
def test_keypairs_create_list_delete(self):
- """Keypairs created should be available in the response list"""
+ # Keypairs created should be available in the response list
#Create 3 keypairs
key_list = list()
for i in range(3):
@@ -62,7 +62,7 @@
@attr(type='positive')
def test_keypair_create_delete(self):
- """Keypair should be created, verified and deleted"""
+ # Keypair should be created, verified and deleted
k_name = rand_name('keypair-')
resp, keypair = self.client.create_keypair(k_name)
self.assertEqual(200, resp.status)
@@ -79,7 +79,7 @@
@attr(type='positive')
@unittest.skip("Skipped until the Bug #980688 is resolved")
def test_get_keypair_detail(self):
- """Keypair should be created, Got details by name and deleted"""
+ # Keypair should be created, Got details by name and deleted
k_name = rand_name('keypair-')
resp, keypair = self.client.create_keypair(k_name)
try:
@@ -102,7 +102,7 @@
@attr(type='positive')
def test_keypair_create_with_pub_key(self):
- """Keypair should be created with a given public key"""
+ # Keypair should be created with a given public key
k_name = rand_name('keypair-')
pub_key = ("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs"
"Ne3/1ILNCqFyfYWDeTKLD6jEXC2OQHLmietMWW+/vd"
@@ -126,7 +126,7 @@
@attr(type='negative')
def test_keypair_create_with_invalid_pub_key(self):
- """Keypair should not be created with a non RSA public key"""
+ # Keypair should not be created with a non RSA public key
k_name = rand_name('keypair-')
pub_key = "ssh-rsa JUNK nova@ubuntu"
try:
@@ -139,7 +139,7 @@
@attr(type='negative')
@unittest.skip("Skipped until the Bug #1086980 is resolved")
def test_keypair_delete_nonexistant_key(self):
- """Non-existant key deletion should throw a proper error"""
+ # Non-existant key deletion should throw a proper error
k_name = rand_name("keypair-non-existant-")
try:
resp, _ = self.client.delete_keypair(k_name)
@@ -150,7 +150,7 @@
@attr(type='negative')
def test_create_keypair_with_empty_public_key(self):
- """Keypair should not be created with an empty public key"""
+ # Keypair should not be created with an empty public key
k_name = rand_name("keypair-")
pub_key = ' '
try:
@@ -162,7 +162,7 @@
@attr(type='negative')
def test_create_keypair_when_public_key_bits_exceeds_maximum(self):
- """Keypair should not be created when public key bits are too long"""
+ # Keypair should not be created when public key bits are too long
k_name = rand_name("keypair-")
pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu'
try:
@@ -174,7 +174,7 @@
@attr(type='negative')
def test_create_keypair_with_duplicate_name(self):
- """Keypairs with duplicate names should not be created"""
+ # Keypairs with duplicate names should not be created
k_name = rand_name('keypair-')
resp, _ = self.client.create_keypair(k_name)
self.assertEqual(200, resp.status)
@@ -191,7 +191,7 @@
@attr(type='negative')
def test_create_keypair_with_empty_name_string(self):
- """Keypairs with name being an empty string should not be created"""
+ # Keypairs with name being an empty string should not be created
try:
resp, _ = self.client.create_keypair('')
except exceptions.BadRequest:
@@ -201,7 +201,7 @@
@attr(type='negative')
def test_create_keypair_with_long_keynames(self):
- """Keypairs with name longer than 255 chars should not be created"""
+ # Keypairs with name longer than 255 chars should not be created
k_name = 'keypair-'.ljust(260, '0')
try:
resp, _ = self.client.create_keypair(k_name)
@@ -212,7 +212,7 @@
@attr(type='negative')
def test_create_keypair_invalid_name(self):
- """Keypairs with name being an invalid name should not be created"""
+ # Keypairs with name being an invalid name should not be created
k_name = 'key_/.\@:'
try:
resp, _ = self.client.create_keypair(k_name)
diff --git a/tempest/tests/compute/limits/test_absolute_limits.py b/tempest/tests/compute/limits/test_absolute_limits.py
index ede0dc2..89c5b25 100644
--- a/tempest/tests/compute/limits/test_absolute_limits.py
+++ b/tempest/tests/compute/limits/test_absolute_limits.py
@@ -28,9 +28,7 @@
@unittest.skip("Skipped until the Bug #1025294 is resolved")
def test_absLimits_get(self):
- """
- To check if all limits are present in the response
- """
+ # To check if all limits are present in the response
resp, absolute_limits = self.client.get_absolute_limits()
expected_elements = ['maxImageMeta', 'maxPersonality',
'maxPersonalitySize',
diff --git a/tempest/tests/compute/security_groups/test_security_group_rules.py b/tempest/tests/compute/security_groups/test_security_group_rules.py
index ab5af92..805adf4 100644
--- a/tempest/tests/compute/security_groups/test_security_group_rules.py
+++ b/tempest/tests/compute/security_groups/test_security_group_rules.py
@@ -30,10 +30,8 @@
@attr(type='positive')
def test_security_group_rules_create(self):
- """
- Positive test: Creation of Security Group rule
- should be successfull
- """
+ # Positive test: Creation of Security Group rule
+ # should be successfull
try:
#Creating a Security Group to add rules to it
s_name = rand_name('securitygroup-')
@@ -60,11 +58,10 @@
@attr(type='positive')
def test_security_group_rules_create_with_optional_arguments(self):
- """
- Positive test: Creation of Security Group rule
- with optional arguments
- should be successfull
- """
+ # Positive test: Creation of Security Group rule
+ # with optional arguments
+ # should be successfull
+
rule_id = None
secgroup1 = None
secgroup2 = None
@@ -108,10 +105,8 @@
@attr(type='positive')
def test_security_group_rules_create_delete(self):
- """
- Positive test: Deletion of Security Group rule
- should be successfull
- """
+ # Positive test: Deletion of Security Group rule
+ # should be successfull
try:
#Creating a Security Group to add rule to it
s_name = rand_name('securitygroup-')
@@ -137,10 +132,8 @@
@attr(type='negative')
def test_security_group_rules_create_with_invalid_id(self):
- """
- Negative test: Creation of Security Group rule should FAIL
- with invalid Parent group id
- """
+ # Negative test: Creation of Security Group rule should FAIL
+ # with invalid Parent group id
#Adding rules to the invalid Security Group id
parent_group_id = rand_name('999')
ip_protocol = 'tcp'
@@ -159,10 +152,8 @@
@attr(type='negative')
def test_security_group_rules_create_with_invalid_ip_protocol(self):
- """
- Negative test: Creation of Security Group rule should FAIL
- 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
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -188,10 +179,8 @@
@attr(type='negative')
def test_security_group_rules_create_with_invalid_from_port(self):
- """
- Negative test: Creation of Security Group rule should FAIL
- 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
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -217,10 +206,8 @@
@attr(type='negative')
def test_security_group_rules_create_with_invalid_to_port(self):
- """
- Negative test: Creation of Security Group rule should FAIL
- 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
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -246,10 +233,8 @@
@attr(type='negative')
def test_security_group_rules_delete_with_invalid_id(self):
- """
- Negative test: Deletion of Security Group rule should be FAIL
- with invalid rule id
- """
+ # Negative test: Deletion of Security Group rule should be FAIL
+ # with invalid rule id
try:
self.client.delete_security_group_rule(rand_name('999'))
except exceptions.NotFound:
diff --git a/tempest/tests/compute/security_groups/test_security_groups.py b/tempest/tests/compute/security_groups/test_security_groups.py
index 1c0cc94..5c0bd82 100644
--- a/tempest/tests/compute/security_groups/test_security_groups.py
+++ b/tempest/tests/compute/security_groups/test_security_groups.py
@@ -30,7 +30,7 @@
@attr(type='positive')
def test_security_groups_create_list_delete(self):
- """Positive test:Should return the list of Security Groups"""
+ # Positive test:Should return the list of Security Groups
try:
#Create 3 Security Groups
security_group_list = list()
@@ -61,7 +61,7 @@
@attr(type='positive')
def test_security_group_create_delete(self):
- """Security Group should be created, verified and deleted"""
+ # Security Group should be created, verified and deleted
try:
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -83,7 +83,7 @@
@attr(type='positive')
def test_security_group_create_get_delete(self):
- """Security Group should be created, fetched and deleted"""
+ # Security Group should be created, fetched and deleted
try:
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -104,10 +104,8 @@
@attr(type='negative')
def test_security_group_get_nonexistant_group(self):
- """
- Negative test:Should not be able to GET the details
- of nonexistant Security Group
- """
+ # Negative test:Should not be able to GET the details
+ # of nonexistant Security Group
security_group_id = []
resp, body = self.client.list_security_groups()
for i in range(len(body)):
@@ -128,10 +126,8 @@
@attr(type='negative')
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
- """
+ # Negative test: Security Group should not be created with group name
+ # as an empty string/with white spaces/chars more than 255
s_description = rand_name('description-')
#Create Security Group with empty string as group name
try:
@@ -161,10 +157,8 @@
@attr(type='negative')
def test_security_group_create_with_invalid_group_description(self):
- """
- Negative test:Security Group should not be created with description as
- an empty string/with white spaces/chars more than 255
- """
+ # Negative test:Security Group should not be created with description
+ # as an empty string/with white spaces/chars more than 255
s_name = rand_name('securitygroup-')
#Create Security Group with empty string as description
try:
@@ -194,10 +188,8 @@
@attr(type='negative')
def test_security_group_create_with_duplicate_name(self):
- """
- Negative test:Security Group with duplicate name should not
- be created
- """
+ # Negative test:Security Group with duplicate name should not
+ # be created
try:
s_name = rand_name('securitygroup-')
s_description = rand_name('description-')
@@ -220,9 +212,7 @@
@attr(type='negative')
def test_delete_nonexistant_security_group(self):
- """
- Negative test:Deletion of a nonexistant Security Group should Fail
- """
+ # Negative test:Deletion of a nonexistant Security Group should Fail
security_group_id = []
resp, body = self.client.list_security_groups()
for i in range(len(body)):
@@ -242,10 +232,8 @@
@attr(type='negative')
def test_delete_security_group_without_passing_id(self):
- """
- Negative test:Deletion of a Security Group with out passing ID
- should Fail
- """
+ # Negative test:Deletion of a Security Group with out passing ID
+ # should Fail
try:
resp, body = self.client.delete_security_group('')
except exceptions.NotFound:
@@ -255,10 +243,8 @@
'with out passing ID')
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.
- """
+ # 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_name = rand_name('sg')
diff --git a/tempest/tests/compute/servers/test_console_output.py b/tempest/tests/compute/servers/test_console_output.py
index ce1047f..3ad29a1 100644
--- a/tempest/tests/compute/servers/test_console_output.py
+++ b/tempest/tests/compute/servers/test_console_output.py
@@ -43,10 +43,8 @@
@attr(type='positive')
def test_get_console_output(self):
- """
- Positive test:Should be able to GET the console output
- for a given server_id and number of lines
- """
+ # Positive test:Should be able to GET the console output
+ # for a given server_id and number of lines
def get_output():
resp, output = self.client.get_console_output(self.server_id, 10)
self.assertEqual(200, resp.status)
@@ -57,10 +55,8 @@
@attr(type='negative')
def test_get_console_output_invalid_server_id(self):
- """
- Negative test: Should not be able to get the console output
- for an invalid server_id
- """
+ # Negative test: Should not be able to get the console output
+ # for an invalid server_id
try:
resp, output = self.client.get_console_output('!@#$%^&*()', 10)
except exceptions.NotFound:
@@ -69,10 +65,8 @@
@attr(type='positive')
@unittest.skip('Until tempest bug 1014683 is fixed.')
def test_get_console_output_server_id_in_reboot_status(self):
- """
- Positive test:Should be able to GET the console output
- for a given server_id in reboot status
- """
+ # Positive test:Should be able to GET the console output
+ # for a given server_id in reboot status
try:
resp, output = self.servers_client.reboot(self.server_id, 'SOFT')
self.servers_client.wait_for_server_status(self.server_id,
diff --git a/tempest/tests/compute/servers/test_create_server.py b/tempest/tests/compute/servers/test_create_server.py
index c916ae8..c5a54dc 100644
--- a/tempest/tests/compute/servers/test_create_server.py
+++ b/tempest/tests/compute/servers/test_create_server.py
@@ -65,14 +65,14 @@
@attr(type='smoke')
def test_create_server_response(self):
- """Check that the required fields are returned with values"""
+ # Check that the required fields are returned with values
self.assertEqual(202, self.resp.status)
self.assertTrue(self.server_initial['id'] is not None)
self.assertTrue(self.server_initial['adminPass'] is not None)
@attr(type='smoke')
def test_verify_server_details(self):
- """Verify the specified server attributes are set correctly"""
+ # Verify the specified server attributes are set correctly
self.assertEqual(self.accessIPv4, self.server['accessIPv4'])
self.assertIn(self.server['accessIPv6'],
[self.accessIPv6, self.accessIPv6canon])
@@ -83,7 +83,7 @@
@attr(type='smoke')
def test_list_servers(self):
- """The created server should be in the list of all servers"""
+ # The created server should be in the list of all servers
resp, body = self.client.list_servers()
servers = body['servers']
found = any([i for i in servers if i['id'] == self.server['id']])
@@ -91,7 +91,7 @@
@attr(type='smoke')
def test_list_servers_with_detail(self):
- """The created server should be in the detailed list of all servers"""
+ # The created server should be in the detailed list of all servers
resp, body = self.client.list_servers_with_detail()
servers = body['servers']
found = any([i for i in servers if i['id'] == self.server['id']])
@@ -100,17 +100,15 @@
@attr(type='positive')
@unittest.skipIf(not run_ssh, 'Instance validation tests are disabled.')
def test_can_log_into_created_server(self):
- """Check that the user can authenticate with the generated password"""
+ # Check that the user can authenticate with the generated password
linux_client = RemoteClient(self.server, self.ssh_user, self.password)
self.assertTrue(linux_client.can_authenticate())
@attr(type='positive')
@unittest.skipIf(not run_ssh, 'Instance validation tests are disabled.')
def test_verify_created_server_vcpus(self):
- """
- Verify that the number of vcpus reported by the instance matches
- the amount stated by the flavor
- """
+ # Verify that the number of vcpus reported by the instance matches
+ # the amount stated by the flavor
resp, flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
linux_client = RemoteClient(self.server, self.ssh_user, self.password)
self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
@@ -118,7 +116,7 @@
@attr(type='positive')
@unittest.skipIf(not run_ssh, 'Instance validation tests are disabled.')
def test_host_name_is_same_as_server_name(self):
- """Verify the instance host name is the same as the server name"""
+ # Verify the instance host name is the same as the server name
linux_client = RemoteClient(self.server, self.ssh_user, self.password)
self.assertTrue(linux_client.hostname_equals_servername(self.name))
diff --git a/tempest/tests/compute/servers/test_disk_config.py b/tempest/tests/compute/servers/test_disk_config.py
index 7ff666f..490156b 100644
--- a/tempest/tests/compute/servers/test_disk_config.py
+++ b/tempest/tests/compute/servers/test_disk_config.py
@@ -37,7 +37,7 @@
@attr(type='positive')
def test_rebuild_server_with_manual_disk_config(self):
- """A server should be rebuilt using the manual disk config option"""
+ # A server should be rebuilt using the manual disk config option
name = rand_name('server')
resp, server = self.create_server_with_extras(name,
self.image_ref,
@@ -67,7 +67,7 @@
@attr(type='positive')
def test_rebuild_server_with_auto_disk_config(self):
- """A server should be rebuilt using the auto disk config option"""
+ # A server should be rebuilt using the auto disk config option
name = rand_name('server')
resp, server = self.create_server_with_extras(name,
self.image_ref,
@@ -98,7 +98,7 @@
@attr(type='positive')
@unittest.skipUnless(compute.RESIZE_AVAILABLE, 'Resize not available.')
def test_resize_server_from_manual_to_auto(self):
- """A server should be resized from manual to auto disk config"""
+ # A server should be resized from manual to auto disk config
name = rand_name('server')
resp, server = self.create_server_with_extras(name,
self.image_ref,
@@ -124,7 +124,7 @@
@attr(type='positive')
@unittest.skipUnless(compute.RESIZE_AVAILABLE, 'Resize not available.')
def test_resize_server_from_auto_to_manual(self):
- """A server should be resized from auto to manual disk config"""
+ # A server should be resized from auto to manual disk config
name = rand_name('server')
resp, server = self.create_server_with_extras(name,
self.image_ref,
diff --git a/tempest/tests/compute/servers/test_list_server_filters.py b/tempest/tests/compute/servers/test_list_server_filters.py
index 3aeb8e8..5eea24f 100644
--- a/tempest/tests/compute/servers/test_list_server_filters.py
+++ b/tempest/tests/compute/servers/test_list_server_filters.py
@@ -94,7 +94,7 @@
@utils.skip_unless_attr('multiple_images', 'Only one image found')
@attr(type='positive')
def test_list_servers_filter_by_image(self):
- """Filter the list of servers by image"""
+ # Filter the list of servers by image
params = {'image': self.image_ref}
resp, body = self.client.list_servers(params)
servers = body['servers']
@@ -105,7 +105,7 @@
@attr(type='positive')
def test_list_servers_filter_by_flavor(self):
- """Filter the list of servers by flavor"""
+ # Filter the list of servers by flavor
params = {'flavor': self.flavor_ref_alt}
resp, body = self.client.list_servers(params)
servers = body['servers']
@@ -116,7 +116,7 @@
@attr(type='positive')
def test_list_servers_filter_by_server_name(self):
- """Filter the list of servers by server name"""
+ # Filter the list of servers by server name
params = {'name': self.s1_name}
resp, body = self.client.list_servers(params)
servers = body['servers']
@@ -127,7 +127,7 @@
@attr(type='positive')
def test_list_servers_filter_by_server_status(self):
- """Filter the list of servers by server status"""
+ # Filter the list of servers by server status
params = {'status': 'active'}
resp, body = self.client.list_servers(params)
servers = body['servers']
@@ -138,7 +138,7 @@
@attr(type='positive')
def test_list_servers_limit_results(self):
- """Verify only the expected number of servers are returned"""
+ # Verify only the expected number of servers are returned
params = {'limit': 1}
resp, servers = self.client.list_servers_with_detail(params)
self.assertEqual(1, len(servers['servers']))
@@ -146,7 +146,7 @@
@utils.skip_unless_attr('multiple_images', 'Only one image found')
@attr(type='positive')
def test_list_servers_detailed_filter_by_image(self):
- """Filter the detailed list of servers by image"""
+ # Filter the detailed list of servers by image
params = {'image': self.image_ref}
resp, body = self.client.list_servers_with_detail(params)
servers = body['servers']
@@ -157,7 +157,7 @@
@attr(type='positive')
def test_list_servers_detailed_filter_by_flavor(self):
- """Filter the detailed list of servers by flavor"""
+ # Filter the detailed list of servers by flavor
params = {'flavor': self.flavor_ref_alt}
resp, body = self.client.list_servers_with_detail(params)
servers = body['servers']
@@ -168,7 +168,7 @@
@attr(type='positive')
def test_list_servers_detailed_filter_by_server_name(self):
- """Filter the detailed list of servers by server name"""
+ # Filter the detailed list of servers by server name
params = {'name': self.s1_name}
resp, body = self.client.list_servers_with_detail(params)
servers = body['servers']
@@ -179,7 +179,7 @@
@attr(type='positive')
def test_list_servers_detailed_filter_by_server_status(self):
- """Filter the detailed list of servers by server status"""
+ # Filter the detailed list of servers by server status
params = {'status': 'active'}
resp, body = self.client.list_servers_with_detail(params)
servers = body['servers']
@@ -190,7 +190,7 @@
@attr(type='positive')
def test_list_servers_detailed_limit_results(self):
- """Verify only the expected number of detailed results are returned"""
+ # Verify only the expected number of detailed results are returned
params = {'limit': 1}
resp, servers = self.client.list_servers_with_detail(params)
self.assertEqual(1, len(servers['servers']))
diff --git a/tempest/tests/compute/servers/test_list_servers_negative.py b/tempest/tests/compute/servers/test_list_servers_negative.py
index dc6e339..e98d8f0 100644
--- a/tempest/tests/compute/servers/test_list_servers_negative.py
+++ b/tempest/tests/compute/servers/test_list_servers_negative.py
@@ -97,7 +97,7 @@
cls.deleted_fixtures.append(srv)
def test_list_servers_with_a_deleted_server(self):
- """Verify deleted servers do not show by default in list servers"""
+ # Verify deleted servers do not show by default in list servers
# List servers and verify server not returned
resp, body = self.client.list_servers()
servers = body['servers']
@@ -108,7 +108,7 @@
self.assertEqual([], actual)
def test_list_servers_by_non_existing_image(self):
- """Listing servers for a non existing image returns empty list"""
+ # Listing servers for a non existing image returns empty list
non_existing_image = '1234abcd-zzz0-aaa9-ppp3-0987654abcde'
resp, body = self.client.list_servers(dict(image=non_existing_image))
servers = body['servers']
@@ -116,7 +116,7 @@
self.assertEqual([], servers)
def test_list_servers_by_non_existing_flavor(self):
- """Listing servers by non existing flavor returns empty list"""
+ # Listing servers by non existing flavor returns empty list
non_existing_flavor = 1234
resp, body = self.client.list_servers(dict(flavor=non_existing_flavor))
servers = body['servers']
@@ -124,7 +124,7 @@
self.assertEqual([], servers)
def test_list_servers_by_non_existing_server_name(self):
- """Listing servers for a non existent server name returns empty list"""
+ # Listing servers for a non existent server name returns empty list
non_existing_name = 'junk_server_1234'
resp, body = self.client.list_servers(dict(name=non_existing_name))
servers = body['servers']
@@ -133,7 +133,7 @@
@unittest.skip("Skip until bug 1061712 is resolved")
def test_list_servers_status_non_existing(self):
- """Return an empty list when invalid status is specified"""
+ # Return an empty list when invalid status is specified
non_existing_status = 'BALONEY'
resp, body = self.client.list_servers(dict(status=non_existing_status))
servers = body['servers']
@@ -141,29 +141,29 @@
self.assertEqual([], servers)
def test_list_servers_by_limits(self):
- """List servers by specifying limits"""
+ # List servers by specifying limits
resp, body = self.client.list_servers({'limit': 1})
self.assertEqual('200', resp['status'])
self.assertEqual(1, len(body['servers']))
def test_list_servers_by_limits_greater_than_actual_count(self):
- """List servers by specifying a greater value for limit"""
+ # List servers by specifying a greater value for limit
resp, body = self.client.list_servers({'limit': 100})
self.assertEqual('200', resp['status'])
self.assertEqual(len(self.existing_fixtures), len(body['servers']))
def test_list_servers_by_limits_pass_string(self):
- """Return an error if a string value is passed for limit"""
+ # Return an error if a string value is passed for limit
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
{'limit': 'testing'})
def test_list_servers_by_limits_pass_negative_value(self):
- """Return an error if a negative value for limit is passed"""
+ # Return an error if a negative value for limit is passed
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
{'limit': -1})
def test_list_servers_by_changes_since(self):
- """Servers are listed by specifying changes-since date"""
+ # Servers are listed by specifying changes-since date
changes_since = {'changes-since': '2011-01-01T12:34:00Z'}
resp, body = self.client.list_servers(changes_since)
self.assertEqual('200', resp['status'])
@@ -173,19 +173,19 @@
self.assertEqual(num_expected, len(body['servers']))
def test_list_servers_by_changes_since_invalid_date(self):
- """Return an error when invalid date format is passed"""
+ # Return an error when invalid date format is passed
self.assertRaises(exceptions.BadRequest, self.client.list_servers,
{'changes-since': '2011/01/01'})
def test_list_servers_by_changes_since_future_date(self):
- """Return an empty list when a date in the future is passed"""
+ # Return an empty list when a date in the future is passed
changes_since = {'changes-since': '2051-01-01T12:34:00Z'}
resp, body = self.client.list_servers(changes_since)
self.assertEqual('200', resp['status'])
self.assertEqual(0, len(body['servers']))
def test_list_servers_detail_server_is_deleted(self):
- """Server details are not listed for a deleted server"""
+ # Server details are not listed for a deleted server
deleted_ids = [s['id'] for s in self.deleted_fixtures]
resp, body = self.client.list_servers_with_detail()
servers = body['servers']
diff --git a/tempest/tests/compute/servers/test_server_actions.py b/tempest/tests/compute/servers/test_server_actions.py
index df971e9..f4e62b1 100644
--- a/tempest/tests/compute/servers/test_server_actions.py
+++ b/tempest/tests/compute/servers/test_server_actions.py
@@ -50,7 +50,7 @@
@unittest.skipUnless(compute.CHANGE_PASSWORD_AVAILABLE,
'Change password not available.')
def test_change_server_password(self):
- """The server's password should be set to the provided password"""
+ # The server's password should be set to the provided password
new_password = 'Newpass1234'
resp, body = self.client.change_password(self.server_id, new_password)
self.assertEqual(202, resp.status)
@@ -64,7 +64,7 @@
@attr(type='smoke')
def test_reboot_server_hard(self):
- """ The server should be power cycled """
+ # The server should be power cycled
if self.run_ssh:
# Get the time the server was last rebooted,
# waiting for one minute as who doesn't have seconds precision
@@ -86,7 +86,7 @@
@attr(type='smoke')
@unittest.skip('Until bug 1014647 is dealt with.')
def test_reboot_server_soft(self):
- """The server should be signaled to reboot gracefully"""
+ # The server should be signaled to reboot gracefully
if self.run_ssh:
# Get the time the server was last rebooted,
# waiting for one minute as who doesn't have seconds precision
@@ -107,7 +107,7 @@
@attr(type='smoke')
def test_rebuild_server(self):
- """ The server should be rebuilt using the provided image and data """
+ # The server should be rebuilt using the provided image and data
meta = {'rebuild': 'server'}
new_name = rand_name('server')
file_contents = 'Test server rebuild.'
@@ -141,10 +141,8 @@
@attr(type='smoke')
@unittest.skipIf(not resize_available, 'Resize not available.')
def test_resize_server_confirm(self):
- """
- The server's RAM and disk space should be modified to that of
- the provided flavor
- """
+ # The server's RAM and disk space should be modified to that of
+ # the provided flavor
resp, server = self.client.resize(self.server_id, self.flavor_ref_alt)
self.assertEqual(202, resp.status)
@@ -159,10 +157,8 @@
@attr(type='positive')
@unittest.skipIf(not resize_available, 'Resize not available.')
def test_resize_server_revert(self):
- """
- The server's RAM and disk space should return to its original
- values after a resize is reverted
- """
+ # The server's RAM and disk space should return to its original
+ # values after a resize is reverted
resp, server = self.client.resize(self.server_id, self.flavor_ref_alt)
self.assertEqual(202, resp.status)
@@ -186,18 +182,14 @@
@attr(type='negative')
def test_reboot_nonexistent_server_soft(self):
- """
- Negative Test: The server reboot on non existent server should return
- an error
- """
+ # Negative Test: The server reboot on non existent server should return
+ # an error
self.assertRaises(exceptions.NotFound, self.client.reboot, 999, 'SOFT')
@attr(type='negative')
def test_rebuild_nonexistent_server(self):
- """
- Negative test: The server rebuild for a non existing server should not
- be allowed
- """
+ # Negative test: The server rebuild for a non existing server
+ # should not be allowed
meta = {'rebuild': 'server'}
new_name = rand_name('server')
file_contents = 'Test server rebuild.'
diff --git a/tempest/tests/compute/servers/test_server_addresses.py b/tempest/tests/compute/servers/test_server_addresses.py
index 745a9d8..6e819a2 100644
--- a/tempest/tests/compute/servers/test_server_addresses.py
+++ b/tempest/tests/compute/servers/test_server_addresses.py
@@ -42,7 +42,7 @@
@attr(type='negative', category='server-addresses')
def test_list_server_addresses_invalid_server_id(self):
- """List addresses request should fail if server id not in system"""
+ # List addresses request should fail if server id not in system
try:
self.client.list_addresses('999')
@@ -54,7 +54,7 @@
@attr(type='negative', category='server-addresses')
def test_list_server_addresses_by_network_neg(self):
- """List addresses by network should fail if network name not valid"""
+ # List addresses by network should fail if network name not valid
try:
self.client.list_addresses_by_network(self.server['id'], 'invalid')
@@ -66,8 +66,8 @@
@attr(type='smoke', category='server-addresses')
def test_list_server_addresses(self):
- """All public and private addresses for
- a server should be returned"""
+ # All public and private addresses for
+ # a server should be returned
resp, addresses = self.client.list_addresses(self.server['id'])
self.assertEqual('200', resp['status'])
@@ -83,8 +83,8 @@
@attr(type='smoke', category='server-addresses')
def test_list_server_addresses_by_network(self):
- """Providing a network type should filter
- the addresses return by that type"""
+ # Providing a network type should filter
+ # the addresses return by that type
resp, addresses = self.client.list_addresses(self.server['id'])
diff --git a/tempest/tests/compute/servers/test_server_metadata.py b/tempest/tests/compute/servers/test_server_metadata.py
index 0198e4e..6c44c3c 100644
--- a/tempest/tests/compute/servers/test_server_metadata.py
+++ b/tempest/tests/compute/servers/test_server_metadata.py
@@ -49,7 +49,7 @@
self.assertEqual(resp.status, 200)
def test_list_server_metadata(self):
- """All metadata key/value pairs for a server should be returned"""
+ # All metadata key/value pairs for a server should be returned
resp, resp_metadata = self.client.list_server_metadata(self.server_id)
#Verify the expected metadata items are in the list
@@ -58,7 +58,7 @@
self.assertEqual(expected, resp_metadata)
def test_set_server_metadata(self):
- """The server's metadata should be replaced with the provided values"""
+ # The server's metadata should be replaced with the provided values
#Create a new set of metadata for the server
req_metadata = {'meta2': 'data2', 'meta3': 'data3'}
resp, metadata = self.client.set_server_metadata(self.server_id,
@@ -71,10 +71,10 @@
self.assertEqual(resp_metadata, req_metadata)
def test_server_create_metadata_key_too_long(self):
- """
- Attempt to start a server with a meta-data key that is > 255 characters
- Try a few values
- """
+ # Attempt to start a server with a meta-data key that is > 255
+ # characters
+
+ # Try a few values
for sz in [256, 257, 511, 1023]:
key = "k" * sz
meta = {key: 'data1'}
@@ -87,10 +87,8 @@
# no teardown - all creates should fail
def test_update_server_metadata(self):
- """
- The server's metadata values should be updated to the
- provided values
- """
+ # The server's metadata values should be updated to the
+ # provided values
meta = {'key1': 'alt1', 'key3': 'value3'}
resp, metadata = self.client.update_server_metadata(self.server_id,
meta)
@@ -102,13 +100,13 @@
self.assertEqual(expected, resp_metadata)
def test_get_server_metadata_item(self):
- """ The value for a specic metadata key should be returned """
+ # The value for a specic metadata key should be returned
resp, meta = self.client.get_server_metadata_item(self.server_id,
'key2')
self.assertTrue('value2', meta['key2'])
def test_set_server_metadata_item(self):
- """The item's value should be updated to the provided value"""
+ # The item's value should be updated to the provided value
#Update the metadata value
meta = {'nova': 'alt'}
resp, body = self.client.set_server_metadata_item(self.server_id,
@@ -121,7 +119,7 @@
self.assertEqual(expected, resp_metadata)
def test_delete_server_metadata_item(self):
- """The metadata value/key pair should be deleted from the server"""
+ # The metadata value/key pair should be deleted from the server
resp, meta = self.client.delete_server_metadata_item(self.server_id,
'key1')
self.assertEqual(204, resp.status)
@@ -133,7 +131,7 @@
@attr(type='negative')
def test_get_nonexistant_server_metadata_item(self):
- """Negative test: GET on nonexistant server should not succeed"""
+ # Negative test: GET on nonexistant server should not succeed
try:
resp, meta = self.client.get_server_metadata_item(999, 'test2')
except Exception:
@@ -143,9 +141,8 @@
@attr(type='negative')
def test_list_nonexistant_server_metadata(self):
- """
- Negative test:List metadata on a non existant server should not succeed
- """
+ # Negative test:List metadata on a non existant server should
+ # not succeed
try:
resp, metadata = self.client.list_server_metadata(999)
except Exception:
@@ -156,9 +153,8 @@
@attr(type='negative')
def test_set_nonexistant_server_metadata(self):
- """
- Negative test: Set metadata on a non existant server should not succeed
- """
+ # Negative test: Set metadata on a non existant server should not
+ # succeed
meta = {'meta1': 'data1'}
try:
resp, metadata = self.client.set_server_metadata(999, meta)
@@ -170,9 +166,7 @@
@attr(type='negative')
def test_update_nonexistant_server_metadata(self):
- """
- Negative test: An update should not happen for a nonexistant image
- """
+ # Negative test: An update should not happen for a nonexistant image
meta = {'key1': 'value1', 'key2': 'value2'}
try:
resp, metadata = self.client.update_server_metadata(999, meta)
@@ -183,10 +177,8 @@
@attr(type='negative')
def test_delete_nonexistant_server_metadata_item(self):
- """
- Negative test: Should not be able to delete metadata item from a
- nonexistant server
- """
+ # Negative test: Should not be able to delete metadata item from a
+ # nonexistant server
meta = {'d': 'delvalue'}
#Delete the metadata item
diff --git a/tempest/tests/compute/servers/test_server_personality.py b/tempest/tests/compute/servers/test_server_personality.py
index 320bac4..6ea0959 100644
--- a/tempest/tests/compute/servers/test_server_personality.py
+++ b/tempest/tests/compute/servers/test_server_personality.py
@@ -27,10 +27,8 @@
class ServerPersonalityTestBase(object):
def test_personality_files_exceed_limit(self):
- """
- Server creation should fail if greater than the maximum allowed
- number of files are injected into the server.
- """
+ # Server creation should fail if greater than the maximum allowed
+ # number of files are injected into the server.
name = rand_name('server')
file_contents = 'This is a test file.'
personality = []
@@ -51,10 +49,8 @@
@attr(type='positive')
def test_can_create_server_with_max_number_personality_files(self):
- """
- Server should be created successfully if maximum allowed number of
- files is injected into the server during creation.
- """
+ # Server should be created successfully if maximum allowed number of
+ # files is injected into the server during creation.
try:
name = rand_name('server')
file_contents = 'This is a test file.'
diff --git a/tempest/tests/compute/servers/test_servers.py b/tempest/tests/compute/servers/test_servers.py
index fcf9975..3566ef4 100644
--- a/tempest/tests/compute/servers/test_servers.py
+++ b/tempest/tests/compute/servers/test_servers.py
@@ -25,10 +25,8 @@
@attr(type='positive')
def test_create_server_with_admin_password(self):
- """
- If an admin password is provided on server creation, the server's root
- password should be set to that password.
- """
+ # If an admin password is provided on server creation, the server's
+ # root password should be set to that password.
try:
server = None
@@ -47,7 +45,7 @@
self.client.delete_server(server['id'])
def test_create_with_existing_server_name(self):
- """Creating a server with a name that already exists is allowed"""
+ # Creating a server with a name that already exists is allowed
try:
id1 = None
@@ -76,7 +74,7 @@
@attr(type='positive')
def test_create_specify_keypair(self):
- """Specify a keypair while creating a server"""
+ # Specify a keypair while creating a server
try:
server = None
@@ -98,7 +96,7 @@
@attr(type='positive')
def test_update_server_name(self):
- """The server name should be changed to the the provided value"""
+ # The server name should be changed to the the provided value
try:
server = None
name = rand_name('server')
@@ -123,9 +121,7 @@
@attr(type='positive')
def test_update_access_server_address(self):
- """
- The server's access addresses should reflect the provided values
- """
+ # The server's access addresses should reflect the provided values
try:
server = None
name = rand_name('server')
@@ -151,7 +147,7 @@
self.client.delete_server(server['id'])
def test_delete_server_while_in_building_state(self):
- """Delete a server while it's VM state is Building"""
+ # Delete a server while it's VM state is Building
name = rand_name('server')
resp, server = self.create_server_with_extras(name, self.image_ref,
self.flavor_ref)
diff --git a/tempest/tests/compute/servers/test_servers_negative.py b/tempest/tests/compute/servers/test_servers_negative.py
index fd067cd..970f6bc 100644
--- a/tempest/tests/compute/servers/test_servers_negative.py
+++ b/tempest/tests/compute/servers/test_servers_negative.py
@@ -40,7 +40,7 @@
@attr(type='negative')
def test_server_name_blank(self):
- """Create a server with name parameter empty"""
+ # Create a server with name parameter empty
try:
resp, server = self.create_server_with_extras('',
self.image_ref,
@@ -52,7 +52,7 @@
@attr(type='negative')
def test_personality_file_contents_not_encoded(self):
- """Use an unencoded file when creating a server with personality"""
+ # Use an unencoded file when creating a server with personality
file_contents = 'This is a test file.'
person = [{'path': '/etc/testfile.txt',
'contents': file_contents}]
@@ -69,7 +69,7 @@
@attr(type='negative')
def test_create_with_invalid_image(self):
- """Create a server with an unknown image"""
+ # Create a server with an unknown image
try:
resp, server = self.create_server_with_extras('fail', -1,
self.flavor_ref)
@@ -80,7 +80,7 @@
@attr(type='negative')
def test_create_with_invalid_flavor(self):
- """Create a server with an unknown flavor"""
+ # Create a server with an unknown flavor
try:
self.create_server_with_extras('fail', self.image_ref, -1)
except exceptions.BadRequest:
@@ -90,7 +90,7 @@
@attr(type='negative')
def test_invalid_access_ip_v4_address(self):
- """An access IPv4 address must match a valid address pattern"""
+ # An access IPv4 address must match a valid address pattern
IPv4 = '1.1.1.1.1.1'
name = rand_name('server')
try:
@@ -105,7 +105,7 @@
@attr(type='negative')
def test_invalid_ip_v6_address(self):
- """An access IPv6 address must match a valid address pattern"""
+ # An access IPv6 address must match a valid address pattern
IPv6 = 'notvalid'
name = rand_name('server')
try:
@@ -120,7 +120,7 @@
@attr(type='negative')
def test_reboot_deleted_server(self):
- """Reboot a deleted server"""
+ # Reboot a deleted server
self.name = rand_name('server')
resp, create_server = self.create_server_with_extras(self.name,
self.image_ref,
@@ -137,7 +137,7 @@
@attr(type='negative')
def test_rebuild_deleted_server(self):
- """Rebuild a deleted server"""
+ # Rebuild a deleted server
self.name = rand_name('server')
resp, create_server = self.create_server_with_extras(self.name,
self.image_ref,
@@ -155,7 +155,7 @@
@attr(type='negative')
def test_create_numeric_server_name(self):
- """Create a server with a numeric name"""
+ # Create a server with a numeric name
server_name = 12345
self.assertRaises(exceptions.BadRequest,
@@ -164,7 +164,7 @@
@attr(type='negative')
def test_create_server_name_length_exceeds_256(self):
- """Create a server with name length exceeding 256 characters"""
+ # Create a server with name length exceeding 256 characters
server_name = 'a' * 256
self.assertRaises(exceptions.BadRequest,
@@ -173,7 +173,7 @@
@attr(type='negative')
def test_create_with_invalid_network_uuid(self):
- """Pass invalid network uuid while creating a server"""
+ # Pass invalid network uuid while creating a server
server_name = rand_name('server')
networks = [{'fixed_ip': '10.0.1.1', 'uuid':'a-b-c-d-e-f-g-h-i-j'}]
@@ -185,7 +185,7 @@
@attr(type='negative')
def test_create_with_non_existant_keypair(self):
- """Pass a non existant keypair while creating a server"""
+ # Pass a non existant keypair while creating a server
key_name = rand_name('key')
server_name = rand_name('server')
@@ -197,7 +197,7 @@
@unittest.skip("Until Bug 1004007 is fixed")
@attr(type='negative')
def test_create_server_metadata_exceeds_length_limit(self):
- """Pass really long metadata while creating a server"""
+ # Pass really long metadata while creating a server
server_name = rand_name('server')
metadata = {'a': 'b' * 260}
@@ -208,7 +208,7 @@
@attr(type='negative')
def test_update_name_of_non_existent_server(self):
- """Update name of a non-existent server"""
+ # Update name of a non-existent server
server_name = rand_name('server')
new_name = rand_name('server') + '_updated'
@@ -218,7 +218,7 @@
@attr(type='negative')
def test_update_server_set_empty_name(self):
- """Update name of the server to an empty string"""
+ # Update name of the server to an empty string
server_name = rand_name('server')
new_name = ''
@@ -228,7 +228,7 @@
@attr(type='negative')
def test_update_server_of_another_tenant(self):
- """Update name of a server that belongs to another tenant"""
+ # Update name of a server that belongs to another tenant
server = self.create_server()
new_name = server['id'] + '_new'
@@ -238,7 +238,7 @@
@attr(type='negative')
def test_update_server_name_length_exceeds_256(self):
- """Update name of server exceed the name length limit"""
+ # Update name of server exceed the name length limit
server = self.create_server()
new_name = 'a' * 256
@@ -249,14 +249,14 @@
@attr(type='negative')
def test_delete_non_existent_server(self):
- """Delete a non existent server"""
+ # Delete a non existent server
self.assertRaises(exceptions.NotFound, self.client.delete_server,
'999erra43')
@attr(type='negative')
def test_delete_a_server_of_another_tenant(self):
- """Delete a server that belongs to another tenant"""
+ # Delete a server that belongs to another tenant
try:
server = self.create_server()
self.assertRaises(exceptions.NotFound,
@@ -267,13 +267,13 @@
@attr(type='negative')
def test_delete_server_pass_negative_id(self):
- """Pass an invalid string parameter to delete server"""
+ # Pass an invalid string parameter to delete server
self.assertRaises(exceptions.NotFound, self.client.delete_server, -1)
@attr(type='negative')
def test_delete_server_pass_id_exceeding_length_limit(self):
- """Pass a server ID that exceeds length limit to delete server"""
+ # Pass a server ID that exceeds length limit to delete server
self.assertRaises(exceptions.NotFound, self.client.delete_server,
sys.maxint + 1)
diff --git a/tempest/tests/compute/servers/test_servers_whitebox.py b/tempest/tests/compute/servers/test_servers_whitebox.py
index 16254e7..8aca745 100644
--- a/tempest/tests/compute/servers/test_servers_whitebox.py
+++ b/tempest/tests/compute/servers/test_servers_whitebox.py
@@ -53,7 +53,7 @@
continue
def test_create_server_vcpu_quota_full(self):
- """Disallow server creation when tenant's vcpu quota is full"""
+ # Disallow server creation when tenant's vcpu quota is full
quotas = self.meta.tables['quotas']
stmt = quotas.select().where(
quotas.c.project_id == self.tenant_id).where(
@@ -85,7 +85,7 @@
self.connection.execute(stmt, autocommit=True)
def test_create_server_memory_quota_full(self):
- """Disallow server creation when tenant's memory quota is full"""
+ # Disallow server creation when tenant's memory quota is full
quotas = self.meta.tables['quotas']
stmt = quotas.select().where(
quotas.c.project_id == self.tenant_id).where(
@@ -171,83 +171,81 @@
self.update_state(self.shared_server['id'], 'active', None)
def test_delete_server_when_vm_eq_building_task_eq_networking(self):
- """Delete server when instance states are building,networking"""
+ # Delete server when instance states are building,networking
self._test_delete_server_base('building', 'networking')
def test_delete_server_when_vm_eq_building_task_eq_bdm(self):
- """
- Delete server when instance states are building,block device mapping
- """
+ # Delete server when instance states are building,block device mapping
self._test_delete_server_base('building', 'block_device_mapping')
def test_delete_server_when_vm_eq_building_task_eq_spawning(self):
- """Delete server when instance states are building,spawning"""
+ # Delete server when instance states are building,spawning
self._test_delete_server_base('building', 'spawning')
def test_delete_server_when_vm_eq_active_task_eq_image_backup(self):
- """Delete server when instance states are active,image_backup"""
+ # Delete server when instance states are active,image_backup
self._test_delete_server_base('active', 'image_backup')
def test_delete_server_when_vm_eq_active_task_eq_rebuilding(self):
- """Delete server when instance states are active,rebuilding"""
+ # Delete server when instance states are active,rebuilding
self._test_delete_server_base('active', 'rebuilding')
def test_delete_server_when_vm_eq_error_task_eq_spawning(self):
- """Delete server when instance states are error,spawning"""
+ # Delete server when instance states are error,spawning
self._test_delete_server_base('error', 'spawning')
def test_delete_server_when_vm_eq_resized_task_eq_resize_prep(self):
- """Delete server when instance states are resized,resize_prep"""
+ # Delete server when instance states are resized,resize_prep
self._test_delete_server_403_base('resized', 'resize_prep')
def test_delete_server_when_vm_eq_resized_task_eq_resize_migrating(self):
- """Delete server when instance states are resized,resize_migrating"""
+ # Delete server when instance states are resized,resize_migrating
self._test_delete_server_403_base('resized', 'resize_migrating')
def test_delete_server_when_vm_eq_resized_task_eq_resize_migrated(self):
- """Delete server when instance states are resized,resize_migrated"""
+ # Delete server when instance states are resized,resize_migrated
self._test_delete_server_403_base('resized', 'resize_migrated')
def test_delete_server_when_vm_eq_resized_task_eq_resize_finish(self):
- """Delete server when instance states are resized,resize_finish"""
+ # Delete server when instance states are resized,resize_finish
self._test_delete_server_403_base('resized', 'resize_finish')
def test_delete_server_when_vm_eq_resized_task_eq_resize_reverting(self):
- """Delete server when instance states are resized,resize_reverting"""
+ # Delete server when instance states are resized,resize_reverting
self._test_delete_server_403_base('resized', 'resize_reverting')
def test_delete_server_when_vm_eq_resized_task_eq_resize_confirming(self):
- """Delete server when instance states are resized,resize_confirming"""
+ # Delete server when instance states are resized,resize_confirming
self._test_delete_server_403_base('resized', 'resize_confirming')
def test_delete_server_when_vm_eq_active_task_eq_resize_verify(self):
- """Delete server when instance states are active,resize_verify"""
+ # Delete server when instance states are active,resize_verify
self._test_delete_server_base('active', 'resize_verify')
def test_delete_server_when_vm_eq_active_task_eq_rebooting(self):
- """Delete server when instance states are active,rebooting"""
+ # Delete server when instance states are active,rebooting
self._test_delete_server_base('active', 'rebooting')
def test_delete_server_when_vm_eq_building_task_eq_deleting(self):
- """Delete server when instance states are building,deleting"""
+ # Delete server when instance states are building,deleting
self._test_delete_server_base('building', 'deleting')
def test_delete_server_when_vm_eq_active_task_eq_deleting(self):
- """Delete server when instance states are active,deleting"""
+ # Delete server when instance states are active,deleting
self._test_delete_server_base('active', 'deleting')
def test_delete_server_when_vm_eq_error_task_eq_none(self):
- """Delete server when instance states are error,None"""
+ # Delete server when instance states are error,None
self._test_delete_server_base('error', None)
def test_delete_server_when_vm_eq_resized_task_eq_none(self):
- """Delete server when instance states are resized,None"""
+ # Delete server when instance states are resized,None
self._test_delete_server_403_base('resized', None)
def test_delete_server_when_vm_eq_error_task_eq_resize_prep(self):
- """Delete server when instance states are error,resize_prep"""
+ # Delete server when instance states are error,resize_prep
self._test_delete_server_base('error', 'resize_prep')
def test_delete_server_when_vm_eq_error_task_eq_error(self):
- """Delete server when instance states are error,error"""
+ # Delete server when instance states are error,error
self._test_delete_server_base('error', 'error')
diff --git a/tempest/tests/compute/test_authorization.py b/tempest/tests/compute/test_authorization.py
index 64f6464..78661d1 100644
--- a/tempest/tests/compute/test_authorization.py
+++ b/tempest/tests/compute/test_authorization.py
@@ -105,41 +105,37 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_server_for_alt_account_fails(self):
- """A GET request for a server on another user's account should fail"""
+ # A GET request for a server on another user's account should fail
self.alt_client.get_server(self.server['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_server_for_alt_account_fails(self):
- """A DELETE request for another user's server should fail"""
+ # A DELETE request for another user's server should fail
self.alt_client.delete_server(self.server['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_update_server_for_alt_account_fails(self):
- """An update server request for another user's server should fail"""
+ # An update server request for another user's server should fail
self.alt_client.update_server(self.server['id'], name='test')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_list_server_addresses_for_alt_account_fails(self):
- """A list addresses request for another user's server should fail"""
+ # A list addresses request for another user's server should fail
self.alt_client.list_addresses(self.server['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_list_server_addresses_by_network_for_alt_account_fails(self):
- """
- A list address/network request for another user's server should fail
- """
+ # A list address/network request for another user's server should fail
server_id = self.server['id']
self.alt_client.list_addresses_by_network(server_id, 'public')
def test_list_servers_with_alternate_tenant(self):
- """
- A list on servers from one tenant should not
- show on alternate tenant
- """
+ # A list on servers from one tenant should not
+ # show on alternate tenant
#Listing servers from alternate tenant
alt_server_ids = []
resp, body = self.alt_client.list_servers()
@@ -149,47 +145,45 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_change_password_for_alt_account_fails(self):
- """A change password request for another user's server should fail"""
+ # A change password request for another user's server should fail
self.alt_client.change_password(self.server['id'], 'newpass')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_reboot_server_for_alt_account_fails(self):
- """A reboot request for another user's server should fail"""
+ # A reboot request for another user's server should fail
self.alt_client.reboot(self.server['id'], 'HARD')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_rebuild_server_for_alt_account_fails(self):
- """A rebuild request for another user's server should fail"""
+ # A rebuild request for another user's server should fail
self.alt_client.rebuild(self.server['id'], self.image_ref_alt)
@raises(exceptions.NotFound)
@attr(type='negative')
def test_resize_server_for_alt_account_fails(self):
- """A resize request for another user's server should fail"""
+ # A resize request for another user's server should fail
self.alt_client.resize(self.server['id'], self.flavor_ref_alt)
@raises(exceptions.NotFound)
@attr(type='negative')
def test_create_image_for_alt_account_fails(self):
- """A create image request for another user's server should fail"""
+ # A create image request for another user's server should fail
self.alt_images_client.create_image(self.server['id'], 'testImage')
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_server_with_unauthorized_image(self):
- """Server creation with another user's image should fail"""
+ # Server creation with another user's image should fail
self.alt_client.create_server('test', self.image['id'],
self.flavor_ref)
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_server_fails_when_tenant_incorrect(self):
- """
- A create server request should fail if the tenant id does not match
- the current user
- """
+ # A create server request should fail if the tenant id does not match
+ # the current user
saved_base_url = self.alt_client.base_url
try:
# Change the base URL to impersonate another user
@@ -203,10 +197,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_keypair_in_analt_user_tenant(self):
- """
- A create keypair request should fail if the tenant id does not match
- the current user
- """
+ # A create keypair request should fail if the tenant id does not match
+ # the current user
#POST keypair with other user tenant
k_name = rand_name('keypair-')
self.alt_keypairs_client._set_auth()
@@ -228,35 +220,33 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_keypair_of_alt_account_fails(self):
- """A GET request for another user's keypair should fail"""
+ # A GET request for another user's keypair should fail
self.alt_keypairs_client.get_keypair(self.keypairname)
@raises(exceptions.NotFound)
@attr(type='negative')
@unittest.skip("Skipped until the Bug #1086980 is resolved")
def test_delete_keypair_of_alt_account_fails(self):
- """A DELETE request for another user's keypair should fail"""
+ # A DELETE request for another user's keypair should fail
self.alt_keypairs_client.delete_keypair(self.keypairname)
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_image_for_alt_account_fails(self):
- """A GET request for an image on another user's account should fail"""
+ # A GET request for an image on another user's account should fail
self.alt_images_client.get_image(self.image['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_image_for_alt_account_fails(self):
- """A DELETE request for another user's image should fail"""
+ # A DELETE request for another user's image should fail
self.alt_images_client.delete_image(self.image['id'])
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_security_group_in_analt_user_tenant(self):
- """
- A create security group request should fail if the tenant id does not
- match the current user
- """
+ # A create security group request should fail if the tenant id does not
+ # match the current user
#POST security group with other user tenant
s_name = rand_name('security-')
s_description = rand_name('security')
@@ -281,23 +271,21 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_security_group_of_alt_account_fails(self):
- """A GET request for another user's security group should fail"""
+ # A GET request for another user's security group should fail
self.alt_security_client.get_security_group(self.security_group['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_security_group_of_alt_account_fails(self):
- """A DELETE request for another user's security group should fail"""
+ # A DELETE request for another user's security group should fail
self.alt_security_client.delete_security_group(
self.security_group['id'])
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_security_group_rule_in_analt_user_tenant(self):
- """
- A create security group rule request should fail if the tenant id
- does not match the current user
- """
+ # A create security group rule request should fail if the tenant id
+ # does not match the current user
#POST security group rule with other user tenant
parent_group_id = self.security_group['id']
ip_protocol = 'icmp'
@@ -328,30 +316,28 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_security_group_rule_of_alt_account_fails(self):
- """
- A DELETE request for another user's security group rule
- should fail
- """
+ # A DELETE request for another user's security group rule
+ # should fail
self.alt_security_client.delete_security_group_rule(self.rule['id'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_set_metadata_of_alt_account_server_fails(self):
- """ A set metadata for another user's server should fail """
+ # A set metadata for another user's server should fail
req_metadata = {'meta1': 'data1', 'meta2': 'data2'}
self.alt_client.set_server_metadata(self.server['id'], req_metadata)
@raises(exceptions.NotFound)
@attr(type='negative')
def test_set_metadata_of_alt_account_image_fails(self):
- """ A set metadata for another user's image should fail """
+ # A set metadata for another user's image should fail
req_metadata = {'meta1': 'value1', 'meta2': 'value2'}
self.alt_images_client.set_image_metadata(self.image['id'],
req_metadata)
@attr(type='negative')
def test_get_metadata_of_alt_account_server_fails(self):
- """ A get metadata for another user's server should fail """
+ # A get metadata for another user's server should fail
req_metadata = {'meta1': 'data1'}
self.client.set_server_metadata(self.server['id'], req_metadata)
try:
@@ -366,7 +352,7 @@
@attr(type='negative')
def test_get_metadata_of_alt_account_image_fails(self):
- """ A get metadata for another user's image should fail """
+ # A get metadata for another user's image should fail
req_metadata = {'meta1': 'value1'}
self.images_client.set_image_metadata(self.image['id'],
req_metadata)
@@ -382,7 +368,7 @@
@attr(type='negative')
def test_delete_metadata_of_alt_account_server_fails(self):
- """ A delete metadata for another user's server should fail """
+ # A delete metadata for another user's server should fail
req_metadata = {'meta1': 'data1'}
self.client.set_server_metadata(self.server['id'], req_metadata)
try:
@@ -397,7 +383,7 @@
@attr(type='negative')
def test_delete_metadata_of_alt_account_image_fails(self):
- """ A delete metadata for another user's image should fail """
+ # A delete metadata for another user's image should fail
req_metadata = {'meta1': 'data1'}
self.images_client.set_image_metadata(self.image['id'],
req_metadata)
@@ -415,8 +401,6 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_console_output_of_alt_account_server_fails(self):
- """
- A Get Console Output for another user's server should fail
- """
+ # A Get Console Output for another user's server should fail
self.alt_console_outputs_client.get_console_output(self.server['id'],
10)
diff --git a/tempest/tests/compute/test_extensions.py b/tempest/tests/compute/test_extensions.py
index 552c58c..829e295 100644
--- a/tempest/tests/compute/test_extensions.py
+++ b/tempest/tests/compute/test_extensions.py
@@ -24,7 +24,7 @@
@attr(type='positive')
def test_list_extensions(self):
- """List of all extensions"""
+ # List of all extensions
resp, extensions = self.client.list_extensions()
self.assertTrue("extensions" in extensions)
self.assertEqual(200, resp.status)
diff --git a/tempest/tests/compute/test_live_block_migration.py b/tempest/tests/compute/test_live_block_migration.py
index 48d374f..915868c 100644
--- a/tempest/tests/compute/test_live_block_migration.py
+++ b/tempest/tests/compute/test_live_block_migration.py
@@ -104,7 +104,7 @@
@unittest.skipIf(not live_migration_available,
'Block Live migration not available')
def test_001_live_block_migration(self):
- """Live block migrate an instance to another host"""
+ # Live block migrate an instance to another host
if len(self._get_compute_hostnames()) < 2:
raise nose.SkipTest(
"Less than 2 compute nodes, skipping migration test.")
@@ -120,7 +120,7 @@
@unittest.skipIf(not live_migration_available,
'Block Live migration not available')
def test_002_invalid_host_for_migration(self):
- """Migrating to an invalid host should not change the status"""
+ # Migrating to an invalid host should not change the status
server_id = self._get_an_active_server()
target_host = self._get_non_existing_host_name()
diff --git a/tempest/tests/compute/test_quotas.py b/tempest/tests/compute/test_quotas.py
index bf7d648..3dc2515 100644
--- a/tempest/tests/compute/test_quotas.py
+++ b/tempest/tests/compute/test_quotas.py
@@ -33,7 +33,7 @@
@attr(type='smoke')
def test_get_default_quotas(self):
- """User can get the default quota set for it's tenant"""
+ # User can get the default quota set for it's tenant
expected_quota_set = {'injected_file_content_bytes': 10240,
'metadata_items': 128, 'injected_files': 5,
'ram': 51200, 'floating_ips': 10,
diff --git a/tempest/tests/compute/volumes/test_attach_volume.py b/tempest/tests/compute/volumes/test_attach_volume.py
index 09b146b..9581026 100644
--- a/tempest/tests/compute/volumes/test_attach_volume.py
+++ b/tempest/tests/compute/volumes/test_attach_volume.py
@@ -70,10 +70,8 @@
@attr(type='positive')
@unittest.skipIf(not run_ssh, 'SSH required for this test')
def test_attach_detach_volume(self):
- """
- Stop and Start a server with an attached volume, ensuring that
- the volume remains attached.
- """
+ # Stop and Start a server with an attached volume, ensuring that
+ # the volume remains attached.
server, volume = self._create_and_attach()
attached = True
diff --git a/tempest/tests/compute/volumes/test_volumes_get.py b/tempest/tests/compute/volumes/test_volumes_get.py
index 0a207b9..afb00cd 100644
--- a/tempest/tests/compute/volumes/test_volumes_get.py
+++ b/tempest/tests/compute/volumes/test_volumes_get.py
@@ -25,7 +25,7 @@
@attr(type='smoke')
def test_volume_create_get_delete(self):
- """CREATE, GET, DELETE Volume"""
+ # CREATE, GET, DELETE Volume
volume = None
try:
v_name = rand_name('Volume-%s-') % self._interface
@@ -71,7 +71,7 @@
@attr(type='positive')
def test_volume_get_metadata_none(self):
- """CREATE, GET empty metadata dict"""
+ # CREATE, GET empty metadata dict
try:
v_name = rand_name('Volume-')
#Create volume
diff --git a/tempest/tests/compute/volumes/test_volumes_list.py b/tempest/tests/compute/volumes/test_volumes_list.py
index 5162a85..fef9c8d 100644
--- a/tempest/tests/compute/volumes/test_volumes_list.py
+++ b/tempest/tests/compute/volumes/test_volumes_list.py
@@ -32,7 +32,7 @@
"""
def test_volume_list(self):
- """Should return the list of Volumes"""
+ # Should return the list of Volumes
# Fetch all Volumes
resp, fetched_list = self.client.list_volumes()
self.assertEqual(200, resp.status)
@@ -47,7 +47,7 @@
for m_vol in missing_volumes))
def test_volume_list_with_details(self):
- """Should return the list of Volumes with details"""
+ # Should return the list of Volumes with details
#Fetch all Volumes
resp, fetched_list = self.client.list_volumes_with_detail()
self.assertEqual(200, resp.status)
diff --git a/tempest/tests/compute/volumes/test_volumes_negative.py b/tempest/tests/compute/volumes/test_volumes_negative.py
index 6994ab1..d2ad30e 100644
--- a/tempest/tests/compute/volumes/test_volumes_negative.py
+++ b/tempest/tests/compute/volumes/test_volumes_negative.py
@@ -27,7 +27,7 @@
@attr(type='negative')
def test_volume_get_nonexistant_volume_id(self):
- """Negative: Should not be able to get details of nonexistant volume"""
+ # Negative: Should not be able to get details of nonexistant volume
#Creating a nonexistant volume id
volume_id_list = list()
resp, body = self.client.list_volumes()
@@ -48,7 +48,7 @@
@attr(type='negative')
def test_volume_delete_nonexistant_volume_id(self):
- """Negative: Should not be able to delete nonexistant Volume"""
+ # Negative: Should not be able to delete nonexistant Volume
#Creating nonexistant volume id
volume_id_list = list()
resp, body = self.client.list_volumes()
@@ -69,10 +69,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_invalid_size(self):
- """
- Negative: Should not be able to create volume with invalid size
- in request
- """
+ # Negative: Should not be able to create volume with invalid size
+ # in request
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='#$%',
@@ -82,10 +80,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_out_passing_size(self):
- """
- Negative: Should not be able to create volume without passing size
- in request
- """
+ # Negative: Should not be able to create volume without passing size
+ # in request
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='',
@@ -95,9 +91,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_size_zero(self):
- """
- Negative: Should not be able to create volume with size zero
- """
+ # Negative: Should not be able to create volume with size zero
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='0',
@@ -107,33 +101,26 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_invalid_volume_id(self):
- """
- Negative: Should not be able to get volume with invalid id
- """
+ # Negative: Should not be able to get volume with invalid id
resp, volume = self.client.get_volume('#$%%&^&^')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_volume_without_passing_volume_id(self):
- """
- Negative: Should not be able to get volume when empty ID is passed
- """
+ # Negative: Should not be able to get volume when empty ID is passed
resp, volume = self.client.get_volume('')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_invalid_volume_id(self):
- """
- Negative: Should not be able to delete volume when invalid ID is passed
- """
+ # Negative: Should not be able to delete volume when invalid ID is
+ # passed
resp, volume = self.client.delete_volume('!@#$%^&*()')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_volume_without_passing_volume_id(self):
- """
- Negative: Should not be able to delete volume when empty ID is passed
- """
+ # Negative: Should not be able to delete volume when empty ID is passed
resp, volume = self.client.delete_volume('')
diff --git a/tempest/tests/identity/admin/test_roles.py b/tempest/tests/identity/admin/test_roles.py
index 0e1da7d..f0dd8d9 100644
--- a/tempest/tests/identity/admin/test_roles.py
+++ b/tempest/tests/identity/admin/test_roles.py
@@ -40,26 +40,26 @@
return (user, tenant, role)
def test_list_roles(self):
- """Return a list of all roles"""
+ # Return a list of all roles
resp, body = self.client.list_roles()
found = [role for role in body if role in self.data.roles]
self.assertTrue(any(found))
self.assertEqual(len(found), len(self.data.roles))
def test_list_roles_by_unauthorized_user(self):
- """Non admin user should not be able to list roles"""
+ # Non admin user should not be able to list roles
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.list_roles)
def test_list_roles_request_without_token(self):
- """Request to list roles without a valid token should fail"""
+ # Request to list roles without a valid token should fail
token = self.client.get_auth()
self.client.delete_token(token)
self.assertRaises(exceptions.Unauthorized, self.client.list_roles)
self.client.clear_auth()
def test_role_create_delete(self):
- """Role should be created, verified, and deleted"""
+ # Role should be created, verified, and deleted
role_name = rand_name('role-test-')
resp, body = self.client.create_role(role_name)
self.assertTrue('status' in resp)
@@ -79,11 +79,11 @@
self.assertFalse(any(found))
def test_role_create_blank_name(self):
- """Should not be able to create a role with a blank name"""
+ # Should not be able to create a role with a blank name
self.assertRaises(exceptions.BadRequest, self.client.create_role, '')
def test_role_create_duplicate(self):
- """Role names should be unique"""
+ # Role names should be unique
role_name = rand_name('role-dup-')
resp, body = self.client.create_role(role_name)
role1_id = body.get('id')
@@ -121,7 +121,7 @@
class UserRolesTestBase(RolesTestBase):
def test_assign_user_role(self):
- """Assign a role to a user on a tenant"""
+ # Assign a role to a user on a tenant
(user, tenant, role) = self._get_role_params()
self.client.assign_user_role(tenant['id'], user['id'], role['id'])
resp, roles = self.client.list_user_roles(tenant['id'], user['id'])
@@ -129,14 +129,14 @@
self.assertEquals(roles[0]['id'], role['id'])
def test_assign_user_role_by_unauthorized_user(self):
- """Non admin user should not be authorized to assign a role to user"""
+ # Non admin user should not be authorized to assign a role to user
(user, tenant, role) = self._get_role_params()
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.assign_user_role,
tenant['id'], user['id'], role['id'])
def test_assign_user_role_request_without_token(self):
- """Request to assign a role to a user without a valid token"""
+ # Request to assign a role to a user without a valid token
(user, tenant, role) = self._get_role_params()
token = self.client.get_auth()
self.client.delete_token(token)
@@ -146,32 +146,32 @@
self.client.clear_auth()
def test_assign_user_role_for_non_existent_user(self):
- """Attempt to assign a role to a non existent user should fail"""
+ # Attempt to assign a role to a non existent user should fail
(user, tenant, role) = self._get_role_params()
self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
tenant['id'], 'junk-user-id-999', role['id'])
def test_assign_user_role_for_non_existent_role(self):
- """Attempt to assign a non existent role to user should fail"""
+ # Attempt to assign a non existent role to user should fail
(user, tenant, role) = self._get_role_params()
self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
tenant['id'], user['id'], 'junk-role-id-12345')
def test_assign_user_role_for_non_existent_tenant(self):
- """Attempt to assign a role on a non existent tenant should fail"""
+ # Attempt to assign a role on a non existent tenant should fail
(user, tenant, role) = self._get_role_params()
self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
'junk-tenant-1234', user['id'], role['id'])
def test_assign_duplicate_user_role(self):
- """Duplicate user role should not get assigned"""
+ # Duplicate user role should not get assigned
(user, tenant, role) = self._get_role_params()
self.client.assign_user_role(tenant['id'], user['id'], role['id'])
self.assertRaises(exceptions.Duplicate, self.client.assign_user_role,
tenant['id'], user['id'], role['id'])
def test_remove_user_role(self):
- """Remove a role assigned to a user on a tenant"""
+ # Remove a role assigned to a user on a tenant
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'], role['id'])
@@ -180,7 +180,7 @@
self.assertEquals(resp['status'], '204')
def test_remove_user_role_by_unauthorized_user(self):
- """Non admin user should not be authorized to remove a user's role"""
+ # Non admin user should not be authorized to remove a user's role
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'],
@@ -190,7 +190,7 @@
tenant['id'], user['id'], role['id'])
def test_remove_user_role_request_without_token(self):
- """Request to remove a user's role without a valid token"""
+ # Request to remove a user's role without a valid token
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'],
@@ -203,7 +203,7 @@
self.client.clear_auth()
def test_remove_user_role_non_existant_user(self):
- """Attempt to remove a role from a non existent user should fail"""
+ # Attempt to remove a role from a non existent user should fail
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'],
@@ -212,7 +212,7 @@
tenant['id'], 'junk-user-id-123', role['id'])
def test_remove_user_role_non_existant_role(self):
- """Attempt to delete a non existent role from a user should fail"""
+ # Attempt to delete a non existent role from a user should fail
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'],
@@ -221,7 +221,7 @@
tenant['id'], user['id'], 'junk-user-role-123')
def test_remove_user_role_non_existant_tenant(self):
- """Attempt to remove a role from a non existent tenant should fail"""
+ # Attempt to remove a role from a non existent tenant should fail
(user, tenant, role) = self._get_role_params()
resp, user_role = self.client.assign_user_role(tenant['id'],
user['id'],
@@ -230,7 +230,7 @@
'junk-tenant-id-123', user['id'], role['id'])
def test_list_user_roles(self):
- """List roles assigned to a user on tenant"""
+ # List roles assigned to a user on tenant
(user, tenant, role) = self._get_role_params()
self.client.assign_user_role(tenant['id'], user['id'], role['id'])
resp, roles = self.client.list_user_roles(tenant['id'], user['id'])
@@ -238,7 +238,7 @@
self.assertEquals(role['id'], roles[0]['id'])
def test_list_user_roles_by_unauthorized_user(self):
- """Non admin user should not be authorized to list a user's roles"""
+ # Non admin user should not be authorized to list a user's roles
(user, tenant, role) = self._get_role_params()
self.client.assign_user_role(tenant['id'], user['id'], role['id'])
self.assertRaises(exceptions.Unauthorized,
@@ -246,7 +246,7 @@
user['id'])
def test_list_user_roles_request_without_token(self):
- """Request to list user's roles without a valid token should fail"""
+ # Request to list user's roles without a valid token should fail
(user, tenant, role) = self._get_role_params()
token = self.client.get_auth()
self.client.delete_token(token)
@@ -258,7 +258,7 @@
self.client.clear_auth()
def test_list_user_roles_for_non_existent_user(self):
- """Attempt to list roles of a non existent user should fail"""
+ # Attempt to list roles of a non existent user should fail
(user, tenant, role) = self._get_role_params()
self.assertRaises(exceptions.NotFound, self.client.list_user_roles,
tenant['id'], 'junk-role-aabbcc11')
diff --git a/tempest/tests/identity/admin/test_services.py b/tempest/tests/identity/admin/test_services.py
index 6baa7c2..30dfeb0 100644
--- a/tempest/tests/identity/admin/test_services.py
+++ b/tempest/tests/identity/admin/test_services.py
@@ -25,7 +25,7 @@
class ServicesTestBase(object):
def test_create_get_delete_service(self):
- """GET Service"""
+ # GET Service
try:
#Creating a Service
name = rand_name('service-')
diff --git a/tempest/tests/identity/admin/test_tenants.py b/tempest/tests/identity/admin/test_tenants.py
index 226aae6..8fba7e3 100644
--- a/tempest/tests/identity/admin/test_tenants.py
+++ b/tempest/tests/identity/admin/test_tenants.py
@@ -31,7 +31,7 @@
cls.data.tenants.append(tenant)
def test_list_tenants(self):
- """Return a list of all tenants"""
+ # Return a list of all tenants
resp, body = self.client.list_tenants()
found = [tenant for tenant in body if tenant in self.data.tenants]
self.assertTrue(any(found), 'List did not return newly created '
@@ -40,19 +40,19 @@
self.assertTrue(resp['status'].startswith('2'))
def test_list_tenants_by_unauthorized_user(self):
- """Non-admin user should not be able to list tenants"""
+ # Non-admin user should not be able to list tenants
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.list_tenants)
def test_list_tenant_request_without_token(self):
- """Request to list tenants without a valid token should fail"""
+ # Request to list tenants without a valid token should fail
token = self.client.get_auth()
self.client.delete_token(token)
self.assertRaises(exceptions.Unauthorized, self.client.list_tenants)
self.client.clear_auth()
def test_tenant_delete(self):
- """Create several tenants and delete them"""
+ # Create several tenants and delete them
tenants = []
for _ in xrange(5):
resp, body = self.client.create_tenant(rand_name('tenant-new'))
@@ -70,14 +70,14 @@
self.assertFalse(any(found_2), 'Tenants failed to delete')
def test_tenant_delete_by_unauthorized_user(self):
- """Non-admin user should not be able to delete a tenant"""
+ # Non-admin user should not be able to delete a tenant
tenant_name = rand_name('tenant-')
resp, tenant = self.client.create_tenant(tenant_name)
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.delete_tenant, tenant['id'])
def test_tenant_delete_request_without_token(self):
- """Request to delete a tenant without a valid token should fail"""
+ # Request to delete a tenant without a valid token should fail
tenant_name = rand_name('tenant-')
resp, tenant = self.client.create_tenant(tenant_name)
token = self.client.get_auth()
@@ -87,12 +87,12 @@
self.client.clear_auth()
def test_delete_non_existent_tenant(self):
- """Attempt to delete a non existent tenant should fail"""
+ # Attempt to delete a non existent tenant should fail
self.assertRaises(exceptions.NotFound, self.client.delete_tenant,
'junk_tenant_123456abc')
def test_tenant_create_with_description(self):
- """Create tenant with a description"""
+ # Create tenant with a description
tenant_name = rand_name('tenant-')
tenant_desc = rand_name('desc-')
resp, body = self.client.create_tenant(tenant_name,
@@ -110,7 +110,7 @@
self.client.delete_tenant(tenant_id)
def test_tenant_create_enabled(self):
- """Create a tenant that is enabled"""
+ # Create a tenant that is enabled
tenant_name = rand_name('tenant-')
resp, body = self.client.create_tenant(tenant_name, enabled=True)
tenant_id = body['id']
@@ -124,7 +124,7 @@
self.client.delete_tenant(tenant_id)
def test_tenant_create_not_enabled(self):
- """Create a tenant that is not enabled"""
+ # Create a tenant that is not enabled
tenant_name = rand_name('tenant-')
resp, body = self.client.create_tenant(tenant_name, enabled=False)
tenant_id = body['id']
@@ -140,7 +140,7 @@
self.client.delete_tenant(tenant_id)
def test_tenant_create_duplicate(self):
- """Tenant names should be unique"""
+ # Tenant names should be unique
tenant_name = rand_name('tenant-dup-')
resp, body = self.client.create_tenant(tenant_name)
tenant1_id = body.get('id')
@@ -155,13 +155,13 @@
self.client.delete_tenant(tenant1_id)
def test_create_tenant_by_unauthorized_user(self):
- """Non-admin user should not be authorized to create a tenant"""
+ # Non-admin user should not be authorized to create a tenant
tenant_name = rand_name('tenant-')
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.create_tenant, tenant_name)
def test_create_tenant_request_without_token(self):
- """Create tenant request without a token should not be authorized"""
+ # Create tenant request without a token should not be authorized
tenant_name = rand_name('tenant-')
token = self.client.get_auth()
self.client.delete_token(token)
@@ -170,18 +170,18 @@
self.client.clear_auth()
def test_create_tenant_with_empty_name(self):
- """Tenant name should not be empty"""
+ # Tenant name should not be empty
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
name='')
def test_create_tenants_name_length_over_64(self):
- """Tenant name length should not be greater than 64 characters"""
+ # Tenant name length should not be greater than 64 characters
tenant_name = 'a' * 65
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
tenant_name)
def test_tenant_update_name(self):
- """Update name attribute of a tenant"""
+ # Update name attribute of a tenant
t_name1 = rand_name('tenant-')
resp, body = self.client.create_tenant(t_name1)
t_id = body['id']
@@ -204,7 +204,7 @@
self.client.delete_tenant(t_id)
def test_tenant_update_desc(self):
- """Update description attribute of a tenant"""
+ # Update description attribute of a tenant
t_name = rand_name('tenant-')
t_desc = rand_name('desc-')
resp, body = self.client.create_tenant(t_name, description=t_desc)
@@ -228,7 +228,7 @@
self.client.delete_tenant(t_id)
def test_tenant_update_enable(self):
- """Update the enabled attribute of a tenant"""
+ # Update the enabled attribute of a tenant
t_name = rand_name('tenant-')
t_en = False
resp, body = self.client.create_tenant(t_name, enabled=t_en)
diff --git a/tempest/tests/identity/admin/test_users.py b/tempest/tests/identity/admin/test_users.py
index e2938bd..27a214c 100644
--- a/tempest/tests/identity/admin/test_users.py
+++ b/tempest/tests/identity/admin/test_users.py
@@ -33,7 +33,7 @@
@attr(type='smoke')
def test_create_user(self):
- """Create a user"""
+ # Create a user
self.data.setup_test_tenant()
resp, user = self.client.create_user(self.alt_user, self.alt_password,
self.data.tenant['id'],
@@ -44,7 +44,7 @@
@attr(type='negative')
def test_create_user_by_unauthorized_user(self):
- """Non-admin should not be authorized to create a user"""
+ # Non-admin should not be authorized to create a user
self.data.setup_test_tenant()
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.create_user, self.alt_user,
@@ -53,7 +53,7 @@
@attr(type='negative')
def test_create_user_with_empty_name(self):
- """User with an empty name should not be created"""
+ # User with an empty name should not be created
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user, '',
self.alt_password, self.data.tenant['id'],
@@ -62,7 +62,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 966251 is fixed")
def test_create_user_with_name_length_over_64(self):
- """Length of user name filed should be restricted to 64 characters"""
+ # Length of user name filed should be restricted to 64 characters
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user,
'a' * 65, self.alt_password,
@@ -70,7 +70,7 @@
@attr(type='negative')
def test_create_user_with_duplicate_name(self):
- """Duplicate user should not be created"""
+ # Duplicate user should not be created
self.data.setup_test_user()
self.assertRaises(exceptions.Duplicate, self.client.create_user,
self.data.test_user, self.data.test_password,
@@ -79,7 +79,7 @@
@attr(type='negative')
@unittest.skip("Until Bug 999084 is fixed")
def test_create_user_with_empty_password(self):
- """User with an empty password should not be created"""
+ # User with an empty password should not be created
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user,
self.alt_user, '', self.data.tenant['id'],
@@ -88,7 +88,7 @@
@attr(type='nagative')
@unittest.skip("Until Bug 999084 is fixed")
def test_create_user_with_long_password(self):
- """User having password exceeding max length should not be created"""
+ # User having password exceeding max length should not be created
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user,
self.alt_user, 'a' * 65, self.data.tenant['id'],
@@ -97,21 +97,21 @@
@attr(type='negative')
@unittest.skip("Until Bug 999084 is fixed")
def test_create_user_with_invalid_email_format(self):
- """Email format should be validated while creating a user"""
+ # Email format should be validated while creating a user
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user,
self.alt_user, '', self.data.tenant['id'], '12345')
@attr(type='negative')
def test_create_user_for_non_existant_tenant(self):
- """Attempt to create a user in a non-existent tenant should fail"""
+ # Attempt to create a user in a non-existent tenant should fail
self.assertRaises(exceptions.NotFound, self.client.create_user,
self.alt_user, self.alt_password, '49ffgg99999',
self.alt_email)
@attr(type='negative')
def test_create_user_request_without_a_token(self):
- """Request to create a user without a valid token should fail"""
+ # Request to create a user without a valid token should fail
self.data.setup_test_tenant()
# Get the token of the current client
token = self.client.get_auth()
@@ -126,7 +126,7 @@
@attr(type='smoke')
def test_delete_user(self):
- """Delete a user"""
+ # Delete a user
self.data.setup_test_tenant()
resp, user = self.client.create_user('user_1234', self.alt_password,
self.data.tenant['id'],
@@ -136,7 +136,7 @@
@attr(type='negative')
def test_delete_users_by_unauthorized_user(self):
- """Non admin user should not be authorized to delete a user"""
+ # Non admin user should not be authorized to delete a user
self.data.setup_test_user()
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.delete_user,
@@ -144,13 +144,13 @@
@attr(type='negative')
def test_delete_non_existant_user(self):
- """Attempt to delete a non-existent user should fail"""
+ # Attempt to delete a non-existent user should fail
self.assertRaises(exceptions.NotFound, self.client.delete_user,
'junk12345123')
@attr(type='smoke')
def test_user_authentication(self):
- """Valid user's token is authenticated"""
+ # Valid user's token is authenticated
self.data.setup_test_user()
# Get a token
self.token_client.auth(self.data.test_user, self.data.test_password,
@@ -163,7 +163,7 @@
@attr(type='negative')
def test_authentication_for_disabled_user(self):
- """Disabled user's token should not get authenticated"""
+ # Disabled user's token should not get authenticated
self.data.setup_test_user()
self.disable_user(self.data.test_user)
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
@@ -174,7 +174,7 @@
@attr(type='negative')
@unittest.skip('Until Bug 988920 is fixed')
def test_authentication_when_tenant_is_disabled(self):
- """User's token for a disabled tenant should not be authenticated"""
+ # User's token for a disabled tenant should not be authenticated
self.data.setup_test_user()
self.disable_tenant(self.data.test_tenant)
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
@@ -185,7 +185,7 @@
@attr(type='negative')
@unittest.skip('Until Bug 988920 is fixed')
def test_authentication_with_invalid_tenant(self):
- """User's token for an invalid tenant should not be authenticated"""
+ # User's token for an invalid tenant should not be authenticated
self.data.setup_one_user()
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
self.data.test_user,
@@ -194,14 +194,14 @@
@attr(type='negative')
def test_authentication_with_invalid_username(self):
- """Non-existent user's token should not get authenticated"""
+ # Non-existent user's token should not get authenticated
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
'junkuser123', self.data.test_password,
self.data.test_tenant)
@attr(type='negative')
def test_authentication_with_invalid_password(self):
- """User's token with invalid password should not be authenticated"""
+ # User's token with invalid password should not be authenticated
self.data.setup_test_user()
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
self.data.test_user, 'junkpass1234',
@@ -209,7 +209,7 @@
@attr(type='positive')
def test_authentication_request_without_token(self):
- """Request for token authentication with a valid token in header"""
+ # Request for token authentication with a valid token in header
self.data.setup_test_user()
self.token_client.auth(self.data.test_user, self.data.test_password,
self.data.test_tenant)
@@ -226,7 +226,7 @@
@attr(type='smoke')
def test_get_users(self):
- """Get a list of users and find the test user"""
+ # Get a list of users and find the test user
self.data.setup_test_user()
resp, users = self.client.get_users()
self.assertIn(self.data.test_user, [u['name'] for u in users],
@@ -234,14 +234,14 @@
@attr(type='negative')
def test_get_users_by_unauthorized_user(self):
- """Non admin user should not be authorized to get user list"""
+ # Non admin user should not be authorized to get user list
self.data.setup_test_user()
self.assertRaises(exceptions.Unauthorized,
self.non_admin_client.get_users)
@attr(type='negative')
def test_get_users_request_without_token(self):
- """Request to get list of users without a valid token should fail"""
+ # Request to get list of users without a valid token should fail
token = self.client.get_auth()
self.client.delete_token(token)
self.assertRaises(exceptions.Unauthorized, self.client.get_users)
@@ -249,7 +249,7 @@
@attr(type='positive')
def test_list_users_for_tenant(self):
- """Return a list of all users for a tenant"""
+ # Return a list of all users for a tenant
self.data.setup_test_tenant()
user_ids = list()
fetched_user_ids = list()
@@ -277,7 +277,7 @@
@attr(type='positive')
def test_list_users_with_roles_for_tenant(self):
- """Return list of users on tenant when roles are assigned to users"""
+ # Return list of users on tenant when roles are assigned to users
self.data.setup_test_user()
self.data.setup_test_role()
user = self.get_user_by_name(self.data.test_user)
@@ -309,10 +309,8 @@
@attr(type='negative')
def test_list_users_with_invalid_tenant(self):
- """
- Should not be able to return a list of all
- users for a nonexistant tenant
- """
+ # Should not be able to return a list of all
+ # users for a nonexistant tenant
#Assign invalid tenant ids
invalid_id = list()
invalid_id.append(rand_name('999'))
diff --git a/tempest/tests/image/test_images.py b/tempest/tests/image/test_images.py
index a3c9390..2429a32 100644
--- a/tempest/tests/image/test_images.py
+++ b/tempest/tests/image/test_images.py
@@ -54,7 +54,7 @@
@attr(type='image')
def test_register_with_invalid_data(self):
- """Negative tests for invalid data supplied to POST /images"""
+ # Negative tests for invalid data supplied to POST /images
metas = [
{
@@ -76,7 +76,7 @@
@attr(type='image')
def test_register_then_upload(self):
- """Register, then upload an image"""
+ # Register, then upload an image
meta = {
'name': 'New Name',
'is_public': True,
@@ -108,7 +108,7 @@
@attr(type='image')
def test_register_remote_image(self):
- """Register a new remote image"""
+ # Register a new remote image
meta = {
'name': 'New Remote Image',
'is_public': True,
@@ -194,8 +194,6 @@
@attr(type='image')
def test_index_no_params(self):
- """
- Simple test to see all fixture images returned
- """
+ # Simple test to see all fixture images returned
current_images = set(i.id for i in self.client.images.list())
self.assertTrue(set(self.created_images) <= current_images)
diff --git a/tempest/tests/network/test_networks.py b/tempest/tests/network/test_networks.py
index 5476551..d7f09c4 100644
--- a/tempest/tests/network/test_networks.py
+++ b/tempest/tests/network/test_networks.py
@@ -31,7 +31,7 @@
@attr(type='positive')
def test_create_delete_network(self):
- """Creates and deletes a network for a tenant"""
+ # Creates and deletes a network for a tenant
name = rand_name('network')
resp, body = self.client.create_network(name)
self.assertEqual('202', resp['status'])
@@ -42,7 +42,7 @@
@attr(type='positive')
def test_show_network(self):
- """Verifies the details of a network"""
+ # Verifies the details of a network
resp, body = self.client.get_network(self.network['id'])
self.assertEqual('200', resp['status'])
network = body['network']
@@ -51,7 +51,7 @@
@attr(type='positive')
def test_show_network_details(self):
- """Verifies the full details of a network"""
+ # Verifies the full details of a network
resp, body = self.client.get_network_details(self.network['id'])
self.assertEqual('200', resp['status'])
network = body['network']
@@ -61,7 +61,7 @@
@attr(type='positive')
def test_list_networks(self):
- """Verify the network exists in the list of all networks"""
+ # Verify the network exists in the list of all networks
resp, body = self.client.list_networks()
networks = body['networks']
found = any(n for n in networks if n['id'] == self.network['id'])
@@ -69,7 +69,7 @@
@attr(type='positive')
def test_list_networks_with_detail(self):
- """Verify the network exists in the detailed list of all networks"""
+ # Verify the network exists in the detailed list of all networks
resp, body = self.client.list_networks_details()
networks = body['networks']
found = any(n for n in networks if n['id'] == self.network['id'])
diff --git a/tempest/tests/object_storage/test_account_services.py b/tempest/tests/object_storage/test_account_services.py
index db3aa69..cae2da1 100644
--- a/tempest/tests/object_storage/test_account_services.py
+++ b/tempest/tests/object_storage/test_account_services.py
@@ -36,7 +36,7 @@
@attr(type='smoke')
def test_list_containers(self):
- """List of all containers should not be empty"""
+ # List of all containers should not be empty
params = {'format': 'json'}
resp, container_list = \
@@ -48,7 +48,7 @@
@attr(type='smoke')
def test_list_account_metadata(self):
- """List all account metadata"""
+ # List all account metadata
resp, metadata = self.account_client.list_account_metadata()
self.assertEqual(resp['status'], '204')
@@ -58,7 +58,7 @@
@attr(type='smoke')
def test_create_account_metadata(self):
- """Add metadata to account"""
+ # Add metadata to account
metadata = {'test-account-meta': 'Meta!'}
resp, _ = \
@@ -71,7 +71,7 @@
@attr(type='smoke')
def test_delete_account_metadata(self):
- """Delete metadata from account"""
+ # Delete metadata from account
metadata = ['test-account-meta']
resp, _ = \
diff --git a/tempest/tests/object_storage/test_container_services.py b/tempest/tests/object_storage/test_container_services.py
index b99859e..fe09341 100644
--- a/tempest/tests/object_storage/test_container_services.py
+++ b/tempest/tests/object_storage/test_container_services.py
@@ -46,7 +46,7 @@
@attr(type='smoke')
def test_create_container(self):
- """Create a container, test responses"""
+ # Create a container, test responses
#Create a container
container_name = rand_name(name='TestContainer')
@@ -57,7 +57,7 @@
@attr(type='smoke')
def test_delete_container(self):
- """Create and Delete a container, test responses"""
+ # Create and Delete a container, test responses
#Create a container
container_name = rand_name(name='TestContainer')
@@ -71,7 +71,7 @@
@attr(type='smoke')
def test_list_container_contents_json(self):
- """Add metadata to object"""
+ # Add metadata to object
#Create a container
container_name = rand_name(name='TestContainer')
@@ -107,7 +107,7 @@
@attr(type='smoke')
def test_container_metadata(self):
- """Update/Retrieve/Delete Container Metadata"""
+ # Update/Retrieve/Delete Container Metadata
# Create a container
container_name = rand_name(name='TestContainer')
diff --git a/tempest/tests/object_storage/test_object_expiry.py b/tempest/tests/object_storage/test_object_expiry.py
index 8437d55..099fc16 100644
--- a/tempest/tests/object_storage/test_object_expiry.py
+++ b/tempest/tests/object_storage/test_object_expiry.py
@@ -57,7 +57,7 @@
@unittest.skip('Until bug 1069849 is resolved.')
@attr(type='regression')
def test_get_object_after_expiry_time(self):
- """GET object after expiry time"""
+ # GET object after expiry time
#TODO(harika-vakadi): Similar test case has to be created for
# "X-Delete-At", after this test case works.
diff --git a/tempest/tests/object_storage/test_object_services.py b/tempest/tests/object_storage/test_object_services.py
index 43af072..8b87ad6 100644
--- a/tempest/tests/object_storage/test_object_services.py
+++ b/tempest/tests/object_storage/test_object_services.py
@@ -49,7 +49,7 @@
@attr(type='smoke')
def test_create_object(self):
- """Create storage object, test response"""
+ # Create storage object, test response
#Create Object
object_name = rand_name(name='TestObject')
@@ -66,7 +66,7 @@
@attr(type='smoke')
def test_delete_object(self):
- """Create and delete a storage object, test responses"""
+ # Create and delete a storage object, test responses
#Create Object
object_name = rand_name(name='TestObject')
@@ -80,7 +80,7 @@
@attr(type='smoke')
def test_object_metadata(self):
- """Add metadata to storage object, test if metadata is retrievable"""
+ # Add metadata to storage object, test if metadata is retrievable
#Create Object
object_name = rand_name(name='TestObject')
@@ -110,7 +110,7 @@
@attr(type='smoke')
def test_get_object(self):
- """Retrieve object's data(in response body)"""
+ # Retrieve object's data(in response body)
#Create Object
object_name = rand_name(name='TestObject')
@@ -126,7 +126,7 @@
@attr(type='smoke')
def test_copy_object_in_same_container(self):
- """Copy storage object"""
+ # Copy storage object
# Create source Object
src_object_name = rand_name(name='SrcObject')
@@ -154,7 +154,7 @@
@attr(type='smoke')
def test_copy_object_to_itself(self):
- """Change the content type of an existing object"""
+ # Change the content type of an existing object
# Create Object
object_name = rand_name(name='TestObject')
@@ -179,7 +179,7 @@
@attr(type='smoke')
def test_copy_object_2d_way(self):
- """Copy storage object"""
+ # Copy storage object
# Create source Object
src_object_name = rand_name(name='SrcObject')
@@ -208,7 +208,7 @@
@attr(type='smoke')
def test_copy_object_across_containers(self):
- """Copy storage object across containers"""
+ # Copy storage object across containers
#Create a container so as to use as source container
src_container_name = rand_name(name='TestSourceContainer')
@@ -267,8 +267,8 @@
@attr(type='smoke')
def test_access_public_container_object_without_using_creds(self):
- """Make container public-readable, and access the object
- anonymously, e.g. without using credentials"""
+ # Make container public-readable, and access the object
+ # anonymously, e.g. without using credentials
try:
resp_meta = None
@@ -318,8 +318,8 @@
@attr(type='negative')
def test_access_object_without_using_creds(self):
- """Attempt to access the object anonymously, e.g.
- not using any credentials"""
+ # Attempt to access the object anonymously, e.g.
+ # not using any credentials
# Create Object
object_name = rand_name(name='Object')
@@ -336,8 +336,8 @@
@attr(type='negative')
def test_write_object_without_using_creds(self):
- """Attempt to write to the object anonymously, e.g.
- not using any credentials"""
+ # Attempt to write to the object anonymously, e.g.
+ # not using any credentials
# Trying to Create Object with empty Headers
object_name = rand_name(name='Object')
@@ -353,8 +353,8 @@
@attr(type='negative')
def test_delete_object_without_using_creds(self):
- """Attempt to delete the object anonymously,
- e.g. not using any credentials"""
+ # Attempt to delete the object anonymously,
+ # e.g. not using any credentials
# Create Object
object_name = rand_name(name='Object')
diff --git a/tempest/tests/object_storage/test_object_version.py b/tempest/tests/object_storage/test_object_version.py
index a291ae7..28e0893 100644
--- a/tempest/tests/object_storage/test_object_version.py
+++ b/tempest/tests/object_storage/test_object_version.py
@@ -54,7 +54,7 @@
@attr(type='smoke')
def test_versioned_container(self):
- """Versioned container responses tests"""
+ # Versioned container responses tests
# Create a containers
vers_container_name = rand_name(name='TestVersionContainer')
diff --git a/tempest/tests/volume/admin/test_volume_types.py b/tempest/tests/volume/admin/test_volume_types.py
index 224a927..8ebb78f 100644
--- a/tempest/tests/volume/admin/test_volume_types.py
+++ b/tempest/tests/volume/admin/test_volume_types.py
@@ -41,7 +41,7 @@
super(VolumeTypesTest, cls).tearDownClass()
def test_volume_type_list(self):
- """List Volume types."""
+ # List Volume types.
try:
resp, body = self.client.list_volume_types()
self.assertEqual(200, resp.status)
@@ -50,7 +50,7 @@
self.fail("Could not list volume types")
def test_create_get_delete_volume_with_volume_type_and_extra_specs(self):
- """ Create/get/delete volume with volume_type and extra spec. """
+ # Create/get/delete volume with volume_type and extra spec.
try:
volume = {}
vol_name = rand_name("volume-")
@@ -101,7 +101,7 @@
self.assertEqual(202, resp.status)
def test_volume_type_create_delete(self):
- """ Create/Delete volume type."""
+ # Create/Delete volume type.
try:
name = rand_name("volume-type-")
extra_specs = {"Spec1": "Val1", "Spec2": "Val2"}
@@ -122,7 +122,7 @@
self.fail("Could not create a volume_type")
def test_volume_type_create_get(self):
- """ Create/get volume type."""
+ # Create/get volume type.
try:
body = {}
name = rand_name("volume-type-")
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs.py b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
index 181c37c..9734c42 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
@@ -47,7 +47,7 @@
cls.client.delete_volume_type(cls.volume_type['id'])
def test_volume_type_extra_specs_list(self):
- """List Volume types extra specs."""
+ # List Volume types extra specs.
try:
resp, body = self.client.\
list_volume_types_extra_specs(self.volume_type['id'])
@@ -59,7 +59,7 @@
self.fail("Could not list volume types extra specs")
def test_volume_type_extra_specs_update(self):
- """ Update volume type extra specs"""
+ # Update volume type extra specs
try:
extra_spec = {"spec1": "val2"}
resp, body = self.client.\
@@ -75,7 +75,7 @@
self.fail("Couldnt update volume type extra spec")
def test_volume_type_extra_spec_create_delete(self):
- """ Create/Delete volume type extra spec."""
+ # Create/Delete volume type extra spec.
try:
extra_specs = {"spec2": "val1"}
resp, body = self.client.\
@@ -91,7 +91,7 @@
self.fail("Could not create a volume_type extra spec")
def test_volume_type_extra_spec_create_get(self):
- """ Create/get volume type extra spec"""
+ # Create/get volume type extra spec
try:
extra_specs = {"spec1": "val1"}
resp, body = self.client.\
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
index bfbfaae..d139425 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
@@ -46,7 +46,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_update_no_body(self):
- """ Should not update volume type extra specs with no body"""
+ # Should not update volume type extra specs with no body
extra_spec = {"spec1": "val2"}
self.client.update_volume_type_extra_specs(self.volume_type['id'],
extra_spec.keys()[0],
@@ -55,7 +55,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_update_nonexistent_extra_spec_id(self):
- """ Should not update volume type extra specs with nonexistent id."""
+ # Should not update volume type extra specs with nonexistent id.
extra_spec = {"spec1": "val2"}
self.client.update_volume_type_extra_specs(self.volume_type['id'],
str(uuid.uuid4()),
@@ -64,7 +64,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_update_none_extra_spec_id(self):
- """ Should not update volume type extra specs with none id."""
+ # Should not update volume type extra specs with none id.
extra_spec = {"spec1": "val2"}
self.client.update_volume_type_extra_specs(self.volume_type['id'],
None, extra_spec)
@@ -72,9 +72,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_update_multiple_extra_spec(self):
- """ Should not update volume type extra specs with multiple specs as
- body.
- """
+ # Should not update volume type extra specs with multiple specs as
+ # body.
extra_spec = {"spec1": "val2", 'spec2': 'val1'}
self.client.update_volume_type_extra_specs(self.volume_type['id'],
extra_spec.keys()[0],
@@ -83,9 +82,8 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_create_nonexistent_type_id(self):
- """ Should not create volume type extra spec for nonexistent volume
- type id.
- """
+ # Should not create volume type extra spec for nonexistent volume
+ # type id.
extra_specs = {"spec2": "val1"}
self.client.create_volume_type_extra_specs(str(uuid.uuid4()),
extra_specs)
@@ -94,7 +92,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_none_body(self):
- """ Should not create volume type extra spec for none POST body."""
+ # Should not create volume type extra spec for none POST body.
self.client.create_volume_type_extra_specs(self.volume_type['id'],
None)
@@ -102,16 +100,15 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_invalid_body(self):
- """ Should not create volume type extra spec for invalid POST body."""
+ # Should not create volume type extra spec for invalid POST body.
self.client.create_volume_type_extra_specs(self.volume_type['id'],
['invalid'])
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_nonexistent_volume_type_id(self):
- """ Should not delete volume type extra spec for nonexistent
- type id.
- """
+ # Should not delete volume type extra spec for nonexistent
+ # type id.
extra_specs = {"spec1": "val1"}
self.client.delete_volume_type_extra_specs(str(uuid.uuid4()),
extra_specs.keys()[0])
@@ -119,13 +116,13 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_list_nonexistent_volume_type_id(self):
- """ Should not list volume type extra spec for nonexistent type id."""
+ # Should not list volume type extra spec for nonexistent type id.
self.client.list_volume_types_extra_specs(str(uuid.uuid4()))
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_nonexistent_volume_type_id(self):
- """ Should not get volume type extra spec for nonexistent type id."""
+ # Should not get volume type extra spec for nonexistent type id.
extra_specs = {"spec1": "val1"}
self.client.get_volume_type_extra_specs(str(uuid.uuid4()),
extra_specs.keys()[0])
@@ -133,9 +130,8 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_nonexistent_extra_spec_id(self):
- """ Should not get volume type extra spec for nonexistent extra spec
- id.
- """
+ # Should not get volume type extra spec for nonexistent extra spec
+ # id.
self.client.get_volume_type_extra_specs(self.volume_type['id'],
str(uuid.uuid4()))
diff --git a/tempest/tests/volume/admin/test_volume_types_negative.py b/tempest/tests/volume/admin/test_volume_types_negative.py
index 91237fc..c2daef9 100644
--- a/tempest/tests/volume/admin/test_volume_types_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_negative.py
@@ -35,8 +35,7 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_create_with_nonexistent_volume_type(self):
- """ Should not be able to create volume with nonexistent volume_type.
- """
+ # Should not be able to create volume with nonexistent volume_type.
self.volumes_client.create_volume(size=1,
display_name=str(uuid.uuid4()),
volume_type=str(uuid.uuid4()))
@@ -45,20 +44,19 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_with_empty_name(self):
- """ Should not be able to create volume type with an empty name."""
+ # Should not be able to create volume type with an empty name.
self.client.create_volume_type('')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_nonexistent_type_id(self):
- """ Should not be able to get volume type with nonexistent type id."""
+ # Should not be able to get volume type with nonexistent type id.
self.client.get_volume_type(str(uuid.uuid4()))
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_nonexistent_type_id(self):
- """ Should not be able to delete volume type with nonexistent type id.
- """
+ # Should not be able to delete volume type with nonexistent type id.
self.client.delete_volume_type(str(uuid.uuid4()))
diff --git a/tempest/tests/volume/test_volumes_actions.py b/tempest/tests/volume/test_volumes_actions.py
index 52c270c..7eddb67 100644
--- a/tempest/tests/volume/test_volumes_actions.py
+++ b/tempest/tests/volume/test_volumes_actions.py
@@ -50,7 +50,7 @@
@attr(type='smoke')
def test_attach_detach_volume_to_instance(self):
- """Volume is attached and detached successfully from an instance"""
+ # Volume is attached and detached successfully from an instance
try:
mountpoint = '/dev/vdc'
resp, body = self.client.attach_volume(self.volume['id'],
@@ -67,7 +67,7 @@
self.client.wait_for_volume_status(self.volume['id'], 'available')
def test_get_volume_attachment(self):
- """Verify that a volume's attachment information is retrieved"""
+ # Verify that a volume's attachment information is retrieved
mountpoint = '/dev/vdc'
resp, body = self.client.attach_volume(self.volume['id'],
self.server['id'],
diff --git a/tempest/tests/volume/test_volumes_get.py b/tempest/tests/volume/test_volumes_get.py
index 048c340..bc64ff4 100644
--- a/tempest/tests/volume/test_volumes_get.py
+++ b/tempest/tests/volume/test_volumes_get.py
@@ -25,7 +25,7 @@
@attr(type='smoke')
def test_volume_create_get_delete(self):
- """Create a volume, Get it's details and Delete the volume"""
+ # Create a volume, Get it's details and Delete the volume
try:
volume = {}
v_name = rand_name('Volume-')
@@ -69,7 +69,7 @@
@attr(type='positive')
def test_volume_get_metadata_none(self):
- """Create a volume without passing metadata, get details, and delete"""
+ # Create a volume without passing metadata, get details, and delete
try:
volume = {}
v_name = rand_name('Volume-')
diff --git a/tempest/tests/volume/test_volumes_list.py b/tempest/tests/volume/test_volumes_list.py
index b387b15..26a85b7 100644
--- a/tempest/tests/volume/test_volumes_list.py
+++ b/tempest/tests/volume/test_volumes_list.py
@@ -34,7 +34,7 @@
@attr(type='smoke')
def test_volume_list(self):
- """Get a list of Volumes"""
+ # Get a list of Volumes
# Fetch all volumes
resp, fetched_list = self.client.list_volumes()
self.assertEqual(200, resp.status)
@@ -47,7 +47,7 @@
@attr(type='smoke')
def test_volume_list_with_details(self):
- """Get a list of Volumes with details"""
+ # Get a list of Volumes with details
# Fetch all Volumes
resp, fetched_list = self.client.list_volumes_with_detail()
self.assertEqual(200, resp.status)
diff --git a/tempest/tests/volume/test_volumes_negative.py b/tempest/tests/volume/test_volumes_negative.py
index 2c8b006..6bd7002 100644
--- a/tempest/tests/volume/test_volumes_negative.py
+++ b/tempest/tests/volume/test_volumes_negative.py
@@ -28,7 +28,7 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_volume_get_nonexistant_volume_id(self):
- """Should not be able to get a nonexistant volume"""
+ # Should not be able to get a nonexistant volume
#Creating a nonexistant volume id
volume_id_list = []
resp, volumes = self.client.list_volumes()
@@ -44,7 +44,7 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_volume_delete_nonexistant_volume_id(self):
- """Should not be able to delete a nonexistant Volume"""
+ # Should not be able to delete a nonexistant Volume
# Creating nonexistant volume id
volume_id_list = []
resp, volumes = self.client.list_volumes()
@@ -60,10 +60,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_invalid_size(self):
- """
- Should not be able to create volume with invalid size
- in request
- """
+ # Should not be able to create volume with invalid size
+ # in request
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='#$%',
@@ -73,10 +71,8 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_out_passing_size(self):
- """
- Should not be able to create volume without passing size
- in request
- """
+ # Should not be able to create volume without passing size
+ # in request
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='',
@@ -86,9 +82,7 @@
@raises(exceptions.BadRequest)
@attr(type='negative')
def test_create_volume_with_size_zero(self):
- """
- Should not be able to create volume with size zero
- """
+ # Should not be able to create volume with size zero
v_name = rand_name('Volume-')
metadata = {'Type': 'work'}
resp, volume = self.client.create_volume(size='0',
@@ -98,33 +92,25 @@
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_invalid_volume_id(self):
- """
- Should not be able to get volume with invalid id
- """
+ # Should not be able to get volume with invalid id
resp, volume = self.client.get_volume('#$%%&^&^')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_get_volume_without_passing_volume_id(self):
- """
- Should not be able to get volume when empty ID is passed
- """
+ # Should not be able to get volume when empty ID is passed
resp, volume = self.client.get_volume('')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_invalid_volume_id(self):
- """
- Should not be able to delete volume when invalid ID is passed
- """
+ # Should not be able to delete volume when invalid ID is passed
resp, volume = self.client.delete_volume('!@#$%^&*()')
@raises(exceptions.NotFound)
@attr(type='negative')
def test_delete_volume_without_passing_volume_id(self):
- """
- Should not be able to delete volume when empty ID is passed
- """
+ # Should not be able to delete volume when empty ID is passed
resp, volume = self.client.delete_volume('')
diff --git a/tools/hacking.py b/tools/hacking.py
index 6e66005..ec64951 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -36,13 +36,13 @@
# Don't need this for testing
logging.disable('LOG')
-#N1xx comments
-#N2xx except
-#N3xx imports
-#N4xx docstrings
-#N5xx dictionaries/lists
-#N6xx calling methods
-#N7xx localization
+#T1xx comments
+#T2xx except
+#T3xx imports
+#T4xx docstrings
+#T5xx dictionaries/lists
+#T6xx calling methods
+#T7xx localization
#N8xx git commit messages
IMPORT_EXCEPTIONS = ['sqlalchemy', 'migrate']
@@ -110,13 +110,13 @@
tempest HACKING guide recommendation for TODO:
Include your name with TODOs as in "#TODO(termie)"
- N101
+ T101
"""
pos = physical_line.find('TODO')
pos1 = physical_line.find('TODO(')
pos2 = physical_line.find('#') # make sure it's a comment
if (pos != pos1 and pos2 >= 0 and pos2 < pos):
- return pos, "TEMPEST N101: Use TODO(NAME)"
+ return pos, "T101: Use TODO(NAME)"
def tempest_except_format(logical_line):
@@ -124,10 +124,10 @@
tempest HACKING guide recommends not using except:
Do not write "except:", use "except Exception:" at the very least
- N201
+ T201
"""
if logical_line.startswith("except:"):
- yield 6, "TEMPEST N201: no 'except:' at least use 'except Exception:'"
+ yield 6, "T201: no 'except:' at least use 'except Exception:'"
def tempest_except_format_assert(logical_line):
@@ -135,10 +135,10 @@
tempest HACKING guide recommends not using assertRaises(Exception...):
Do not use overly broad Exception type
- N202
+ T202
"""
if logical_line.startswith("self.assertRaises(Exception"):
- yield 1, "TEMPEST N202: assertRaises Exception too broad"
+ yield 1, "T202: assertRaises Exception too broad"
def tempest_one_import_per_line(logical_line):
@@ -149,14 +149,14 @@
Examples:
BAD: from tempest.common.rest_client import RestClient, RestClientXML
- N301
+ T301
"""
pos = logical_line.find(',')
parts = logical_line.split()
if (pos > -1 and (parts[0] == "import" or
parts[0] == "from" and parts[2] == "import") and
not is_import_exception(parts[1])):
- yield pos, "TEMPEST N301: one import per line"
+ yield pos, "T301: one import per line"
_missingImport = set([])
@@ -166,9 +166,9 @@
tempest HACKING guide recommends importing only modules:
Do not import objects, only modules
- N302 import only modules
- N303 Invalid Import
- N304 Relative Import
+ T302 import only modules
+ T303 Invalid Import
+ T304 Relative Import
"""
def importModuleCheck(mod, parent=None, added=False):
"""
@@ -193,12 +193,12 @@
if added:
sys.path.pop()
added = False
- return logical_line.find(mod), ("TEMPEST N304: No "
+ return logical_line.find(mod), ("T304: No "
"relative imports. "
"'%s' is a relative "
"import"
% logical_line)
- return logical_line.find(mod), ("TEMPEST N302: import only"
+ return logical_line.find(mod), ("T302: import only"
" modules. '%s' does not "
"import a module"
% logical_line)
@@ -222,7 +222,7 @@
except AttributeError:
# Invalid import
- return logical_line.find(mod), ("TEMPEST N303: Invalid import, "
+ return logical_line.find(mod), ("T303: Invalid import, "
"AttributeError raised")
# convert "from x import y" to " import x.y"
@@ -240,7 +240,7 @@
# TODO(jogo) handle "from x import *"
-#TODO(jogo): import template: N305
+#TODO(jogo): import template: T305
def tempest_import_alphabetical(logical_line, line_number, lines):
@@ -248,7 +248,7 @@
Tempest HACKING guide recommendation for imports:
imports in human alphabetical order
- N306
+ T306
"""
# handle import x
# use .lower since capitalization shouldn't dictate order
@@ -260,7 +260,7 @@
if (len(split_line) in length and len(split_previous) in length and
split_line[0] == "import" and split_previous[0] == "import"):
if split_line[1] < split_previous[1]:
- yield (0, "TEMPEST N306: imports not in alphabetical order"
+ yield (0, "T306: imports not in alphabetical order"
" (%s, %s)"
% (split_previous[1], split_line[1]))
@@ -270,12 +270,12 @@
tempest HACKING guide recommendation for docstring:
Docstring should not start with space
- N401
+ T401
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
if (pos != -1 and len(physical_line) > pos + 1):
if (physical_line[pos + 3] == ' '):
- return (pos, "TEMPEST N401: one line docstring should not start"
+ return (pos, "T401: one line docstring should not start"
" with a space")
@@ -284,13 +284,13 @@
tempest HACKING guide recommendation for one line docstring:
A one line docstring looks like this and ends in a period.
- N402
+ T402
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
end = max([physical_line[-4:-1] == i for i in DOCSTRING_TRIPLE]) # end
if (pos != -1 and end and len(physical_line) > pos + 4):
if (physical_line[-5] != '.'):
- return pos, "TEMPEST N402: one line docstring needs a period"
+ return pos, "T402: one line docstring needs a period"
def tempest_docstring_multiline_end(physical_line):
@@ -298,12 +298,29 @@
Tempest HACKING guide recommendation for docstring:
Docstring should end on a new line
- N403
+ T403
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
if (pos != -1 and len(physical_line) == pos):
if (physical_line[pos + 3] == ' '):
- return (pos, "TEMPEST N403: multi line docstring end on new line")
+ return (pos, "T403: multi line docstring end on new line")
+
+
+def tempest_no_test_docstring(physical_line, previous_logical, filename):
+ """Check that test_ functions don't have docstrings
+
+ This ensure we get better results out of tempest, instead
+ of them being hidden behind generic descriptions of the
+ functions.
+
+ T404
+ """
+ if "tempest/test" in filename:
+ pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE])
+ if pos != -1:
+ if previous_logical.startswith("def test_"):
+ return (pos, "T404: test functions must "
+ "not have doc strings")
FORMAT_RE = re.compile("%(?:"
@@ -353,25 +370,25 @@
if not format_string:
raise LocalizationError(start,
- "TEMEPST N701: Empty localization "
+ "T701: Empty localization "
"string")
if token_type != tokenize.OP:
raise LocalizationError(start,
- "TEMPEST N701: Invalid localization "
+ "T701: Invalid localization "
"call")
if text != ")":
if text == "%":
raise LocalizationError(start,
- "TEMPEST N702: Formatting "
+ "T702: Formatting "
"operation should be outside"
" of localization method call")
elif text == "+":
raise LocalizationError(start,
- "TEMPEST N702: Use bare string "
+ "T702: Use bare string "
"concatenation instead of +")
else:
raise LocalizationError(start,
- "TEMPEST N702: Argument to _ must"
+ "T702: Argument to _ must"
" be just a string")
format_specs = FORMAT_RE.findall(format_string)
@@ -380,16 +397,16 @@
# not spec means %%, key means %(smth)s
if len(positional_specs) > 1:
raise LocalizationError(start,
- "TEMPEST N703: Multiple positional "
+ "T703: Multiple positional "
"placeholders")
def tempest_localization_strings(logical_line, tokens):
"""Check localization in line.
- N701: bad localization call
- N702: complex expression instead of string as argument to _()
- N703: multiple positional placeholders
+ T701: bad localization call
+ T702: complex expression instead of string as argument to _()
+ T703: multiple positional placeholders
"""
gen = check_i18n()
@@ -431,8 +448,8 @@
tempest HACKING recommends not referencing a bug or blueprint
in first line, it should provide an accurate description of the change
- N801
- N802 Title limited to 50 chars
+ T801
+ T802 Title limited to 50 chars
"""
#Get title of most recent commit
@@ -453,12 +470,12 @@
error = False
#NOTE(jogo) if match regex but over 3 words, acceptable title
if GIT_REGEX.search(title) is not None and len(title.split()) <= 3:
- print ("N801: git commit title ('%s') should provide an accurate "
+ print ("T801: git commit title ('%s') should provide an accurate "
"description of the change, not just a reference to a bug "
"or blueprint" % title.strip())
error = True
if len(title.decode('utf-8')) > 72:
- print ("N802: git commit title ('%s') should be under 50 chars"
+ print ("T802: git commit title ('%s') should be under 50 chars"
% title.strip())
error = True
return error
@@ -468,8 +485,8 @@
sys.path.append(os.getcwd())
#Run once tests (not per line)
once_error = once_git_check_commit_title()
- #TEMPEST error codes start with an N
- pep8.ERRORCODE_REGEX = re.compile(r'[EWN]\d{3}')
+ #TEMPEST error codes start with a T
+ pep8.ERRORCODE_REGEX = re.compile(r'[EWT]\d{3}')
add_tempest()
pep8.current_file = current_file
pep8.readlines = readlines
diff --git a/tox.ini b/tox.ini
index 2d8e627..da3f5cf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,4 +15,4 @@
[testenv:pep8]
deps = pep8==1.3.3
-commands = python tools/hacking.py --ignore=N4,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,*egg .
+commands = python tools/hacking.py --ignore=T401,T402,E122,E125,E126 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,*egg .