/tests/zfs-tests/tests/functional/casenorm/insensitive_none_delete.ksh

https://github.com/adilger/zfs · Korn Shell · 71 lines · 35 code · 11 blank · 25 comment · 8 complexity · 2864e839885d0b3c70d9f6e55258a31d MD5 · raw file

  1. #!/bin/ksh -p
  2. #
  3. #
  4. # This file and its contents are supplied under the terms of the
  5. # Common Development and Distribution License ("CDDL"), version 1.0.
  6. # You may only use this file in accordance with the terms of version
  7. # 1.0 of the CDDL.
  8. #
  9. # A full copy of the text of the CDDL should have accompanied this
  10. # source. A copy of the CDDL is also available via the Internet at
  11. # http://www.illumos.org/license/CDDL.
  12. #
  13. #
  14. # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  15. #
  16. . $STF_SUITE/tests/functional/casenorm/casenorm.kshlib
  17. # DESCRIPTION:
  18. # For the filesystem with casesensitivity=insensitive, normalization=none,
  19. # check that delete succeeds if (norm=same).
  20. #
  21. # STRATEGY:
  22. # For each c/n name form:
  23. # 1. Create file with given c/n name form.
  24. # 2. Check that delete succeeds if (norm=same).
  25. # 3. Check that file is no longer accessible using any name form.
  26. # 4. Check that delete fails if (norm=other).
  27. verify_runnable "global"
  28. function cleanup
  29. {
  30. destroy_testfs
  31. }
  32. log_onexit cleanup
  33. log_assert "CI-not-UN FS: delete succeeds if (norm=same)"
  34. create_testfs "-o casesensitivity=insensitive -o normalization=none"
  35. for name1 in $NAMES_C ; do
  36. for name2 in $NAMES_C ; do
  37. log_must create_file $name1
  38. log_must delete_file $name2
  39. log_mustnot lookup_any
  40. done
  41. for name2 in $NAMES_D ; do
  42. log_must create_file $name1
  43. log_mustnot delete_file $name2
  44. delete_file $name1
  45. done
  46. done
  47. for name1 in $NAMES_D ; do
  48. for name2 in $NAMES_D ; do
  49. log_must create_file $name1
  50. log_must delete_file $name2
  51. log_mustnot lookup_any
  52. done
  53. for name2 in $NAMES_C ; do
  54. log_must create_file $name1
  55. log_mustnot delete_file $name2
  56. delete_file $name1
  57. done
  58. done
  59. destroy_testfs
  60. log_pass "CI-not-UN FS: delete succeeds if (norm=same)"