Merge "Do not pass device when calling compute.base.attach_volume"
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 0093752..0263b81 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -107,11 +107,10 @@
     @utils.services('volume')
     def test_delete_server_while_in_attached_volume(self):
         # Delete a server while a volume is attached to it
-        device = '/dev/%s' % CONF.compute.volume_device_name
         server = self.create_test_server(wait_until='ACTIVE')
 
         volume = self.create_volume()
-        self.attach_volume(server, volume, device=device)
+        self.attach_volume(server, volume)
 
         self.client.delete_server(server['id'])
         waiters.wait_for_server_termination(self.client, server['id'])
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index 1260c6b..caceb64 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -43,7 +43,6 @@
     @classmethod
     def resource_setup(cls):
         super(ServerRescueNegativeTestJSON, cls).resource_setup()
-        cls.device = CONF.compute.volume_device_name
         cls.password = data_utils.rand_password()
         rescue_password = data_utils.rand_password()
         # Server for negative tests
@@ -125,8 +124,7 @@
         self.assertRaises(lib_exc.Conflict,
                           self.servers_client.attach_volume,
                           self.server_id,
-                          volumeId=volume['id'],
-                          device='/dev/%s' % self.device)
+                          volumeId=volume['id'])
 
     @decorators.idempotent_id('f56e465b-fe10-48bf-b75d-646cda3a8bc9')
     @utils.services('volume')
@@ -136,7 +134,7 @@
 
         # Attach the volume to the server
         server = self.servers_client.show_server(self.server_id)['server']
-        self.attach_volume(server, volume, device='/dev/%s' % self.device)
+        self.attach_volume(server, volume)
 
         # Rescue the server
         self.servers_client.rescue_server(self.server_id,
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 811b521..f7b5b4b 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -84,6 +84,11 @@
             linux_client.validate_authentication()
 
         volume = self.create_volume()
+
+        # NOTE: As of the 12.0.0 Liberty release, the Nova libvirt driver
+        # no longer honors a user-supplied device name, in that case
+        # CONF.compute.volume_device_name must be set the equal value as
+        # the libvirt auto-assigned one
         attachment = self.attach_volume(server, volume,
                                         device=('/dev/%s' % self.device))
 
@@ -121,8 +126,7 @@
         # List volume attachment of the server
         server, _ = self._create_server()
         volume_1st = self.create_volume()
-        attachment_1st = self.attach_volume(server, volume_1st,
-                                            device=('/dev/%s' % self.device))
+        attachment_1st = self.attach_volume(server, volume_1st)
         body = self.servers_client.list_volume_attachments(
             server['id'])['volumeAttachments']
         self.assertEqual(1, len(body))
@@ -234,8 +238,7 @@
         volume = self.create_volume()
         num_vol = self._count_volumes(server, validation_resources)
         self._shelve_server(server, validation_resources)
-        attachment = self.attach_volume(server, volume,
-                                        device=('/dev/%s' % self.device))
+        attachment = self.attach_volume(server, volume)
 
         # Unshelve the instance and check that attached volume exists
         self._unshelve_server_and_check_volumes(
@@ -264,7 +267,7 @@
         self._shelve_server(server, validation_resources)
 
         # Attach and then detach the volume
-        self.attach_volume(server, volume, device=('/dev/%s' % self.device))
+        self.attach_volume(server, volume)
         self.servers_client.detach_volume(server['id'], volume['id'])
         waiters.wait_for_volume_resource_status(self.volumes_client,
                                                 volume['id'], 'available')
diff --git a/tempest/api/compute/volumes/test_attach_volume_negative.py b/tempest/api/compute/volumes/test_attach_volume_negative.py
index 8618148..6d08f90 100644
--- a/tempest/api/compute/volumes/test_attach_volume_negative.py
+++ b/tempest/api/compute/volumes/test_attach_volume_negative.py
@@ -35,9 +35,7 @@
     def test_delete_attached_volume(self):
         server = self.create_test_server(wait_until='ACTIVE')
         volume = self.create_volume()
-
-        path = "/dev/%s" % CONF.compute.volume_device_name
-        self.attach_volume(server, volume, device=path)
+        self.attach_volume(server, volume)
 
         self.assertRaises(lib_exc.BadRequest,
                           self.delete_volume, volume['id'])