From a4ea8d54f981d2a5beca215b78939a09f7f3f62a Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 1 Dec 2009 22:22:43 -0800 Subject: Regression testcase for bug 234 Signed-off-by: Vijay Bellur --- 234/regr/spec_files/client1.vol | 33 +++++++++++++++++++++++++++++++++ 234/regr/spec_files/open_dir.c | 21 +++++++++++++++++++++ 234/regr/spec_files/server1.vol | 21 +++++++++++++++++++++ 234/regr/testcase | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 234/regr/spec_files/client1.vol create mode 100644 234/regr/spec_files/open_dir.c create mode 100644 234/regr/spec_files/server1.vol create mode 100755 234/regr/testcase (limited to '234') 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 +#include +#include +#include +#include +#include +#include +#include + +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 -- cgit