diff options
author | Kotresh HR <khiremat@redhat.com> | 2015-05-28 19:26:00 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-11-27 01:32:08 -0800 |
commit | 9cbe0fa66c264b6afe295c32d2bae29411d01756 (patch) | |
tree | 12659a5d4f67a0985f4a046654672e8c19736480 /tests/geo-rep/compare-gfid.py | |
parent | 391e78cbaa727bdd274cf84d1d9683613c8cab6c (diff) |
tests: New simple geo-rep regression test suite
This is a new simple regression test suite for
geo-replication. This is written keeping in mind
the run time for regression test. The existing
regression test suite is rigorous one and could
be run nightly. Hence the existing geo-rep tests
are being removed as part of this.
Also re-enable geo-rep regression with this patch.
Thanks Aravinda for initial template and plan.
BUG: 1284746
Change-Id: I9eea88c267d9e838022b7c9201e2ba4bb04f612e
Reviewed-on: http://review.gluster.org/11058
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12726
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'tests/geo-rep/compare-gfid.py')
-rw-r--r-- | tests/geo-rep/compare-gfid.py | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/tests/geo-rep/compare-gfid.py b/tests/geo-rep/compare-gfid.py deleted file mode 100644 index 432c1d77f31..00000000000 --- a/tests/geo-rep/compare-gfid.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/python - -# Most of this script was written by M S Vishwanath Bhat (vbhat@redhat.com) - -import re -import os -import sys -import xattr -import tempfile - - -def parse_url(url): - match = re.search(r'([\w - _ @ \.]+)::([\w - _ @ \.]+)', url) - if match: - node = match.group(1) - vol = match.group(2) - else: - print 'given url is not a valid url.' - sys.exit(1) - return node, vol - - -def cleanup(master_mnt, slave_mnt): - try: - os.system("umount %s" % (master_mnt)) - except: - print("Failed to unmount the master volume") - try: - os.system("umount %s" % (slave_mnt)) - except: - print("Failed to unmount the slave volume") - - os.removedirs(master_mnt) - os.removedirs(slave_mnt) - - -def main(): - - masterurl = sys.argv[1] - slaveurl = sys.argv[2] - slave_node, slavevol = parse_url(slaveurl) - master_node, mastervol = parse_url(masterurl) - - master_mnt = tempfile.mkdtemp() - slave_mnt = tempfile.mkdtemp() - - try: - print "Mounting master volume on a temp mnt_pnt" - os.system("glusterfs -s %s --volfile-id %s %s" % (master_node, - mastervol, - master_mnt)) - except: - print("Failed to mount the master volume") - cleanup(master_mnt, slave_mnt) - sys.exit(1) - - try: - print "Mounting slave voluem on a temp mnt_pnt" - os.system("glusterfs -s %s --volfile-id %s %s" % (slave_node, slavevol, - slave_mnt)) - except: - print("Failed to mount the master volume") - cleanup(master_mnt, slave_mnt) - sys.exit(1) - - slave_file_list = [slave_mnt] - for top, dirs, files in os.walk(slave_mnt, topdown=False): - for subdir in dirs: - slave_file_list.append(os.path.join(top, subdir)) - for file in files: - slave_file_list.append(os.path.join(top, file)) - - # chdir and then get the gfid, so that you don't need to replace - gfid_attr = 'glusterfs.gfid' - ret = 0 - for sfile in slave_file_list: - mfile = sfile.replace(slave_mnt, master_mnt) - if xattr.getxattr(sfile, gfid_attr, True) != xattr.getxattr( - mfile, gfid_attr, True): - print ("gfid of file %s in slave is different from %s" + - " in master" % (sfile, mfile)) - ret = 1 - - cleanup(master_mnt, slave_mnt) - - sys.exit(ret) - - -if __name__ == '__main__': - if len(sys.argv[1:]) < 2: - print ("Please pass master volume name and slave url as arguments") - print ("USAGE : python <script> <master-host>::<master-vol> " + - "<slave-host>::<slave-vol>") - sys.exit(1) - main() |