From: Michael Kerrin Date: Thu, 24 Oct 2013 15:17:47 +0000 (+0000) Subject: Unit test fails in pbuilder environment X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ea51db596906c663e0c04b546b3ca79873dd74f0;p=openstack-build%2Fcinder-build.git Unit test fails in pbuilder environment 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 --- diff --git a/cinder/tests/brick/test_brick_connector.py b/cinder/tests/brick/test_brick_connector.py index e98470cf1..ebb12e64e 100644 --- a/cinder/tests/brick/test_brick_connector.py +++ b/cinder/tests/brick/test_brick_connector.py @@ -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)