Skip to content

Commit

Permalink
nfs: Use TST_ALL_FILESYSTEMS=1
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Vorel <pvorel@suse.cz>
  • Loading branch information
pevik committed Jun 9, 2022
1 parent 273d12b commit 3656d03
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions testcases/network/nfs/nfs_stress/nfs_lib.sh
Expand Up @@ -28,7 +28,7 @@ NFS_PARSE_ARGS_CALLER="$TST_PARSE_ARGS"
TST_OPTS="v:t:$TST_OPTS"
TST_PARSE_ARGS=nfs_parse_args
TST_USAGE=nfs_usage
TST_NEEDS_TMPDIR=1
TST_ALL_FILESYSTEMS=1
TST_NEEDS_ROOT=1
TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs"
TST_SETUP="${TST_SETUP:-nfs_setup}"
Expand Down Expand Up @@ -63,7 +63,7 @@ nfs_get_remote_path()
done

v=${1:-$v}
echo "$TST_TMPDIR/$v/$type"
echo "$TST_MNTPOINT/$v/$type"
}

nfs_server_udp_enabled()
Expand Down Expand Up @@ -162,8 +162,8 @@ nfs_setup()
tst_brk TCONF "UDP support disabled on NFS server"
fi

local_dir="$TST_TMPDIR/$i/$n"
remote_dir="$TST_TMPDIR/$i/$type"
local_dir="$TST_MNTPOINT/$i/$n"
remote_dir="$TST_MNTPOINT/$i/$type"
mkdir -p $local_dir

nfs_setup_server $(($$ + n))
Expand All @@ -174,7 +174,7 @@ nfs_setup()
done

if [ "$n" -eq 1 ]; then
cd ${VERSION}/0
cd $TST_MNTPOINT/$VERSION/0
fi
}

Expand All @@ -190,19 +190,35 @@ nfs_cleanup()

local n=0
for i in $VERSION; do
local_dir="$TST_TMPDIR/$i/$n"
grep -q "$local_dir" /proc/mounts && umount $local_dir
type=$(get_socket_type $n)
remote_dir="$TST_MNTPOINT/$i/$type"
tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir"
tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir"
n=$(( n + 1 ))
done

n=0
for i in $VERSION; do
type=$(get_socket_type $n)
remote_dir="$TST_TMPDIR/$i/$type"
tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir"
tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir"
local_dir="$TST_MNTPOINT/$i/$n"

# FIXME: debug
tst_res TINFO "fuser -mv $TST_TMPDIR (\$TST_TMPDIR)"
fuser -mv $TST_TMPDIR

tst_res TINFO "fuser -mv $TST_MNTPOINT (\$TST_MNTPOINT)"
fuser -mv $TST_MNTPOINT

tst_res TINFO "fuser -mv $local_dir"
fuser -mv $local_dir

tst_res TINFO "umount $local_dir"
# FIXME: debug

grep -q "$local_dir" /proc/mounts && umount $local_dir
n=$(( n + 1 ))
done

#systemctl restart nfs-server
}

. tst_net.sh

0 comments on commit 3656d03

Please sign in to comment.