summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago da Silva <thiago@redhat.com>2014-01-06 16:21:44 -0500
committerThiago da Silva <thiago@redhat.com>2014-01-06 16:21:44 -0500
commit1761d5028a28d2fe440ffbfbb74a6848c58812fe (patch)
tree136561a4b10717ab38569d45834fb395871ec232
parente1857bff750c32e0f27d182899b9c2eed3ef5e37 (diff)
fixing tests and indentation errors
fixed rename and rmdir tests with correct if statements and removed tabs from test_fallocate Change-Id: I02edd7511ba134395cba94b8f2d32b73dd936a0f Signed-off-by: Thiago da Silva <thiago@redhat.com>
-rw-r--r--gluster/gfapi.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gluster/gfapi.py b/gluster/gfapi.py
index 3ac67f4..c8d79a8 100644
--- a/gluster/gfapi.py
+++ b/gluster/gfapi.py
@@ -266,7 +266,7 @@ if __name__ == "__main__":
if isinstance(ofd,File):
return False, "old path working after rename"
nfd = vol.open(npath,os.O_RDWR)
- if isinstance(nfd,File):
+ if not isinstance(nfd,File):
return False, "new path not working after rename"
return True, "rename worked"
@@ -323,7 +323,7 @@ if __name__ == "__main__":
if rc < 0:
return False, "rmdir error %d" % rc
sb = vol.lstat(mypath)
- if not isinstance(sb,Stat):
+ if isinstance(sb,Stat):
return False, "dir still there after rmdir"
return True, "rmdir worked"
@@ -362,12 +362,12 @@ if __name__ == "__main__":
fd = vol.creat(mypath,os.O_WRONLY|os.O_EXCL,0644)
if not fd:
return False, "creat error"
- rc = fd.fallocate(0, 0, 1024*1024)
+ rc = fd.fallocate(0, 0, 1024*1024)
if rc != 0:
return False, "fallocate error"
- rc = fd.discard(4096, 4096)
- if rc != 0:
- return False, "discard error"
+ rc = fd.discard(4096, 4096)
+ if rc != 0:
+ return False, "discard error"
return True, "fallocate/discard worked"
test_list = (