Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

I have ported clean mirror script with README.

  • Loading branch information...
commit 5df99870d129d064fbc8b90eac934143baf59cd5 1 parent 4df1327
@vikramjadhav vikramjadhav authored
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
View
59 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
View
1  ZFS-Test_Suite/tests/functional/clean_mirror/.#setup.ksh
View
42 ZFS-Test_Suite/tests/functional/clean_mirror/Makefile
@@ -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
View
37 ZFS-Test_Suite/tests/functional/clean_mirror/README
@@ -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
+
+
+
+
+
+
View
74 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/#clean_mirror_001_pos.ksh#
@@ -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"
View
1  ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/.#clean_mirror_001_pos.ksh
View
51 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/Makefile
@@ -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
View
74 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/clean_mirror_001_pos.ksh
@@ -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"
View
73 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_001/clean_mirror_001_pos.ksh~
@@ -0,0 +1,73 @@
+#! /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"
+#
+
+
+. $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"
View
51 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/Makefile
@@ -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_002_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
View
72 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/clean_mirror_002_pos.ksh
@@ -0,0 +1,72 @@
+#! /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_002_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_002_pos
+#
+# DESCRIPTION:
+# The secondary 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 in the mirrored pool
+# 2) dd from /dev/zero over the secondary 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_SECONDARY /dev/zero
+
+log_pass "The overwrite had no effect on the data"
View
65 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/clean_mirror_002_pos.ksh~
@@ -0,0 +1,65 @@
+#! /usr/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_002_pos.ksh 1.2 07/01/09 SMI"
+#
+
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/tests/functional/clean_mirror/clean_mirror_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: clean_mirror_002_pos
+#
+# DESCRIPTION:
+# The secondary 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 in the mirrored pool
+# 2) dd from /dev/zero over the secondary 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_SECONDARY /dev/zero
+
+log_pass "The overwrite had no effect on the data"
View
BIN  ZFS-Test_Suite/tests/functional/clean_mirror/assertion_002/s1
Binary file not shown
View
51 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/Makefile
@@ -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_003_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
View
71 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/clean_mirror_003_pos.ksh
@@ -0,0 +1,71 @@
+#! /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_003_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_003_pos
+#
+# DESCRIPTION:
+# The primary side of a zpool mirror can be mangled without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem mirror
+# 2) dd from /dev/urandom 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 mangled" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_PRIMARY /dev/urandom
+
+log_pass "The overwrite did not have any effect on the data"
View
65 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/clean_mirror_003_pos.ksh~
@@ -0,0 +1,65 @@
+#! /usr/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_003_pos.ksh 1.2 07/01/09 SMI"
+#
+
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/tests/functional/clean_mirror/clean_mirror_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: clean_mirror_003_pos
+#
+# DESCRIPTION:
+# The primary side of a zpool mirror can be mangled without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem mirror
+# 2) dd from /dev/urandom 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 mangled" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_PRIMARY /dev/urandom
+
+log_pass "The overwrite did not have any effect on the data"
View
BIN  ZFS-Test_Suite/tests/functional/clean_mirror/assertion_003/s0
Binary file not shown
View
51 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/Makefile
@@ -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_004_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
View
72 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/clean_mirror_004_pos.ksh
@@ -0,0 +1,72 @@
+#! /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_004_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_004_pos
+#
+# DESCRIPTION:
+# The secondary side of a zpool mirror can be mangled without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem in the mirrored pool
+# 2) dd from /dev/urandom over the secondary 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 mangled" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_SECONDARY /dev/urandom
+
+log_pass "The overwrite had no effect on the data"
View
65 ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/clean_mirror_004_pos.ksh~
@@ -0,0 +1,65 @@
+#! /usr/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_004_pos.ksh 1.2 07/01/09 SMI"
+#
+
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/tests/functional/clean_mirror/clean_mirror_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: clean_mirror_004_pos
+#
+# DESCRIPTION:
+# The secondary side of a zpool mirror can be mangled without causing damage
+# to the data in the pool
+#
+# STRATEGY:
+# 1) Write several files to the ZFS filesystem in the mirrored pool
+# 2) dd from /dev/urandom over the secondary 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 mangled" \
+ "without affecting the content of the pool"
+
+overwrite_verify_mirror $SIDE_SECONDARY /dev/urandom
+
+log_pass "The overwrite had no effect on the data"
View
BIN  ZFS-Test_Suite/tests/functional/clean_mirror/assertion_004/s1
Binary file not shown
View
75 ZFS-Test_Suite/tests/functional/clean_mirror/clean_mirror_common.kshlib
@@ -0,0 +1,75 @@
+#
+# 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_common.kshlib 1.4 07/10/09 SMI"
+#
+
+# Most of the code related to the clearing of mirrors is duplicated in all
+# the test cases below this directory, barring a few minor changes
+# involving the device to be affected and the 'object' to use to mangle
+# the contents of the mirror.
+# This code is sourced into each of these test cases.
+
+
+function overwrite_verify_mirror
+{
+ typeset AFFECTED_DEVICE=$1
+ typeset OVERWRITING_DEVICE=$2
+
+ typeset atfile=0
+ set -A files
+ set -A cksums
+ set -A newcksums
+
+ while (( atfile < FILE_COUNT )); do
+ files[$atfile]=$TESTDIR/file.$atfile
+ log_must $FILE_WRITE -o create -f $TESTDIR/file.$atfile \
+ -b $FILE_SIZE -c 1
+ cksums[$atfile]=$($CKSUM ${files[$atfile]})
+ (( atfile = atfile + 1 ))
+ done
+
+ # dd the primary side of the mirror
+ log_must $DD if=$OVERWRITING_DEVICE of=$AFFECTED_DEVICE \
+ seek=8 bs=$DD_BLOCK count=$(( DD_COUNT - 8 )) conv=notrunc
+
+ atfile=0
+
+ typeset -i failedcount=0
+ while (( atfile < FILE_COUNT )); do
+ files[$atfile]=$TESTDIR/file.$atfile
+ newcksum=$($CKSUM ${files[$atfile]})
+ if [[ $newcksum != ${cksums[$atfile]} ]]; then
+ (( failedcount = failedcount + 1 ))
+ fi
+ $RM -f ${files[$atfile]}
+ (( atfile = atfile + 1 ))
+ done
+
+ if (( $failedcount > 0 )); then
+ log_fail "of the $FILE_COUNT files $failedcount did not " \
+ "have the same checksum before and after."
+ fi
+}
View
49 ZFS-Test_Suite/tests/functional/clean_mirror/cleanup.ksh
@@ -0,0 +1,49 @@
+#! /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 "@(#)cleanup.ksh 1.3 07/02/06 SMI"
+#
+
+DISKS="$@"
+. $STF_SUITE/commands.cfg
+. $STF_SUITE/include/libtest.kshlib
+. $STF_SUITE/include/default_common_varible.kshlib
+. ./default.cfg
+
+verify_runnable "global"
+
+$DF -F zfs -h | $GREP "$TESTFS " >/dev/null
+[[ $? == 0 ]] && log_must $ZFS umount -f $TESTDIR
+destroy_pool $TESTPOOL
+
+# recreate and destroy a zpool over the disks to restore the partitions to
+# normal
+if [[ -n $SINGLE_DISK ]]; then
+ log_must cleanup_devices $MIRROR_PRIMARY
+else
+ log_must cleanup_devices $MIRROR_PRIMARY $MIRROR_SECONDARY
+fi
+log_pass
View
71 ZFS-Test_Suite/tests/functional/clean_mirror/default.cfg
@@ -0,0 +1,71 @@
+#
+# 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 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)default.cfg 1.3 08/08/15 SMI"
+#
+
+
+
+typeset -i NUMBER_OF_DISKS=0
+for i in $DISKS; do
+ [[ -n $MIRROR_PRIMARY ]] && MIRROR_SECONDARY=$i
+ [[ -z $MIRROR_PRIMARY ]] && MIRROR_PRIMARY=$i
+done
+
+#log_must echo "disk==$DISKS"
+#log_must echo "p=$MIRROR_PRIMARY S=$MIRROR_SECONDARY"
+
+if [[ -z $MIRROR_SECONDARY ]]; then
+ # We need to repartition the single disk to two slices
+ SINGLE_DISK=$MIRROR_PRIMARY
+ MIRROR_SECONDARY=$MIRROR_PRIMARY
+ SIDE_PRIMARY=${SINGLE_DISK}s0
+ SIDE_SECONDARY=${SINGLE_DISK}s1
+ #Additional
+ SIDE_PRIMARY=$MIRROR_PRIMARY
+ SIDE_SECONDARY=$MIRROR_SECONDARY
+else
+ SIDE_PRIMARY=${MIRROR_PRIMARY}s0
+ SIDE_SECONDARY=${MIRROR_SECONDARY}s0
+ #Additional
+ SIDE_PRIMARY=$MIRROR_PRIMARY
+ SIDE_SECONDARY=$MIRROR_SECONDARY
+
+fi
+
+export MIRROR_PRIMARY MIRROR_SECONDARY SINGLE_DISK SIDE_PRIMARY SIDE_SECONDARY
+
+
+export FILE_COUNT=30
+export FILE_SIZE=$(( 1024 * 1024 ))
+export MIRROR_MEGS=2096
+export MIRROR_SIZE=${MIRROR_MEGS}m # default mirror size
+export DD_BLOCK=$(( 64 * 1024 ))
+export DD_COUNT=$(( MIRROR_MEGS * 1024 * 1024 / DD_BLOCK ))
+#export DD_BLOCK=1
+#export DD_COUNT=$MIRROR_MEGS
+
+
+
View
59 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
Please sign in to comment.
Something went wrong with that request. Please try again.