diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-03-09 10:08:58 -0800 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-03-09 10:08:58 -0800 |
commit | 4c92783a314a913bab3c98d30bb9ca4cbeafb4e6 (patch) | |
tree | 8f9ab17242aa0192ab255d083b8653f3b1384975 /tests/t4_fuse.py | |
parent | 9b98afce557a35baac876966bcdd268c4b8e579a (diff) |
Import s3ql_1.13.1.orig.tar.bz2
Diffstat (limited to 'tests/t4_fuse.py')
-rw-r--r-- | tests/t4_fuse.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/t4_fuse.py b/tests/t4_fuse.py index 4f4a4bd..6966f16 100644 --- a/tests/t4_fuse.py +++ b/tests/t4_fuse.py @@ -7,7 +7,7 @@ This program can be distributed under the terms of the GNU GPLv3. ''' from __future__ import absolute_import, division, print_function -from _common import TestCase + from os.path import basename import filecmp import llfuse @@ -15,6 +15,7 @@ import os.path import shutil import stat import subprocess +import cPickle as pickle import sys import tempfile import threading @@ -22,6 +23,7 @@ import time import traceback import unittest2 as unittest import logging +from s3ql.common import CTRL_NAME log = logging.getLogger() @@ -152,7 +154,7 @@ else: mypath = __file__ BASEDIR = os.path.abspath(os.path.join(os.path.dirname(mypath), '..')) -class fuse_tests(TestCase): +class fuse_tests(unittest.TestCase): def setUp(self): skip_if_no_fusermount() @@ -233,6 +235,10 @@ class fuse_tests(TestCase): shutil.rmtree(self.backend_dir) + def test_all(self): + # Workaround py.test not calling runTest + return self.runTest() + def runTest(self): # Run all tests in same environment, mounting and umounting # just takes too long otherwise @@ -249,6 +255,7 @@ class fuse_tests(TestCase): self.tst_truncate() self.tst_truncate_nocache() self.tst_write() + self.tst_bug382() self.umount() self.fsck() @@ -415,6 +422,19 @@ class fuse_tests(TestCase): os.close(fd) os.unlink(filename) + def tst_bug382(self): + dirname = self.newname() + fullname = self.mnt_dir + "/" + dirname + os.mkdir(fullname) + self.assertTrue(stat.S_ISDIR(os.stat(fullname).st_mode)) + self.assertTrue(dirname in llfuse.listdir(self.mnt_dir)) + llfuse.setxattr('%s/%s' % (self.mnt_dir, CTRL_NAME), + 'rmtree', pickle.dumps((llfuse.ROOT_INODE, dirname), + pickle.HIGHEST_PROTOCOL)) + self.assertRaises(OSError, os.stat, fullname) + self.assertTrue(dirname not in llfuse.listdir(self.mnt_dir)) + + # Somehow important according to pyunit documentation def suite(): return unittest.makeSuite(fuse_tests) |