summaryrefslogtreecommitdiffstats
path: root/Glusterfs/TestUnits/Replication/Main.py
diff options
context:
space:
mode:
Diffstat (limited to 'Glusterfs/TestUnits/Replication/Main.py')
-rwxr-xr-xGlusterfs/TestUnits/Replication/Main.py93
1 files changed, 93 insertions, 0 deletions
diff --git a/Glusterfs/TestUnits/Replication/Main.py b/Glusterfs/TestUnits/Replication/Main.py
new file mode 100755
index 0000000..fa1888c
--- /dev/null
+++ b/Glusterfs/TestUnits/Replication/Main.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+
+import ATFGlusterVolume
+import ATFClientUtils
+import ATFValidate
+import ATFUtils
+import logging
+
+def test1():
+ """
+ Description: Simple Replication Test
+ Setup::
+ * create export directories export1, export2
+ * create replicate volume with replica = 2 and transport = tcp
+ * start replicate volume
+ * create mount point on the client machine
+ * mount the replicate volume
+
+ Execution:
+ * create a file
+
+ Validation:
+ * Check whether the file is created on export1 and export2
+
+ Expected:
+ * File exists on export1 and export2
+
+ """
+
+ ATFUtils.Logger.debug("Starting TestCase : [Test001]")
+ ATFUtils.Logger.debug("Comment: Basic Replication Test")
+
+ if ATFGlusterVolume.create_exportdirs("export1", "export2", host="host1"):
+ return 1
+
+ if ATFUtils.set_environ(ATF_HOST = "host1"):
+ return 1
+
+ if ATFGlusterVolume.create_volume("volume1", "host1:export1",
+ "host1:export2", voltype = 'replica 2',
+ transport = 'transport tcp'):
+ return 1
+
+ if ATFGlusterVolume.start_volume("volume1"):
+ return 1
+
+ if ATFClientUtils.create_mountpoint("mount1"):
+ return 1
+
+ if ATFClientUtils.mount("mount1", "glusterfs", "host1:volume1"):
+ return 1
+
+ if ATFClientUtils.touch("file1.txt", user = "root"):
+ return 1
+
+ ### Validate ###
+
+ if ATFValidate.validate_replication(f1 = 'host1:export1:file1.txt', f2 = 'host1:export2:file1.txt'):
+ return 1
+
+ return 0
+
+def cleanup():
+ """ Cleanup Phase:
+
+ Description:
+ * Unmount the client mount point
+ * Stop the replicate volume
+ """
+
+ ATFClientUtils.umount("mount1")
+ if ATFGlusterVolume.stop_volume("volume1", host="host1"):
+ return 1
+ return 0
+
+if __name__ == "__main__":
+ main()
+
+
+def main():
+
+ status = 0
+ status = test1()
+ status = cleanup()
+ return status
+
+
+
+
+
+
+
+