Permalink
Browse files

I have ported clean mirror script with README.

  • Loading branch information...
vikramjadhav committed Nov 30, 2010
1 parent 4df1327 commit 5df99870d129d064fbc8b90eac934143baf59cd5
Showing with 1,229 additions and 0 deletions.
  1. +59 −0 ZFS-Test_Suite/tests/functional/clean_mirror/#setup.ksh#
  2. +1 −0 ZFS-Test_Suite/tests/functional/clean_mirror/.#setup.ksh
  3. +42 −0 ZFS-Test_Suite/tests/functional/clean_mirror/Makefile
  4. +37 −0 ZFS-Test_Suite/tests/functional/clean_mirror/README
  5. +74 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/#clean_mirror_001_pos.ksh#
  6. +1 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/.#clean_mirror_001_pos.ksh
  7. +51 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/Makefile
  8. +74 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/clean_mirror_001_pos.ksh
  9. +73 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/clean_mirror_001_pos.ksh~
  10. +51 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/Makefile
  11. +72 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/clean_mirror_002_pos.ksh
  12. +65 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/clean_mirror_002_pos.ksh~
  13. BIN ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/s1
  14. +51 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/Makefile
  15. +71 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/clean_mirror_003_pos.ksh
  16. +65 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/clean_mirror_003_pos.ksh~
  17. BIN ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/s0
  18. +51 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/Makefile
  19. +72 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/clean_mirror_004_pos.ksh
  20. +65 −0 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/clean_mirror_004_pos.ksh~
  21. BIN ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/s1
  22. +75 −0 ZFS-Test_Suite/tests/functional/clean_mirror/clean_mirror_common.kshlib
  23. +49 −0 ZFS-Test_Suite/tests/functional/clean_mirror/cleanup.ksh
  24. +71 −0 ZFS-Test_Suite/tests/functional/clean_mirror/default.cfg
  25. +59 −0 ZFS-Test_Suite/tests/functional/clean_mirror/setup.ksh
@@ -0,0 +1,59 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)setup.ksh 1.5 09/01/13 SMI"
+#
+
+
+DISKS="$@"
+
+. $STF_SUITE/commands.cfg
+. $STF_SUITE/include/libtest.kshlib
+#. $STF_SUITE/default.cfg
+. $STF_SUITE/include/default_common_varible.kshlib
+. ./default.cfg
+
+
+#verify_runnable "global"
+
+#if ! $(is_physical_device $DISKS) ; then
+# log_unsupported "This directory cannot be run on raw files."
+#fi
+
+if [[ -n $SINGLE_DISK ]]; then
+ log_note "Partitioning a single disk ($SINGLE_DISK)"
+else
+ log_note "Partitioning disks ($MIRROR_PRIMARY $MIRROR_SECONDARY)"
+fi
+
+
+
+
+#log_must set_partition ${SIDE_PRIMARY##*s} "" $MIRROR_SIZE $MIRROR_PRIMARY
+#log_must set_partition ${SIDE_SECONDARY##*s} "" $MIRROR_SIZE $MIRROR_SECONDARY
+
+default_mirror_setup $SIDE_PRIMARY $SIDE_SECONDARY
+log_pass
@@ -0,0 +1,42 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)Makefile 1.3 07/02/06 SMI"
+#
+STF_EXECUTABLES=setup cleanup
+
+STF_ENVFILES=default.cfg
+
+STF_INCLUDES=clean_mirror_common.kshlib
+
+SUBDIRS :sh = /bin/ls -d assertion_*
+
+STF_BUILD_SUBDIRS=$(SUBDIRS)
+
+STF_EXECUTE_SUBDIRS=$(SUBDIRS)
+
+STF_DONTBUILDMODES=true
+
+include ${STF_TOOLS}/Makefiles/Makefile.master
@@ -0,0 +1,37 @@
+Steps to execute script:
+
+1. Run setup file first
+ cd clean_mirror
+ $setup.ksh Primary_physical_device Secondary_physical_device
+
+ Imp Note :
+ In setup.ksh instead of using side primary and side secondary partion of disk Mirror primary and Mirror Secondary.
+ we using Mirror primary and Mirror secondary as it is /dev/sda(primary_physical_device) /dev/sdb(device2)
+ Partition done in
+ set_partition ${SIDE_PRIMARY##*s} "" $MIRROR_SIZE $MIRROR_PRIMARY
+ set_partition ${SIDE_SECONDARY##*s} "" $MIRROR_SIZE $MIRROR_SECONDARY
+ Additional part need to be update.
+
+
+
+
+2. cd assertion_001
+ $./clean_mirror_001_pos.ksh Primary_physical_device
+ #The primary side of a zpool mirror can be zeroed without causing damage to the data in the pool
+
+3. cd assertion_002
+ $./clean_mirror_002_pos.ksh Secondary_physical_device
+
+4. cd assertion_003
+ $./clean_mirror_003_pos.ksh Primary_physical_device
+
+5. cd assertion_004
+ $./clean_mirror_004_pos.ksh Secondary_physical_device
+
+6. $cleanup.ksh Primary_physical_device Secondary_physical_device
+
+
+
+
+
+
@@ -0,0 +1,74 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)clean_mirror_001_pos.ksh 1.2 07/01/09 SMI"
+#
+
+
+DISKS="$@"
+. $STF_SUITE/commands.cfg
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/include/default_common_varible.kshlib
+. ../default.cfg
+. $STF_SUITE/tests/functional/clean_mirror/clean_mirror_common.kshlib
+
+FILE_WRITE=$STF_SUITE/bin/file_write
+
+
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: clean_mirror_001_pos
+#
+# DESCRIPTION:
+# The primary side of a zpool mirror can be zeroed without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem mirror
+# 2) dd from /dev/zero over the primary side of the mirror
+# 3) verify that all the file contents are unchanged on the file system
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2005-07-04)
+#
+# __stc_assertion_end
+#
+################################################################################
+
+verify_runnable "global"
+
+log_assert "The primary side of a zpool mirror may be completely wiped" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_PRIMARY /dev/zero
+
+log_pass "The overwrite had no effect on the data"
@@ -0,0 +1,51 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)Makefile 1.3 07/02/06 SMI"
+#
+
+STF_USER_CONFIGURE=
+STF_ROOT_CONFIGURE=
+
+STF_ROOT_SETUP=setup
+STF_USER_SETUP=
+
+STF_ROOT_CLEANUP=cleanup
+STF_USER_CLEANUP=
+
+STF_ROOT_TESTCASES=clean_mirror_001_pos
+STF_USER_TESTCASES=
+
+STF_ENVFILES=
+STF_INCLUDES=
+
+STF_DONTBUILDMODES=true
+
+setup: ../setup
+ cp -f ../$@ $@
+cleanup: ../cleanup
+ cp -f ../$@ $@
+
+include ${STF_TOOLS}/Makefiles/Makefile.master
@@ -0,0 +1,74 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)clean_mirror_001_pos.ksh 1.2 07/01/09 SMI"
+#
+
+
+DISKS="$@"
+. $STF_SUITE/commands.cfg
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/include/default_common_varible.kshlib
+. ../default.cfg
+. $STF_SUITE/tests/functional/clean_mirror/clean_mirror_common.kshlib
+
+FILE_WRITE=$STF_SUITE/bin/file_write
+
+
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: clean_mirror_001_pos
+#
+# DESCRIPTION:
+# The primary side of a zpool mirror can be zeroed without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem mirror
+# 2) dd from /dev/zero over the primary side of the mirror
+# 3) verify that all the file contents are unchanged on the file system
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2005-07-04)
+#
+# __stc_assertion_end
+#
+################################################################################
+
+verify_runnable "global"
+
+log_assert "The primary side of a zpool mirror may be completely wiped" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_PRIMARY /dev/zero
+
+log_pass "The overwrite had no effect on the data"
Oops, something went wrong.

0 comments on commit 5df9987

Please sign in to comment.