nfs06 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. TST_TESTFUNC="do_test"
  11. TST_CLEANUP="do_cleanup"
  12. . nfs_lib.sh
  13. THREAD_NUM=${THREAD_NUM:-"2"}
  14. do_cleanup()
  15. {
  16. [ -n "$pids" ] && kill -9 $pids
  17. nfs_cleanup
  18. }
  19. do_test()
  20. {
  21. tst_res TINFO "Starting fsstress processes on NFS mounts"
  22. local n=0
  23. local pids
  24. for i in $VERSION; do
  25. fsstress -l 1 -d $TST_TMPDIR/$i/$n -n 1000 -p $THREAD_NUM -r -c > /dev/null &
  26. pids="$pids $!"
  27. n=$(( n + 1 ))
  28. done
  29. tst_res TINFO "waiting for pids:$pids"
  30. for p in $pids; do
  31. wait $p || tst_brk TFAIL "fsstress process failed"
  32. tst_res TINFO "fsstress '$p' completed"
  33. done
  34. pids=
  35. tst_res TPASS "all fsstress processes completed on '$n' NFS mounts"
  36. }
  37. tst_run