summaryrefslogtreecommitdiffstats
path: root/test/unit/common/test_fs_utils.py
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2013-09-20 11:25:04 -0400
committerLuis Pabon <lpabon@redhat.com>2013-10-29 07:25:59 -0700
commit100d6b01bd40d8b01335e5ecd4a592df79e75b63 (patch)
treefb6875e07b37808b56aa2f0078040c9ef480a58e /test/unit/common/test_fs_utils.py
parent70a4cef96c42fe30e62d23ae816a330d3d35df63 (diff)
Rebase to lastest OpenStack Swift DiskFile API
As of October 28th, 2013, we rebase to OpenStack Swift master (commit 4bfe674) to pick up the lastest officially supported DiskFile API changes. We use a snapshot of OpenStack Swift stored in the gluster-swift launchpad downloads area so that we can deliberately rebase at our own pace. With this refactoring, all the code for handling I/O is wholly contained in the swift tree for object operations. This will allow us to use a different fs_utils implementation in the future (for example, one based on a yet-to-be-implemented python bindings over libgfapi). This also means the "Fake_file" class has been removed entirely. Change-Id: I767983f88c59786e30b6c64da16d1cb6ab3c3e7f Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5993 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'test/unit/common/test_fs_utils.py')
-rw-r--r--test/unit/common/test_fs_utils.py49
1 files changed, 0 insertions, 49 deletions
diff --git a/test/unit/common/test_fs_utils.py b/test/unit/common/test_fs_utils.py
index 19fc2df..c7f969e 100644
--- a/test/unit/common/test_fs_utils.py
+++ b/test/unit/common/test_fs_utils.py
@@ -34,19 +34,6 @@ def mock_os_fdatasync(fd):
return True
-class TestFakefile(unittest.TestCase):
- """ Tests for common.fs_utils.Fake_file """
-
- def test_Fake_file(self):
- path = "/tmp/bar"
- ff = fs.Fake_file(path)
- self.assertEqual(path, ff.path)
- self.assertEqual(0, ff.tell())
- self.assertEqual(None, ff.read(50))
- self.assertEqual(-1, ff.fileno())
- self.assertEqual(None, ff.close())
-
-
class TestFsUtils(unittest.TestCase):
""" Tests for common.fs_utils """
@@ -199,16 +186,6 @@ class TestFsUtils(unittest.TestCase):
def test_do_open(self):
_fd, tmpfile = mkstemp()
try:
- f = fs.do_open(tmpfile, 'r')
- try:
- f.write('test')
- except IOError as err:
- pass
- else:
- self.fail("IOError expected")
- finally:
- f.close()
-
fd = fs.do_open(tmpfile, os.O_RDONLY)
try:
os.write(fd, 'test')
@@ -222,14 +199,6 @@ class TestFsUtils(unittest.TestCase):
os.close(_fd)
os.remove(tmpfile)
- def test_do_open_err(self):
- try:
- fs.do_open(os.path.join('/tmp', str(random.random())), 'r')
- except GlusterFileSystemIOError:
- pass
- else:
- self.fail("GlusterFileSystemIOError expected")
-
def test_do_open_err_int_mode(self):
try:
fs.do_open(os.path.join('/tmp', str(random.random())),
@@ -463,8 +432,6 @@ class TestFsUtils(unittest.TestCase):
pass
else:
self.fail("OSError expected")
- fp = open(tmpfile)
- fs.do_close(fp)
finally:
os.remove(tmpfile)
@@ -482,22 +449,6 @@ class TestFsUtils(unittest.TestCase):
finally:
os.remove(tmpfile)
- def test_do_close_err_fp(self):
- fd, tmpfile = mkstemp()
- os.close(fd)
- fp = open(tmpfile, 'w')
- try:
- fd = fp.fileno()
- os.close(fd)
- try:
- fs.do_close(fp)
- except GlusterFileSystemIOError:
- pass
- else:
- self.fail("GlusterFileSystemIOError expected")
- finally:
- os.remove(tmpfile)
-
def test_do_unlink(self):
fd, tmpfile = mkstemp()
try: