PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/sys/cddl/zfs/tests/slog/slog_010_neg.ksh

https://bitbucket.org/freebsd/freebsd-base
Korn Shell | 78 lines | 17 code | 9 blank | 52 comment | 0 complexity | e74135a57c45a869bbb327234d8f45ae MD5 | raw file
  1. #!/usr/local/bin/ksh93 -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. # $FreeBSD$
  23. #
  24. # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
  25. # Use is subject to license terms.
  26. #
  27. # ident "@(#)slog_010_neg.ksh 1.1 07/07/31 SMI"
  28. #
  29. . $STF_SUITE/tests/slog/slog.kshlib
  30. #################################################################################
  31. #
  32. # __stc_assertion_start
  33. #
  34. # ID: slog_010_neg
  35. #
  36. # DESCRIPTION:
  37. # Slog device can not be replaced with spare device
  38. #
  39. # STRATEGY:
  40. # 1. Create a pool with hotspare and log devices.
  41. # 2. Verify slog device can not be replaced with hotspare device.
  42. # 3. Create pool2 with hotspare
  43. # 4. Verify slog device can not be replaced with hotspare device in pool2.
  44. #
  45. # TESTABILITY: explicit
  46. #
  47. # TEST_AUTOMATION_LEVEL: automated
  48. #
  49. # CODING_STATUS: COMPLETED (2007-06-20)
  50. #
  51. # __stc_assertion_end
  52. #
  53. ################################################################################
  54. verify_runnable "global"
  55. log_assert "Slog device can not be replaced with spare device."
  56. log_onexit cleanup
  57. log_must $ZPOOL create $TESTPOOL $VDEV spare $SDEV log $LDEV
  58. sdev=$(random_get $SDEV)
  59. ldev=$(random_get $LDEV)
  60. log_mustnot $ZPOOL replace $TESTPOOL $ldev $sdev
  61. log_mustnot verify_slog_device $TESTPOOL $sdev 'ONLINE'
  62. log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
  63. log_must $ZPOOL create $TESTPOOL2 $VDEV2 spare $SDEV2
  64. sdev2=$(random_get $SDEV2)
  65. log_mustnot $ZPOOL replace $TESTPOOL $ldev $sdev2
  66. log_mustnot $ZPOOL replace -f $TESTPOOL $ldev $sdev2
  67. log_mustnot verify_slog_device $TESTPOOL $sdev2 'ONLINE'
  68. log_must verify_slog_device $TESTPOOL $ldev 'ONLINE'
  69. log_pass "Slog device can not be replaced with spare device."