test_images contains some inefficient and wrong test cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
High
|
Attila Fazekas |
Bug Description
There are a number of issues with the negative tests in tempest/
1) There are many test methods that create a new server and then test that an image cannot be created in various vm state transitions/
2) Some tests just don't make any sense at all. For instance:
@attr(
def test_delete_
"""Return an error while trying to delete an active that is creating"""
server = self.create_
resp, body = self.client.
image_id = data_utils.
# Do not wait, attempt to delete the image, ensure it's successful
resp, body = self.client.
The above test is:
* Creating an instance
* Snapshotting the instance
* Deleting the snapshot (image)
* Asserting that the snapshot does not then appear
This test, however:
a) Does not check that the image snapshot is actually not yet active... it just assumes it isn't active
b) The docstring doesn't make sense...
c) This set of actions is already tested extensively in other tests in the test case
So, IMHO, it should be removed. It represents something that unit tests should cover, not really functional tests.
3) Some tests check for seemingly incorrect assertions. For example:
@attr(
def test_create_
"""An image should not be created if the server instance is removed """
server_name = rand_name('server')
resp, server = self.servers_
# Delete server before trying to create server
try:
# Create a new image after server is deleted
name = rand_name('image')
meta = {'image_type': 'test'}
resp, body = self.client.
except:
pass
else:
The except: block is bare... what exception is being expected here?
And this:
@attr(
def test_create_
"""Return error when creating an image of a server that is building"""
server_name = rand_name(
resp, server = self.servers_
Why is Duplicate expected here?
Changed in tempest: | |
importance: | Undecided → High |
status: | New → In Progress |
assignee: | nobody → Jay Pipes (jaypipes) |
Changed in tempest: | |
assignee: | Jay Pipes (jaypipes) → Attila Fazekas (afazekas) |
Changed in tempest: | |
milestone: | none → havana-3 |
http:// paste.openstack .org/show/ 18433/