Skip to content

Commit

Permalink
Fix libvirt test on systems with real iSCSI devices
Browse files Browse the repository at this point in the history
The test_libvirt_kvm_iser_volume_with_multipath_getmpdev() test
expects a system with no real iSCSI devices. It actually triggers
an os.walk() of /dev/disk/by-path/ip-*, which will return any
iSCSI devices on the system. Since the test expects none, this
will cause the test to fail.

This patch just stubs that out to return an empty list always.

Change-Id: Ibb3fd18207d013c35487a3eebb336b5f288b703a
Closes-bug: #1234834
  • Loading branch information
kk7ds committed Oct 3, 2013
1 parent 026edcd commit 3891692
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nova/tests/virt/libvirt/test_libvirt_volume.py
Expand Up @@ -508,6 +508,7 @@ def test_libvirt_kvm_iser_volume_with_multipath_getmpdev(self):
dev = '/dev/disk/by-path/ip-%s-iscsi-%s-lun-1' % (location, iqn)
devs = [dev0, dev]
self.stubs.Set(self.fake_conn, 'get_all_block_devices', lambda: devs)
self.stubs.Set(libvirt_driver, '_get_iscsi_devices', lambda: [])
connection_info = self.iser_connection(vol, location, iqn)
mpdev_filepath = '/dev/mapper/foo'
disk_info = {
Expand Down

0 comments on commit 3891692

Please sign in to comment.