summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2009-12-01 22:22:43 -0800
committerVijay Bellur <vijay@gluster.com>2010-01-26 21:11:31 +0530
commita4ea8d54f981d2a5beca215b78939a09f7f3f62a (patch)
treef63e3991c4c15f7bf7882ebb206ac50260849554
parent0da4ccb80b36394ac144b5ed7c6c0b3db3bc0566 (diff)
Regression testcase for bug 234
Signed-off-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--234/regr/spec_files/client1.vol33
-rw-r--r--234/regr/spec_files/open_dir.c21
-rw-r--r--234/regr/spec_files/server1.vol21
-rwxr-xr-x234/regr/testcase36
4 files changed, 111 insertions, 0 deletions
diff --git a/234/regr/spec_files/client1.vol b/234/regr/spec_files/client1.vol
new file mode 100644
index 0000000..8e1bc27
--- /dev/null
+++ b/234/regr/spec_files/client1.vol
@@ -0,0 +1,33 @@
+volume client
+ type protocol/client
+ option transport-type tcp
+ option remote-host 127.0.0.1 # IP address of the remote brick
+ option transport.socket.remote-port 7003 # default server port is 6996
+# option transport-timeout 30 # seconds to wait for a reply from server for each request
+ option remote-subvolume brick # name of the remote volume
+end-volume
+
+### Add readahead feature
+volume readahead
+ type performance/read-ahead
+ option page-size 1MB # unit in bytes
+ option page-count 2 # cache per file = (page-count x page-size)
+ subvolumes client
+end-volume
+
+### Add IO-Cache feature
+volume iocache
+ type performance/io-cache
+ option page-size 256KB
+ option page-count 2
+ subvolumes readahead
+end-volume
+
+### Add writeback feature
+volume writeback
+ type performance/write-behind
+ option aggregate-size 1MB
+ option window-size 2MB
+ option flush-behind off
+ subvolumes client
+end-volume
diff --git a/234/regr/spec_files/open_dir.c b/234/regr/spec_files/open_dir.c
new file mode 100644
index 0000000..81c8d7d
--- /dev/null
+++ b/234/regr/spec_files/open_dir.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+
+int main(int argc, char *argv[])
+{
+ DIR *dir;
+ dir = opendir(argv[1]);
+ if ( dir == NULL ) {
+ return errno;
+ }
+ else {
+ closedir(dir);
+ return 0;
+ }
+}
diff --git a/234/regr/spec_files/server1.vol b/234/regr/spec_files/server1.vol
new file mode 100644
index 0000000..29541eb
--- /dev/null
+++ b/234/regr/spec_files/server1.vol
@@ -0,0 +1,21 @@
+###posix translator####
+volume posix1
+ type storage/posix # POSIX FS translator
+ option directory /root/regression/234/regr/export/export1 # Export this directory
+end-volume
+
+### threads handled by the server
+volume brick
+ type performance/io-threads
+ option thread-count 8
+ subvolumes posix1
+end-volume
+
+### Add network serving capability to above brick.
+volume server
+ type protocol/server
+ option transport-type tcp
+ option transport.socket.listen-port 7003 # Default is 6996
+ subvolumes brick
+ option auth.addr.brick.allow * # Allow access to "brick" volume
+end-volume
diff --git a/234/regr/testcase b/234/regr/testcase
new file mode 100755
index 0000000..96987b5
--- /dev/null
+++ b/234/regr/testcase
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+description="# opendir system call on a symbolic link to a directory fails"
+comments="# When opendir() system call is executed on a symbolic link to a directory, it gives an error"
+
+source ../../init
+
+start_glusterfs --no-clients
+
+sleep 5
+
+gcc $SPECDIR/open_dir.c -o $SPECDIR/opendir
+
+mkdir $EXPORTDIR/export1/imp/
+ln -s $EXPORTDIR/export1/imp/ $EXPORTDIR/export1/link
+
+echo "$SPECDIR/client1.vol $MOUNTDIR/client1 glusterfs subvolume=client,logfile=$LOGDIR/clog,loglevel=DEBUG" > $SPECDIR/booster.conf
+export GLUSTERFS_BOOSTER_FSTAB=$SPECDIR/booster.conf
+export LD_PRELOAD=$(dirname $GLUSTERFSDIR)/lib/glusterfs/glusterfs-booster.so
+
+$SPECDIR/opendir $MOUNTDIR/client1/imp
+$SPECDIR/opendir $MOUNTDIR/client1/link
+
+if [ $? -ne 0 ]; then
+ not_ok $description
+ comment $comments
+else
+ ok $description
+ comment $comments
+fi
+
+rm $SPECDIR/opendir $SPECDIR/booster.conf
+GLUSTERFS_BOOSTER_FSTAB=
+LD_PRELOAD=
+
+cleanup_glusterfs \ No newline at end of file