]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Unit test fails in pbuilder environment
authorMichael Kerrin <michael.kerrin@hp.com>
Thu, 24 Oct 2013 15:17:47 +0000 (15:17 +0000)
committerMichael Kerrin <michael.kerrin@hp.com>
Thu, 24 Oct 2013 15:17:47 +0000 (15:17 +0000)
When running tests inside a pbuilder environment we don't
have /dev/disk/by-path directory and so the test_host_driver
test fails. Fix test by overriding the isdir method to
return True and pretend that the directory is there.

Change-Id: Ifd39d796b7f250b1ec45227a4262ebb33d5656bf

cinder/tests/brick/test_brick_connector.py

index e98470cf10bfe2a11c4c2765fc88e12019f98d1c..ebb12e64e2c6e4698aa06f0558eea01a97b33302 100644 (file)
@@ -105,6 +105,7 @@ class HostDriverTestCase(test.TestCase):
 
     def setUp(self):
         super(HostDriverTestCase, self).setUp()
+        self.stubs.Set(os.path, 'isdir', lambda x: True)
         self.devlist = ['device1', 'device2']
         self.stubs.Set(os, 'listdir', lambda x: self.devlist)