Skip to content

Commit

Permalink
Add negative test for attaching an attached volume to the same instance
Browse files Browse the repository at this point in the history
This scenario came up during the volume multi-attach spec review in
Nova and is something we should be sure is not allowed with a
volume that is already attached since Nova does not yet support
volume multi-attach.

Change-Id: I98e25554d39449178df696a0d90cc62b662eda24
Depends-On: Ifc01dbf98545104c998ab96f65ff8623a6db0f28
  • Loading branch information
mriedem committed Dec 14, 2017
1 parent bd9798d commit bcc7ee8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tempest/api/compute/volumes/test_attach_volume_negative.py
Expand Up @@ -41,3 +41,18 @@ def test_delete_attached_volume(self):

self.assertRaises(lib_exc.BadRequest,
self.delete_volume, volume['id'])

@decorators.attr(type=['negative'])
@decorators.idempotent_id('aab919e2-d992-4cbb-a4ed-745c2475398c')
def test_attach_attached_volume_to_same_server(self):
# Test attaching the same volume to the same instance once
# it's already attached. The nova/cinder validation for this differs
# depending on whether or not cinder v3.27 is being used to attach
# the volume to the instance.
server = self.create_test_server(wait_until='ACTIVE')
volume = self.create_volume()

self.attach_volume(server, volume)

self.assertRaises(lib_exc.BadRequest,
self.attach_volume, server, volume)

0 comments on commit bcc7ee8

Please sign in to comment.