summaryrefslogtreecommitdiffstats
path: root/test/unit/common/test_Glusterfs.py
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2013-07-08 14:10:45 -0400
committerLuis Pabon <lpabon@redhat.com>2013-07-10 15:49:26 -0700
commit677d30716978615d0499344ac0a62c2755a486cf (patch)
treeb86a156f120bdcd6f10d6b9998ef20b80cf50639 /test/unit/common/test_Glusterfs.py
parentf8d876248d29fa7f4857ac8ca02324795ba53353 (diff)
Final forward port of PDQ performance patches
Change-Id: I4ef131b3cc7648d4571a4d854029efb1aff8b901 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5305 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'test/unit/common/test_Glusterfs.py')
-rw-r--r--test/unit/common/test_Glusterfs.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/unit/common/test_Glusterfs.py b/test/unit/common/test_Glusterfs.py
index f36f601..bcb233c 100644
--- a/test/unit/common/test_Glusterfs.py
+++ b/test/unit/common/test_Glusterfs.py
@@ -50,7 +50,12 @@ def _init():
def _init_mock_variables(tmpdir):
os.system = mock_os_system
os.path.ismount = mock_os_path_ismount
- gfs.RUN_DIR = os.path.join(tmpdir, 'var/run/swift')
+ try:
+ os.makedirs(os.path.join(tmpdir, "var", "run"))
+ except OSError as err:
+ if err.errno != errno.EEXIST:
+ raise
+ gfs.RUN_DIR = os.path.join(tmpdir, 'var', 'run', 'swift')
gfs._get_export_list = mock_get_export_list
def _reset_mock_variables():
@@ -108,8 +113,16 @@ class TestGlusterfs(unittest.TestCase):
shutil.rmtree(tmpdir)
def test_mount_get_export_list_err(self):
- gfs._get_export_list = mock_get_export_list
- assert not gfs.mount(None, 'drive')
+ try:
+ tmpdir = mkdtemp()
+ root = os.path.join(tmpdir, 'mnt/gluster-object')
+ drive = 'test3'
+
+ _init_mock_variables(tmpdir)
+ gfs._get_export_list = mock_get_export_list
+ assert not gfs.mount(root, drive)
+ finally:
+ shutil.rmtree(tmpdir)
def tearDown(self):
_reset_mock_variables()