From fa8740771e7c82cf0e2e7205d5d7d7ed0e4e71db Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Fri, 27 Nov 2009 03:26:51 -0800 Subject: Regression testcase for bug 250 Signed-off-by: Vijay Bellur --- 250/regr/spec_files/client1.vol | 37 +++++++++++++++++++++++++++++++++++++ 250/regr/spec_files/server1.vol | 34 ++++++++++++++++++++++++++++++++++ 250/regr/spec_files/server2.vol | 34 ++++++++++++++++++++++++++++++++++ 250/regr/spec_files/ss.sh | 8 ++++++++ 250/regr/testcase | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 250/regr/spec_files/client1.vol create mode 100644 250/regr/spec_files/server1.vol create mode 100644 250/regr/spec_files/server2.vol create mode 100755 250/regr/spec_files/ss.sh create mode 100755 250/regr/testcase diff --git a/250/regr/spec_files/client1.vol b/250/regr/spec_files/client1.vol new file mode 100644 index 0000000..dce323a --- /dev/null +++ b/250/regr/spec_files/client1.vol @@ -0,0 +1,37 @@ +# **** Clustered Client config file **** + +### Add client feature and attach to remote subvolume of server1 +volume client1 + type protocol/client + option transport-type tcp # for TCP/IP transport + option remote-host 127.0.0.1 # IP address of the remote brick + option transport.socket.remote-port 7001 # default server port is 6996 + option transport.socket.nodelay on + option remote-subvolume brick1 # name of the remote volume +end-volume + +### Add client feature and attach to remote subvolume of server2 +volume client2 + type protocol/client + option transport-type tcp # for TCP/IP transport + option remote-host 127.0.0.1 # IP address of the remote brick + option transport.socket.remote-port 7002 # default server port is 6996 + option transport.socket.nodelay on + option remote-subvolume brick2 # name of the remote volume +end-volume + +#volume client3 +# type protocol/client +# option transport-type tcp # for TCP/IP transport +# option remote-host 127.0.0.1 # IP address of the remote brick +# option transport.socket.remote-port 6998 # default server port is 6996 +# option transport.socket.nodelay on +# option remote-subvolume brick3 # name of the remote volume +#end-volume + +## Add replicate feature. +volume replicate + type cluster/replicate + subvolumes client1 client2 +end-volume + diff --git a/250/regr/spec_files/server1.vol b/250/regr/spec_files/server1.vol new file mode 100644 index 0000000..6509f87 --- /dev/null +++ b/250/regr/spec_files/server1.vol @@ -0,0 +1,34 @@ +### 'NOTE' +# This file has both server spec and client spec to get an understanding of stripe's spec file. Hence can't be used as it is, as a GlusterFS spec file. +# One need to seperate out server spec and client spec to get it working. + +#========================================================================= + +# **** server1 spec file **** + +### Export volume "brick" with the contents of "/home/export" directory. +volume posix1 + type storage/posix # POSIX FS translator + option directory /root/regression/250/regr/export/export1 +end-volume + +### Add POSIX record locking support to the storage brick +volume brick1 + type features/posix-locks + option mandatory on # enables mandatory locking on all files + subvolumes posix1 +end-volume + +### Add network serving capability to above brick. +volume server + type protocol/server + option transport-type tcp # For TCP/IP transport + option transport.socket.listen-port 7001 # Default is 6996 +# option transport.socket.nodelay on +# option client-volume-filename /etc/glusterfs/glusterfs-client.vol + subvolumes brick1 + option auth.addr.brick1.allow * # access to "brick" volume +end-volume + + +#========================================================================= diff --git a/250/regr/spec_files/server2.vol b/250/regr/spec_files/server2.vol new file mode 100644 index 0000000..aad45ad --- /dev/null +++ b/250/regr/spec_files/server2.vol @@ -0,0 +1,34 @@ +### 'NOTE' +# This file has both server spec and client spec to get an understanding of stripe's spec file. Hence can't be used as it is, as a GlusterFS spec file. +# One need to seperate out server spec and client spec to get it working. + +#========================================================================= + +# **** server2 spec file **** + +### Export volume "brick" with the contents of "/home/export" directory. +volume posix2 + type storage/posix # POSIX FS translator + option directory /root/regression/250/regr/export/export2 +end-volume + +### Add POSIX record locking support to the storage brick +volume brick2 + type features/posix-locks + option mandatory on # enables mandatory locking on all files + subvolumes posix2 +end-volume + +### Add network serving capability to above brick. +volume server + type protocol/server + option transport-type tcp # For TCP/IP transport + option transport.socket.listen-port 7002 # Default is 6996 +# option transport.socket.nodelay on +# option client-volume-filename /etc/glusterfs/glusterfs-client.vol + subvolumes brick2 + option auth.addr.brick2.allow * # access to "brick" volume +end-volume + + +#========================================================================= diff --git a/250/regr/spec_files/ss.sh b/250/regr/spec_files/ss.sh new file mode 100755 index 0000000..39646ea --- /dev/null +++ b/250/regr/spec_files/ss.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +(for j in {1..10} ; do for i in {1..10} ; do touch file$i ; setfattr -n trusted.user -v 2 file$i ; rm file$i ; done ; done)& > /dev/null +PID1=$! + +(for k in {1..1000} ; do getfattr -n trusted.user * ; done) + +kill $PID1 \ No newline at end of file diff --git a/250/regr/testcase b/250/regr/testcase new file mode 100755 index 0000000..ef07872 --- /dev/null +++ b/250/regr/testcase @@ -0,0 +1,33 @@ +#!/bin/bash + +description="# Crash in replicate getxattr " +comments="# When setfattr and getfattr on a set of files are being done simultaneously then whenever getfattr is done on a file not present then the client crashes " + +source ../../init + +start_glusterfs + +sleep 5 + + +cd $MOUNTDIR/client1 + +$SPECDIR/ss.sh 2> $SPECDIR/tmpfile +if [ $(grep "Transport endpoint is not connected" $SPECDIR/tmpfile | wc -l) -ne 0 ]; then + not_ok $description + comment $comments +else + ok $description + comment $comments +fi + +cd - + +rm $SPECDIR/tmpfile + +cleanup_glusterfs + +if [ $(mount | grep "$MOUNTDIR/client1" | wc -l) -ne 0 ]; then + umount $MOUNTDIR/client1 + rm -r $MOUNTDIR +fi \ No newline at end of file -- cgit