nfs02 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #! /bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
  4. # Copyright (c) International Business Machines Corp., 2001
  5. #
  6. # PURPOSE: Tests NFS copy of various filesizes, file consistency
  7. # between copies and preservation of write/nowrite permissions.
  8. #
  9. # Ported by: Robbie Williamson (robbiew@us.ibm.com)
  10. TST_CNT=3
  11. TST_TESTFUNC="do_test"
  12. LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles"
  13. . nfs_lib.sh
  14. do_test1()
  15. {
  16. tst_res TINFO "do_test1 $TC"
  17. ROD cp $LTP_DATAFILES/ascii.jmb .
  18. tst_res TINFO "compare both ascii.jmbs"
  19. ROD diff $LTP_DATAFILES/ascii.jmb ascii.jmb
  20. tst_res TPASS "test1 passed"
  21. }
  22. do_test2()
  23. {
  24. tst_res TINFO "do_test2, copy data files"
  25. local files="ascii.sm ascii.med ascii.lg"
  26. for f in $files; do
  27. tst_res TINFO "copy '$f' file"
  28. ROD cp $LTP_DATAFILES/$f .
  29. ROD cp $f ${f}cp
  30. ROD diff $LTP_DATAFILES/$f ${f}cp
  31. done
  32. tst_res TPASS "test2 passed"
  33. }
  34. do_test3()
  35. {
  36. tst_res TINFO "do_test3, test permissions"
  37. ROD chmod a-wx ascii.sm
  38. ROD ls -l ascii.sm | grep -q "r--"
  39. ROD chmod a+w ascii.sm
  40. tst_res TPASS "test3 passed"
  41. }
  42. tst_run