• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
4# Copyright (c) International Business Machines  Corp., 2003
5#
6#  PURPOSE: Runs fsstress over an NFS mount point for a specified amount
7#           of time. The purpose of this test is to stress the NFS kernel
8#           code and possibly the underlying filesystem where the export
9#           resides.  A PASS is if the test completes.
10
11TST_TESTFUNC="do_test"
12TST_CLEANUP="do_cleanup"
13
14THREAD_NUM=${THREAD_NUM:-"2"}
15
16do_cleanup()
17{
18	[ -n "$pids" ] && kill -9 $pids
19	nfs_cleanup
20}
21
22do_test()
23{
24	tst_res TINFO "Starting fsstress processes on NFS mounts"
25
26	local n=0
27	local pids
28	for i in $VERSION; do
29		fsstress -l 1 -d $TST_TMPDIR/$i/$n -n 1000 -p $THREAD_NUM -r -c > /dev/null &
30		pids="$pids $!"
31		n=$(( n + 1 ))
32	done
33
34	tst_res TINFO "waiting for pids:$pids"
35	for p in $pids; do
36		wait $p || tst_brk TFAIL "fsstress process failed"
37		tst_res TINFO "fsstress '$p' completed"
38	done
39	pids=
40
41	tst_res TPASS "all fsstress processes completed on '$n' NFS mounts"
42}
43
44. nfs_lib.sh
45tst_run
46