Remove skips for resolved bugs and fixed some coding errors in tests.

Note that the image tests were said by Brain Walden to be correct and that
tempest should be changed. So I did that.

Change-Id: I685f0d798a43bdeaf013e54837ccfb7d598360a3
This commit is contained in:
David Kranz 2012-07-10 10:14:38 -04:00
parent 50a49fffce
commit 28e35c56ba
6 changed files with 17 additions and 40 deletions

View File

@ -193,7 +193,7 @@ class RestClient(object):
if resp.status == 400:
resp_body = json.loads(resp_body)
self._log(req_url, body, resp, resp_body)
raise exceptions.BadRequest(resp_body['badRequest']['message'])
raise exceptions.BadRequest(resp_body)
if resp.status == 409:
resp_body = json.loads(resp_body)

View File

@ -314,50 +314,46 @@ class ImagesTest(BaseComputeTest):
non_existent_image_id)
@attr(type='negative')
@unittest.skip("Until Bug 1006033 is fixed")
def test_delete_image_blank_id(self):
"""Return an error while trying to delete an image with blank Id"""
try:
self.assertRaises(exceptions.BadRequest, self.client.delete_image,
self.assertRaises(exceptions.NotFound, self.client.delete_image,
'')
except:
self.fail("Did not return HTTP 400 BadRequest for blank image id")
self.fail("Did not return HTTP 404 NotFound for blank image id")
@attr(type='negative')
@unittest.skip("Until Bug 1006033 is fixed")
def test_delete_image_non_hex_string_id(self):
"""Return an error while trying to delete an image with non hex id"""
image_id = '11a22b9-120q-5555-cc11-00ab112223gj'
try:
self.assertRaises(exceptions.BadRequest, self.client.delete_image,
self.assertRaises(exceptions.NotFound, self.client.delete_image,
image_id)
except:
self.fail("Did not return HTTP 400 BadRequest for non hex image")
self.fail("Did not return HTTP 404 NotFound for non hex image")
@attr(type='negative')
@unittest.skip("Until Bug 1006033 is fixed")
def test_delete_image_negative_image_id(self):
"""Return an error while trying to delete an image with negative id"""
try:
self.assertRaises(exceptions.BadRequest, self.client.delete_image,
self.assertRaises(exceptions.NotFound, self.client.delete_image,
-1)
except:
self.fail("Did not return HTTP 400 BadRequest for negative image "
self.fail("Did not return HTTP 404 NotFound for negative image "
"id")
@attr(type='negative')
@unittest.skip("Until Bug 1006033 is fixed")
def test_delete_image_id_is_over_35_character_limit(self):
"""Return an error while trying to delete image with id over limit"""
try:
self.assertRaises(exceptions.OverLimit, self.client.delete_image,
self.assertRaises(exceptions.NotFound, self.client.delete_image,
'11a22b9-120q-5555-cc11-00ab112223gj-3fac')
except:
self.fail("Did not return HTTP 413 OverLimit for image id that "
self.fail("Did not return HTTP 404 NotFound for image id that "
"exceeds 35 character ID length limit")
@attr(type='negative')

View File

@ -79,7 +79,6 @@ class FloatingIPDetailsTest(BaseComputeTest):
self.client.delete_floating_ip(floating_ip_id)
@attr(type='negative')
@unittest.skip('Skipping until Nova Bug 940500 is fixed')
def test_get_nonexistant_floating_ip_details(self):
"""
Negative test:Should not be able to GET the details

View File

@ -79,16 +79,9 @@ class RolesTest(BaseIdentityAdminTest):
found = [role for role in body if role['name'] == role_name]
self.assertFalse(any(found))
@unittest.skip('Until bug 997725 is fixed.')
def test_role_create_blank_name(self):
"""Should not be able to create a role with a blank name"""
try:
resp, body = self.client.create_role('')
except exceptions.Duplicate:
self.fail('A role with a blank name already exists.')
self.assertTrue('status' in resp)
self.assertFalse(resp['status'].startswith('2'), 'Create role with '
'empty name should fail')
self.assertRaises(exceptions.BadRequest, self.client.create_role, '')
def test_role_create_duplicate(self):
"""Role names should be unique"""
@ -138,34 +131,28 @@ class UserRolesTest(RolesTest):
tenant['id'])
self.client.clear_auth()
@unittest.skip("Until Bug 999608 is fixed")
def test_assign_user_role_for_non_existent_user(self):
"""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,
'junk-user-id-999', role['id'], tenant['id'])
@unittest.skip("Until Bug 999608 is fixed")
def test_assign_user_role_for_non_existent_role(self):
"""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,
user['id'], 'junk-role-id-12345', tenant['id'])
@unittest.skip("Until Bug 999608 is fixed")
def test_assign_user_role_for_non_existent_tenant(self):
"""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,
user['id'], role['id'], 'junk-tenant-1234')
@unittest.skip("Until Bug 999594 is fixed")
def test_assign_duplicate_user_role(self):
"""Duplicate user role should not get assigned"""
(user, tenant, role) = self._get_role_params()
self.client.create_user_role(user['id'], role['id'], tenant['id'])
resp, body = self.client.assign_user_role(user['id'], role['id'],
tenant['id'])
self.client.assign_user_role(user['id'], role['id'], tenant['id'])
self.assertRaises(exceptions.Duplicate, self.client.assign_user_role,
user['id'], role['id'], tenant['id'])
@ -198,7 +185,7 @@ class UserRolesTest(RolesTest):
self.client.remove_user_role, user['id'], role['id'])
self.client.clear_auth()
@unittest.skip("Until Bug 999567 is fixed")
@unittest.skip("Until Bug 1022990 is fixed")
def test_remove_user_role_non_existant_user(self):
"""Attempt to remove a role from a non existent user should fail"""
(user, tenant, role) = self._get_role_params()
@ -207,7 +194,7 @@ class UserRolesTest(RolesTest):
self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
'junk-user-id-123', role['id'])
@unittest.skip("Until Bug 999567 is fixed")
@unittest.skip("Until Bug 1022990 is fixed")
def test_remove_user_role_non_existant_role(self):
"""Attempt to delete a non existent role from a user should fail"""
(user, tenant, role) = self._get_role_params()
@ -239,7 +226,6 @@ class UserRolesTest(RolesTest):
self.client.list_user_roles, user['id'])
self.client.clear_auth()
@unittest.skip("Until Bug 999209 is fixed")
def test_list_user_roles_for_non_existent_user(self):
"""Attempt to list roles of a non existent user should fail"""
self.assertRaises(exceptions.NotFound, self.client.list_user_roles,

View File

@ -169,16 +169,14 @@ class TenantsTest(BaseIdentityAdminTest):
tenant_name)
self.client.clear_auth()
@unittest.skip("Until Bug 987121 is fixed")
def test_create_tenant_with_empty_name(self):
"""Tenant name should not be empty"""
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
name='')
@unittest.skip("Until Bug 966249 is fixed")
def test_create_tenants_name_length_over_64(self):
"""Tenant name length should not be greater than 64 characters"""
tenant_name = 'a' * 64
tenant_name = 'a' * 65
self.assertRaises(exceptions.BadRequest, self.client.create_tenant,
tenant_name)

View File

@ -52,7 +52,6 @@ class UsersTest(BaseIdentityAdminTest):
self.alt_email)
@attr(type='negative')
@unittest.skip("Until Bug 987121 is fixed")
def test_create_user_with_empty_name(self):
"""User with an empty name should not be created"""
self.data.setup_test_tenant()
@ -61,12 +60,12 @@ class UsersTest(BaseIdentityAdminTest):
self.alt_email)
@attr(type='negative')
@unittest.skip("Until Bug 966249 is fixed")
@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"""
self.data.setup_test_tenant()
self.assertRaises(exceptions.BadRequest, self.client.create_user,
'a' * 64, self.alt_password,
'a' * 65, self.alt_password,
self.data.tenant['id'], self.alt_email)
@attr(type='negative')
@ -92,7 +91,7 @@ class UsersTest(BaseIdentityAdminTest):
"""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' * 64, self.data.tenant['id'],
self.alt_user, 'a' * 65, self.data.tenant['id'],
self.alt_email)
@attr(type='negative')
@ -163,7 +162,6 @@ class UsersTest(BaseIdentityAdminTest):
self.assertEqual('200', resp['status'])
@attr(type='negative')
@unittest.skip('Until Bug 1022411 is fixed')
def test_authentication_for_disabled_user(self):
"""Disabled user's token should not get authenticated"""
self.data.setup_test_user()