summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bug-915280.t
blob: 9fdc48180fc38c6fa2d00635cbe9d5e5ee7787e0 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash

. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
. $(dirname $0)/../nfs.rc

cleanup;

TEST glusterd
TEST pidof glusterd

function volinfo_field()
{
    local vol=$1;
    local field=$2;

    $CLI volume info $vol | grep "^$field: " | sed 's/.*: //';
}

TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2;
EXPECT 'Created' volinfo_field $V0 'Status';

TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';

MOUNTDIR=$N0;
EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
TEST mount_nfs $H0:/$V0 $N0 nolock,timeo=30,retrans=1
TEST touch $N0/testfile

TEST $CLI volume set $V0 debug.error-gen client
TEST $CLI volume set $V0 debug.error-fops stat
TEST $CLI volume set $V0 debug.error-failure 100

EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;

pid_file=$(read_nfs_pidfile);

getfacl $N0/testfile 2>/dev/null

nfs_pid=$(get_nfs_pid);
if [ ! $nfs_pid ]
then
  nfs_pid=0;
fi

TEST [ $nfs_pid -eq $pid_file ]

TEST   umount $MOUNTDIR -l

cleanup;