summaryrefslogtreecommitdiffstats
path: root/TestUnits/replicate/self_heal/testcases.py
diff options
context:
space:
mode:
authorShwetha-H-Panduranga <shwetha@gluster.com>2011-12-06 14:26:59 +0530
committerShwetha-H-Panduranga <shwetha@gluster.com>2011-12-06 14:26:59 +0530
commit77c7f324610224e808d8940aec7e6dbf19b790a5 (patch)
tree4d5b3abe8e8220b058f9828822b527b2d6331702 /TestUnits/replicate/self_heal/testcases.py
parent129e39fe6878f28ca203c690fab382b7289b334c (diff)
Adding New/Updated Automation Files
Diffstat (limited to 'TestUnits/replicate/self_heal/testcases.py')
-rw-r--r--TestUnits/replicate/self_heal/testcases.py96
1 files changed, 96 insertions, 0 deletions
diff --git a/TestUnits/replicate/self_heal/testcases.py b/TestUnits/replicate/self_heal/testcases.py
new file mode 100644
index 0000000..0015e5f
--- /dev/null
+++ b/TestUnits/replicate/self_heal/testcases.py
@@ -0,0 +1,96 @@
+"""testcases for replicate/self-heal
+"""
+
+import sys
+import time
+import hostutils
+import managerutils
+import glusterutils
+import atfutils
+import clientutils
+import serverutils
+import parser
+
+def reset_testenv():
+ return_status = 1
+ if clientutils.umountall():
+ return return_status
+ glusterutils.volume_stop("server1", force=True)
+ glusterutils.volume_delete("server1")
+ glusterutils.glusterd_stop_allservers()
+ glusterutils.glusterd_remove_dir_allservers()
+ glusterutils.glusterd_remove_logs_allservers()
+ return 0
+
+def setup_testenv():
+ """
+ """
+ return_status = 1
+ if glusterutils.glusterd_start_allservers(force=True):
+ return return_status
+ if glusterutils.peer_probe("server1"):
+ return return_status
+ if glusterutils.create_brick_allservers():
+ return return_status
+ if glusterutils.volume_create("server1"):
+ return 1
+ glusterutils.volume_set("server1", key="diagnostics.client-log-level", value="DEBUG")
+ if glusterutils.volume_start("server1"):
+ return 1
+ if clientutils.mountall():
+ return 1
+ return 0
+
+def test001():
+ """
+ Description: Test for failure when the entry does not exist
+ """
+ return_status = 1
+ if reset_testenv():
+ return return_status
+ if setup_testenv():
+ return return_status
+ return_status = clientutils.execute_on_mount("mount1", "ls abcd")
+
+ if return_status:
+ test_status = 0
+ else:
+ test_status = 1
+
+ return test_status
+
+def test002():
+ """
+ Description: Test for estale when the fs is stale
+ """
+ return_status = 1
+ if reset_testenv():
+ return return_status
+ if setup_testenv():
+ return return_status
+
+ clientutils.execute_on_mount("mount1", "touch file")
+ serverutils.execute_on_brick("brick1",
+ "setfattr -n trusted.gfid -v 0sBfz5vAdHTEK1GZ99qjqTIg== file")
+ return_status = clientutils.execute_on_mount("mount1", "find file | xargs stat")
+
+ if return_status:
+ test_status = 0
+ else:
+ test_status = 1
+
+ return test_status
+
+
+
+
+
+
+
+
+
+
+
+
+
+