From ea51db596906c663e0c04b546b3ca79873dd74f0 Mon Sep 17 00:00:00 2001 From: Michael Kerrin Date: Thu, 24 Oct 2013 15:17:47 +0000 Subject: [PATCH] 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 --- cinder/tests/brick/test_brick_connector.py | 1 + 1 file changed, 1 insertion(+) 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) -- 2.45.2