summaryrefslogtreecommitdiffstats
path: root/tests/nfs.rc
blob: 4b4a55e19e9afcef739989144946227a92e2251d (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
#!/bin/bash


# Due to portmap registration NFS takes some time to
# export all volumes. Therefore tests should start only
# after exports are visible by showmount command. This
# routine will check if showmount shows the exports or not
#
function is_nfs_export_available ()
{
        vol=$1

        if [ "$vol" == "" ]; then
                vol=$V0
        fi

        exp=$(showmount -e 2> /dev/null | grep $vol | wc -l)
        echo "$exp"
}

function mount_nfs ()
{
        local e=$1
        local m=$2
        local opt=$3
        if [ ! -z "$opt" ]; then opt=",$opt"; fi
        mount -t nfs -o soft,intr,vers=3"$opt" $e $m
}

function umount_nfs ()
{
        umount -f $1
        if [ $? -eq 0 ]; then echo "Y"; else echo "N"; fi
}