PageRenderTime 32ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh

http://github.com/zfsonlinux/zfs
Korn Shell | 93 lines | 43 code | 12 blank | 38 comment | 5 complexity | ad90d12d4783002f6507742a5f9e0aa1 MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception
  1. #!/bin/ksh -p
  2. #
  3. # CDDL HEADER START
  4. #
  5. # The contents of this file are subject to the terms of the
  6. # Common Development and Distribution License (the "License").
  7. # You may not use this file except in compliance with the License.
  8. #
  9. # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10. # or http://www.opensolaris.org/os/licensing.
  11. # See the License for the specific language governing permissions
  12. # and limitations under the License.
  13. #
  14. # When distributing Covered Code, include this CDDL HEADER in each
  15. # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16. # If applicable, add the following below this CDDL HEADER, with the
  17. # fields enclosed by brackets "[]" replaced with your own identifying
  18. # information: Portions Copyright [yyyy] [name of copyright owner]
  19. #
  20. # CDDL HEADER END
  21. #
  22. #
  23. # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  24. # Use is subject to license terms.
  25. #
  26. #
  27. # Copyright (c) 2012, 2016 by Delphix. All rights reserved.
  28. #
  29. . $STF_SUITE/include/libtest.shlib
  30. . $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
  31. . $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib
  32. #
  33. # DESCRIPTION:
  34. # 'zpool create -O property=value pool' can successfully create a pool
  35. # with correct filesystem property set.
  36. #
  37. # STRATEGY:
  38. # 1. Create a storage pool with -O option
  39. # 2. Verify the pool created successfully
  40. # 3. Verify the filesystem property is correctly set
  41. #
  42. verify_runnable "global"
  43. function cleanup
  44. {
  45. datasetexists $TESTPOOL && destroy_pool $TESTPOOL
  46. }
  47. log_onexit cleanup
  48. log_assert "'zpool create -O property=value pool' can successfully create a pool \
  49. with correct filesystem property set."
  50. set -A RW_FS_PROP "quota=536870912" \
  51. "reservation=536870912" \
  52. "recordsize=262144" \
  53. "mountpoint=/tmp/mnt$$" \
  54. "checksum=fletcher2" \
  55. "compression=lzjb" \
  56. "atime=off" \
  57. "devices=off" \
  58. "exec=off" \
  59. "setuid=off" \
  60. "readonly=on" \
  61. "snapdir=visible" \
  62. "acltype=posixacl" \
  63. "aclinherit=discard" \
  64. "canmount=off"
  65. if is_freebsd; then
  66. RW_FS_PROP+=("jailed=on")
  67. else
  68. RW_FS_PROP+=("zoned=on")
  69. fi
  70. typeset -i i=0
  71. while (( $i < ${#RW_FS_PROP[*]} )); do
  72. log_must zpool create -O ${RW_FS_PROP[$i]} -f $TESTPOOL $DISKS
  73. datasetexists $TESTPOOL || \
  74. log_fail "zpool create $TESTPOOL fail."
  75. propertycheck $TESTPOOL ${RW_FS_PROP[i]} || \
  76. log_fail "${RW_FS_PROP[i]} is failed to set."
  77. log_must zpool destroy $TESTPOOL
  78. (( i = i + 1 ))
  79. done
  80. log_pass "'zpool create -O property=value pool' can successfully create a pool \
  81. with correct filesystem property set."