From e780df78fae4f69923df20c14f15b66dc918a61b Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 20 Dec 2013 15:43:08 +0530 Subject: tests: Add sanity check for mount-options Change-Id: Ica246f99b8cdb6c0cf0e9143f50be056e37d3b7f BUG: 1045309 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/6550 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/basic/mount-options.t | 140 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 tests/basic/mount-options.t (limited to 'tests/basic') diff --git a/tests/basic/mount-options.t b/tests/basic/mount-options.t new file mode 100644 index 000000000..1762823d7 --- /dev/null +++ b/tests/basic/mount-options.t @@ -0,0 +1,140 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +TEST glusterd --xlator-option=*.rpc-auth-allow-insecure=on +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3,4,5} +TEST $CLI volume set $V0 server.allow-insecure on +TEST $CLI volume start $V0 + +#test all the options available to see if the mount succeeds with those options +#or not. This does not test functionality. This is added to prevent options +#being removed in future breaking backward-compatibility. + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --entry-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile=/var/lib/glusterd/vols/$V0/${V0}-fuse.vol $M0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 --log-file=/tmp/a.txt --log-level=DEBUG $M0 +EXPECT_NOT "0" wc -l /tmp/a.txt +TEST grep " D " /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --acl +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --enable-ino32 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --read-only +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --selinux +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --worm +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-check +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --dump-fuse=/tmp/a.txt +EXPECT_NOT "0" wc -l /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=-1 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=abc + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=16 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=abc + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=12 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=abc + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion=threshold=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=10 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=abc +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --pid-file=/tmp/a.txt +EXPECT_NOT "0" wc -l /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=24007 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=2400 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=tcp +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=ib-verbs +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=socket + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=$V0 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=abcd + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option=abc +cleanup; -- cgit From 3395b98a341228e89cf0a88e0d86c90117dbb285 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 30 Jan 2014 22:27:24 +0530 Subject: tests: Fix regression failures Change-Id: I83dc651a5ce87adf51d1f539400cd91c801fc460 BUG: 1045309 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/6874 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Pranith Kumar Karampuri --- tests/basic/mount-options.t | 2 +- tests/basic/mount.t | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/mount-options.t b/tests/basic/mount-options.t index 1762823d7..86d945ac5 100644 --- a/tests/basic/mount-options.t +++ b/tests/basic/mount-options.t @@ -79,7 +79,7 @@ TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-check TEST umount -l $M0 TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --dump-fuse=/tmp/a.txt -EXPECT_NOT "0" wc -l /tmp/a.txt +EXPECT "0" stat /tmp/a.txt TEST rm -f /tmp/a.txt TEST umount -l $M0 diff --git a/tests/basic/mount.t b/tests/basic/mount.t index 90e522c5e..4197a97da 100755 --- a/tests/basic/mount.t +++ b/tests/basic/mount.t @@ -1,6 +1,7 @@ #!/bin/bash . $(dirname $0)/../include.rc +. $(dirname $0)/../nfs.rc cleanup; @@ -49,7 +50,11 @@ TEST 'mount -t fuse.glusterfs | grep -E "^$H0:$V0 .+ \(ro,"'; TEST 'grep -E "^$H0:$V0 .+ ,?ro,.+" /proc/mounts'; ## Wait for volume to register with rpc.mountd -sleep 5; +EXPECT_WITHIN 20 "1" is_nfs_export_available; + +## HACK: mount seems to require about 40 seconds more to be successful, +## sleep 40 is an interim fix till we root cause the underlying issue. +sleep 40 ## Mount NFS TEST mount -t nfs -o nolock,soft,intr $H0:/$V0 $N0; -- cgit From b187d3b5231406b524bf73b45f76e001692e282e Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 5 Feb 2014 21:50:20 +0530 Subject: tests/basic: Prevent mount-options.t from being run. mount-options.t introduces a race leading to failures in regression tests. Hence disabling the test unit till we sort out the race. Also removing the workaround introduced in mount.t. Change-Id: I7d60413bbff8597f90153cca838e326247e96cd9 BUG: 1060654 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/6911 Reviewed-by: Kaleb KEITHLEY Tested-by: Gluster Build System --- tests/basic/mount-options.disabled | 140 +++++++++++++++++++++++++++++++++++++ tests/basic/mount-options.t | 140 ------------------------------------- tests/basic/mount.t | 4 -- 3 files changed, 140 insertions(+), 144 deletions(-) create mode 100644 tests/basic/mount-options.disabled delete mode 100644 tests/basic/mount-options.t (limited to 'tests/basic') diff --git a/tests/basic/mount-options.disabled b/tests/basic/mount-options.disabled new file mode 100644 index 000000000..86d945ac5 --- /dev/null +++ b/tests/basic/mount-options.disabled @@ -0,0 +1,140 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +TEST glusterd --xlator-option=*.rpc-auth-allow-insecure=on +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3,4,5} +TEST $CLI volume set $V0 server.allow-insecure on +TEST $CLI volume start $V0 + +#test all the options available to see if the mount succeeds with those options +#or not. This does not test functionality. This is added to prevent options +#being removed in future breaking backward-compatibility. + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --entry-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile=/var/lib/glusterd/vols/$V0/${V0}-fuse.vol $M0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 --log-file=/tmp/a.txt --log-level=DEBUG $M0 +EXPECT_NOT "0" wc -l /tmp/a.txt +TEST grep " D " /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --acl +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --enable-ino32 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=yes +TEST umount -l $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=no +TEST umount -l $M0 +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=fail + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --read-only +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --selinux +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --worm +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-check +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --dump-fuse=/tmp/a.txt +EXPECT "0" stat /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=0 +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=-1 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=abc + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=16 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=abc + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=12 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=abc + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion=threshold=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=10 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=abc +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=-1 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --pid-file=/tmp/a.txt +EXPECT_NOT "0" wc -l /tmp/a.txt +TEST rm -f /tmp/a.txt +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=24007 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=2400 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=tcp +TEST umount -l $M0 + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=ib-verbs +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=socket + +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=$V0 +TEST umount -l $M0 + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=abcd + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option + +TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option=abc +cleanup; diff --git a/tests/basic/mount-options.t b/tests/basic/mount-options.t deleted file mode 100644 index 86d945ac5..000000000 --- a/tests/basic/mount-options.t +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../include.rc -. $(dirname $0)/../volume.rc - -cleanup; - -TEST glusterd --xlator-option=*.rpc-auth-allow-insecure=on -TEST pidof glusterd -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3,4,5} -TEST $CLI volume set $V0 server.allow-insecure on -TEST $CLI volume start $V0 - -#test all the options available to see if the mount succeeds with those options -#or not. This does not test functionality. This is added to prevent options -#being removed in future breaking backward-compatibility. - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --entry-timeout=0 -TEST umount -l $M0 - -TEST glusterfs --volfile=/var/lib/glusterd/vols/$V0/${V0}-fuse.vol $M0 -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 --log-file=/tmp/a.txt --log-level=DEBUG $M0 -EXPECT_NOT "0" wc -l /tmp/a.txt -TEST grep " D " /tmp/a.txt -TEST rm -f /tmp/a.txt -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --acl -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --enable-ino32 -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=yes -TEST umount -l $M0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=no -TEST umount -l $M0 -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --fopen-keep-cache=fail - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=yes -TEST umount -l $M0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=no -TEST umount -l $M0 -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --mac-compat=fail - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=yes -TEST umount -l $M0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=no -TEST umount -l $M0 -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --use-readdirp=fail - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=yes -TEST umount -l $M0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=no -TEST umount -l $M0 -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --direct-io-mode=fail - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --read-only -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --selinux -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --worm -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-check -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --dump-fuse=/tmp/a.txt -EXPECT "0" stat /tmp/a.txt -TEST rm -f /tmp/a.txt -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=0 -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=-1 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --gid-timeout=abc - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=16 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=abc - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --background-qlen=-1 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=12 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion-threshold=abc - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --congestion=threshold=-1 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=10 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=abc -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --negative-timeout=-1 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --pid-file=/tmp/a.txt -EXPECT_NOT "0" wc -l /tmp/a.txt -TEST rm -f /tmp/a.txt -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=24007 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=2400 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=tcp -TEST umount -l $M0 - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-transport=ib-verbs -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volfile-server-port=socket - -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=$V0 -TEST umount -l $M0 - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --volume-name=abcd - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option - -TEST ! glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --invalid-option=abc -cleanup; diff --git a/tests/basic/mount.t b/tests/basic/mount.t index 4197a97da..8163975d6 100755 --- a/tests/basic/mount.t +++ b/tests/basic/mount.t @@ -52,10 +52,6 @@ TEST 'grep -E "^$H0:$V0 .+ ,?ro,.+" /proc/mounts'; ## Wait for volume to register with rpc.mountd EXPECT_WITHIN 20 "1" is_nfs_export_available; -## HACK: mount seems to require about 40 seconds more to be successful, -## sleep 40 is an interim fix till we root cause the underlying issue. -sleep 40 - ## Mount NFS TEST mount -t nfs -o nolock,soft,intr $H0:/$V0 $N0; -- cgit From 97ce783de326b51fcba65737f07db2c314d1e218 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 6 Feb 2014 13:03:58 +0530 Subject: glusterd: Volume locks and transaction specific opinfos With this patch we are replacing the existing cluster-wide lock taken on glusterds across the cluster, with volume locks which are also taken on glusterds across the cluster, but are volume specific. So with the volume locks we are able to perform more than one gluster operation at the same time, as long as the operations are being performed on different volumes. We maintain a global list of volume-locks (using a dict for a list) where the key is the volume name, and which saves the uuid of the originator glusterd. These locks are held and released per volume transaction. In order to acheive multiple gluster operations occuring at the same time, we also separate opinfos in the op-state-machine, as a part of this patch. To do so, we generate a unique transaction-id (uuid) per gluster transaction. An opinfo is then associated with this transaction id, which is used throughout the transaction. We maintain a run-time global list(using a dict) of transaction-ids, and their respective opinfos to achieve this. Upstream Feature Page: http://www.gluster.org/community/documentation/index.php/Features/glusterd-volume-locks Change-Id: Iaad505a854bac8de8f83beec0357eb6cde3f7ea8 BUG: 1011470 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/5994 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/basic/volume-locks.t | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100755 tests/basic/volume-locks.t (limited to 'tests/basic') diff --git a/tests/basic/volume-locks.t b/tests/basic/volume-locks.t new file mode 100755 index 000000000..b9e94b7e1 --- /dev/null +++ b/tests/basic/volume-locks.t @@ -0,0 +1,106 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../cluster.rc + +function check_peers { + $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l +} + +function volume_count { + local cli=$1; + if [ $cli -eq '1' ] ; then + $CLI_1 volume info | grep 'Volume Name' | wc -l; + else + $CLI_2 volume info | grep 'Volume Name' | wc -l; + fi +} + +function volinfo_field() +{ + local vol=$1; + local field=$2; + + $CLI_1 volume info $vol | grep "^$field: " | sed 's/.*: //'; +} + +function two_diff_vols_create { + # Both volume creates should be successful + $CLI_1 volume create $V0 $H1:$B1/$V0 $H2:$B2/$V0 $H3:$B3/$V0 & + $CLI_2 volume create $V1 $H1:$B1/$V1 $H2:$B2/$V1 $H3:$B3/$V1 +} + +function two_diff_vols_start { + # Both volume starts should be successful + $CLI_1 volume start $V0 & + $CLI_2 volume start $V1 +} + +function two_diff_vols_stop_force { + # Force stop, so that if rebalance from the + # remove bricks is in progress, stop can + # still go ahead. Both volume stops should + # be successful + $CLI_1 volume stop $V0 force & + $CLI_2 volume stop $V1 force +} + +function same_vol_remove_brick { + + # Running two same vol commands at the same time can result in + # two success', two failures, or one success and one failure, all + # of which are valid. The only thing that shouldn't happen is a + # glusterd crash. + + local vol=$1 + local brick=$2 + $CLI_1 volume remove-brick $1 $2 start & + $CLI_2 volume remove-brick $1 $2 start +} + +cleanup; + +TEST launch_cluster 3; +TEST $CLI_1 peer probe $H2; +TEST $CLI_1 peer probe $H3; + +EXPECT_WITHIN 20 2 check_peers + +two_diff_vols_create +EXPECT 'Created' volinfo_field $V0 'Status'; +EXPECT 'Created' volinfo_field $V1 'Status'; + +two_diff_vols_start +EXPECT 'Started' volinfo_field $V0 'Status'; +EXPECT 'Started' volinfo_field $V1 'Status'; + +same_vol_remove_brick $V0 $H2:$B2/$V0 +# Checking glusterd crashed or not after same volume remove brick +# on both nodes. +EXPECT_WITHIN 20 2 check_peers + +same_vol_remove_brick $V1 $H2:$B2/$V1 +# Checking glusterd crashed or not after same volume remove brick +# on both nodes. +EXPECT_WITHIN 20 2 check_peers + +$CLI_1 volume set $V0 diagnostics.client-log-level DEBUG & +$CLI_1 volume set $V1 diagnostics.client-log-level DEBUG +kill_glusterd 3 +$CLI_1 volume status $V0 +$CLI_2 volume status $V1 +$CLI_1 peer status +EXPECT_WITHIN 20 1 check_peers +EXPECT 'Started' volinfo_field $V0 'Status'; +EXPECT 'Started' volinfo_field $V1 'Status'; + +TEST $glusterd_3 +$CLI_1 volume status $V0 +$CLI_2 volume status $V1 +$CLI_1 peer status +#EXPECT_WITHIN 20 2 check_peers +#EXPECT 'Started' volinfo_field $V0 'Status'; +#EXPECT 'Started' volinfo_field $V1 'Status'; +#two_diff_vols_stop_force +#EXPECT_WITHIN 20 2 check_peers +cleanup; -- cgit