tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume failed when the self.device(vdb)value was in use(config_drive vfat in my case)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
Undecided
|
Paras Babbar |
Bug Description
The issue is basically in this line https:/
So if self.drive i.e volume device name in tempest.conf is not mentioned in tempest.conf then this function as per Note below takes the auto assign value which is independent of checking of it's in use or not. My suggestion is to fetch the value of disk from the json response generated after created/attached volume instance and use this device value to check if the device is properly removed or not rather than relying on self.drive which is based on assumptions.
More Granular details:
def test_attach_
''''''''''''
# 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.
# the libvirt auto-assigned one
attachment = self.attach_
=> This self.device is randomly coming may be from libvirt(as per the comment) if we don't specify the volume_device_name in tempest.conf and in my case it picked vdb and vdb was already in use by config drive (vfat) thus my test got failed in assertNotIn function.
if CONF.validation
disks = linux_client.
if CONF.validation
disks = linux_client.
*******
>>print(
vdb => self.device value took from libvirt
try to attach the volume and use vdb but actually vdb was already in use by meta data volume so vdc got attached as below
>>print(disks) (disk of instance)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 1073741824 0 disk #root volume
vdb 253:16 0 67108864 0 disk #config drive(vfat)
vdc 253:32 0 1073741824 0 disk #new volume attached
>>print(disks) #this one is after the vdc got detached (disk that got attached)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 1073741824 0 disk
vdb 253:16 0 67108864 0 disk
#self.assertNot
Steps to reproduce
1. deploy an instance with one already added vdb volume attached(Like I have used config drive format vfat that already took vdb volume)
2. run this testcase tempest.
3. This will fail in assertNotIn mismatch error like below as it tries to validate that vdb is detached or not which is set by libvirt assumption
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
raise mismatch_error
testtools.
Fix proposed to branch: master /review. opendev. org/694636
Review: https:/