summaryrefslogtreecommitdiffstats
path: root/234/regr/testcase
blob: 96987b5ed65a6d85768bbf98353b62cb3ccfe839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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