Skip to content
Browse files

stress folder added

  • Loading branch information...
1 parent 2de4152 commit 7f22056dfe852e0bae40779551bba2552b6c39fd @tushk2 tushk2 committed
Showing with 3,412 additions and 0 deletions.
  1. BIN ZFS-Test_Suite/tests/stress/bin/ab1
  2. BIN ZFS-Test_Suite/tests/stress/bin/abc
  3. +147 −0 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy
  4. +124 −0 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy_acl
  5. +145 −0 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy_exattr
  6. +883 −0 ZFS-Test_Suite/tests/stress/bin/dataset_run_xattr
  7. BIN ZFS-Test_Suite/tests/stress/bin/file_write
  8. +25 −0 ZFS-Test_Suite/tests/stress/bin/stf_description
  9. +77 −0 ZFS-Test_Suite/tests/stress/replica_stress/default.cfg
  10. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/cleanup
  11. +97 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/mirror_stress_002
  12. +38 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/setup
  13. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/stf_description
  14. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/cleanup
  15. +101 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/mirror_stress_003
  16. +39 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/setup
  17. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/stf_description
  18. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/cleanup
  19. +96 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/mirror_stress_004
  20. +34 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/setup
  21. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/stf_description
  22. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/cleanup
  23. +103 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/mirror_stress_005
  24. +34 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/setup
  25. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/stf_description
  26. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/cleanup
  27. +122 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/mirror_stress_006
  28. +34 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/setup
  29. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/stf_description
  30. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/cleanup
  31. +103 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/raidz_stress_001
  32. +34 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/setup
  33. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/stf_description
  34. +32 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_002/cleanup
  35. +122 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_002/raidz_stress_002
  36. +34 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_002/setup
  37. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_002/stf_description
  38. +85 −0 ZFS-Test_Suite/tests/stress/replica_stress/replica_stress_common.kshlib
  39. +35 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_001/cleanup
  40. +43 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_001/setup
  41. +104 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_001/slog_stress_001
  42. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_001/stf_description
  43. +35 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_002/cleanup
  44. +43 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_002/setup
  45. +123 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_002/slog_stress_002
  46. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/slog_stress_002/stf_description
  47. +25 −0 ZFS-Test_Suite/tests/stress/replica_stress/stf_description
  48. +25 −0 ZFS-Test_Suite/tests/stress/stf_description
  49. +53 −0 ZFS-Test_Suite/tests/stress/stress.cfg
View
BIN ZFS-Test_Suite/tests/stress/bin/ab1
Binary file not shown.
View
BIN ZFS-Test_Suite/tests/stress/bin/abc
Binary file not shown.
View
147 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy
@@ -0,0 +1,147 @@
+#!/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 "@(#)dataset_create_write_destroy.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+#
+# Perform a bunch of read/writes on some newly created datasets.
+# Create, mount and set the properties on a dataset before clobbering it
+# with a bunch of cfile commands.
+# @parameter: $1 the pool from which to draw these test file systems
+# @return: 0 if all the work completed ok
+# @use: NUM_CREATORS TOTAL_COUNT LOG ZFS MKDIR RM COUNT
+# dataset_set_defaultproperties FILE_WRITE TEST_BASE_DIR
+#
+
+echo "test base : ${TEST_BASE_DIR%%/} "
+typeset -i runat=0
+#typeset -i block_size=$(pagesize)
+typeset -i block_size=4096
+typeset dataset=$1
+typeset ddirb=${TEST_BASE_DIR%%/}/dir.$$
+typeset fn=dataset_create_write_destroy
+typeset runpids
+typeset tfilesys=
+typeset tmntpnt=
+
+NUM_CREATORS=10
+set -A sizes
+
+function remove_entities
+{
+ [[ -n $runpids ]] && kill -9 $runpids
+ [[ -d $tmntpnt ]] && $ZFS umount -f $tmntpnt
+ [[ -n $tfilesys ]] && $ZFS destroy -f $tfilesys
+ $RM -rf $tmntpnt
+}
+
+log_onexit remove_entities
+
+echo "in start "
+
+if [[ -z $dataset ]]; then
+ log_note "$fn: Insufficient parameters (need 1, got $#)"
+ exit 1
+fi
+
+while (( block_size <= MAX_BLOCKSIZE )); do
+ # +A isn't append, this would be easier if it was.
+ set -A sizes ${sizes[@]} $block_size
+ (( block_size = block_size * 2 ))
+done
+
+(( count = TOTAL_COUNT * NUM_CREATORS ))
+
+USE_F=""
+while (( runat < count )); do
+ typeset -i atfile=0
+ typeset -i size=0
+ typeset pid=
+
+ tdir=$ddirb/$runat
+ tfilesys=$dataset/file.$$.$runat
+
+
+ log_must $MKDIR -p $tdir
+ log_must $ZFS create $tfilesys
+ log_must $ZFS set mountpoint=$tdir $tfilesys
+ dataset_set_defaultproperties $tfilesys
+ if (( $? != 0 )); then
+ log_fail "dataset_set_defaultproperties failed"
+ fi
+
+ while (( atfile < NUM_CREATORS )); do
+ $FILE_WRITE -o create -f $tdir/file${atfile} \
+ -b ${sizes[$size]} -d 0 -c $COUNT -wr &
+ runpids="$! $runpids"
+ (( size = size + 1 ))
+ (( size > ${#sizes[@]} )) && size=0
+ (( atfile = atfile + 1 ))
+ log_must $ZFS snapshot $tfilesys@snap${atfile}
+ done
+
+# $MKFILE 1g $tdir/mkfile.out &
+ $DD if=/dev/zero of=$tdir/mkfile.out bs=1M count=1024 &
+ runpids="$! $runpids"
+
+ $DD if=/dev/urandom of=$tdir/dd.out bs=512 seek=$RANDOM count=10000 &
+ runpids="$! $runpids"
+
+ for sn in 1 2 3 4 5 6 7 8 9
+ do
+ log_must $ZFS snapshot $tfilesys@snap${atfile}.${sn}
+ sleep 1
+ done
+
+ for pid in $runpids; do
+ wait $pid
+ typeset status=$?
+ if [ $status -ne 0 ]; then
+ log_note "file_write failed ($status)"
+ fi
+ done
+ runpids=
+
+ log_must $RM -f $tdir/file*
+ #
+ # Issue a forced unmount on every second iteration
+ #
+ if [[ -n $USE_F ]] ; then
+ USE_F=""
+ else
+ USE_F="-f"
+ fi
+
+ log_must $ZFS unmount $USE_F $tdir
+ log_must $ZFS destroy -r $tfilesys
+ log_must $RM -rf $tdir
+ tdir=
+ tfilesys=
+ (( runat = runat + 1 ))
+done
View
124 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy_acl
@@ -0,0 +1,124 @@
+#!/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 "@(#)dataset_create_write_destroy_acl.ksh 1.3 07/10/09 SMI"
+#
+
+#
+# create a truckload of files with ACLS and destroy them.
+# Theoretically this test case should also verify that the storage
+# pool space has not been diminished by this operation.
+# @parameter: $1 the storage pool from which it draws the file systems.
+# @return: 0 if all the work completed OK.
+# @use: TEST_BASE_DIR TOTAL_COUNT ZFS RM MKDIR CP GETENT
+#
+
+typeset -i runat=0
+typeset -i scaledcount
+typeset dataset=$1
+typeset ddirb=${TEST_BASE_DIR%%/}/acld.$$
+typeset runpids=
+typeset tfilesys=
+typeset tmountpoint=
+
+if [[ -z $dataset ]]; then
+ NOTE "$fn: Insufficient parameters (need 1, got $#)"
+ exit 1
+fi
+
+(( scaledcount = TOTAL_COUNT * 100 ))
+
+function clean_entities
+{
+ [[ -n $runpids ]] && kill -9 $runpids
+ [[ -d $tmountpoint ]] && $ZFS umount -f $tmountpoint
+ [[ -n $tfilesys ]] && $ZFS destroy -f $tfilesys
+ $RM -rf $tmountpoint $ddirb
+}
+
+log_onexit clean_entities
+
+USE_F=""
+while (( runat < scaledcount )); do
+ typeset -i pid=
+ typeset file=
+ typeset group=
+ typeset user=
+
+ tfilesys=$dataset/$runat
+ file=$mountpoint/file.$runat
+
+ log_must $MKDIR -p $tmountpoint
+ log_must $ZFS create $tfilesys
+ log_must $ZFS mountpoint=$tmountpoint $tfilesys
+ log_must $CP /etc/passwd $file
+
+ for user in $($GETENT passwd | $AWK -F: '{print $1}'); do
+ chmod A=user:$user:r--,user::rwx,group::r--,other::r--,mask:r--\
+ $file &
+ runpids="$runpids $!"
+ done
+ for pid in $runpids; do
+ wait $pid
+ status=$?
+ if (( status != 0 )); then
+ log_note "chmod users: failed on $file " \
+ "[$status]"
+ fi
+ done
+ runpids=
+ for group in $($GETENT groups | $AWK -F: '{print $1}'); do
+ chmod A=user::rwx,group:$group:r--,group::r--,other::r--,mask:r--\
+ $file &
+ runpids="$runpids $!"
+ done
+ for pid in $runpids; do
+ wait $pid
+ status=$?
+ if (( status != 0 )); then
+ log_note "chmod groups: failed on $file" \
+ " [$status]"
+ fi
+ done
+ runpids=
+
+ log_must $RM -f $file
+ #
+ # Does a forced unmount every second iteration
+ #
+ if [[ -n $USE_F ]] ; then
+ USE_F=""
+ else
+ USE_F="-f"
+ fi
+
+ log_must $ZFS umount $USE_F $tmountpoint
+ log_must $ZFS destroy $tfilesys
+ log_must $RM -rf $tmountpoint
+
+ tmountpoint=
+ (( runat = runat + 1 ))
+done
View
145 ZFS-Test_Suite/tests/stress/bin/dataset_create_write_destroy_exattr
@@ -0,0 +1,145 @@
+#!/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 "@(#)dataset_create_write_destroy_exattr.ksh 1.2 07/01/09 SMI"
+#
+
+# Assertion: That creating and destroying datasets with
+# files that have attributes do not cause the depletion of
+# the storage pool space.
+# @parameter: $1 the pool from which to draw the test file systems
+# @return: 0 if all the work completed OK.
+# @use: TOTAL_COUNT log_note log_assert ZFS MKDIR RM
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+typeset -i child=0
+typeset -i count=0
+typeset -i failures=0
+typeset -i i=0
+typeset dataset=$1
+typeset ddirb=${TEST_BASE_DIR%%/}/dir.$$
+typeset tmplogbase=/tmp/${0##*/}.$$
+typeset pids=
+typeset tfilesys=
+typeset tmntpnt=
+NUM_CREATORS=10
+
+function remove_entities
+{
+ [[ -n $runpids ]] && kill -9 $runpids
+ [[ -n $tmntpnt ]] && $ZFS umount -f $tmntpnt
+ [[ -n $tfilesys ]] && $ZFS destroy -f $tfilesys
+ [[ -d $tmntpnt ]] && $RM -rf $tmntpnt
+}
+
+# execute many runat commands.
+# @parameter: $1 directory to perform the runat in
+# @return: 0 if all the runats completed
+# @use: count RUNAT CP
+function many_runat
+{
+ typeset dir=$1
+ typeset file=$dir/$$
+ typeset -i iter=0
+ typeset -i iter2=0
+ typeset -i status=0
+ typeset -i failed=0
+
+ while (( iter <= count )); do
+ # log_must $MKFILE 1m $file
+ log_must $DD if=/dev/zero of=$file count=1024 bs=1024
+ iter2=0
+ echo "run at $RUNAT"
+ while (( iter2 <= iter )); do
+ $RUNAT $file "$CP $file $iter"
+ status=$?
+ if (( $status != 0 )); then
+ log_note "$RUNAT $file \"$CP $file $iter2\" " \
+ "failed with $status"
+ (( failed = failed + 1 ))
+ fi
+ (( iter2 = iter2 + 1 ))
+ done
+ (( iter = iter + 1 ))
+ lockfs -f $dir
+ log_must $RM -f $file
+ done
+ if (( failed != 0 )); then
+ return 1
+ else
+ return 0
+ fi
+}
+
+echo "start"
+#log_onexit remove_entities
+echo "end"
+
+(( count = TOTAL_COUNT * NUM_CREATORS ))
+
+while (( i < count )); do
+ typeset -i j=0
+ typeset -i pid=0
+ tmntpnt=$ddirb.$i
+ tfilesys=$dataset/tcwda.$$.$i
+
+ log_must $MKDIR -p $tmntpnt
+ log_must $ZFS create $tfilesys
+ log_must $ZFS set mountpoint=$tmntpnt $tfilesys
+ while (( j <= NUM_CREATORS )); do
+ many_runat $tmntpnt >$tmplogbase.$j 2>&1 &
+ pids="$pids $!"
+ (( j = j + 1 ))
+ done
+
+ j=0
+ for pid in $pids; do
+ wait $pid
+ status=$?
+ if (( $status != 0 )); then
+ log_note "exattr_create_destroy failed: $status"
+ $CAT $tmplogbase.$j
+ (( failures = failures + 1 ))
+ fi
+ log_must $RM -f $tmplogbase.$j
+ (( j = j + 1 ))
+ done
+ pids=
+ log_must $RM -rf $tmntpnt/*
+ log_must $ZFS unmount $tmntpnt
+ log_must $ZFS destroy $tfilesys
+ log_must $RM -rf $tmntpnt
+ tfilesys=
+ tmntpnt=
+ (( i = i + 1 ))
+done
+
+if (( failures > 0 )); then
+ log_fail "There were $failures exattr failures in this run"
+fi
+
+log_pass
View
883 ZFS-Test_Suite/tests/stress/bin/dataset_run_xattr
@@ -0,0 +1,883 @@
+#!/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 "@(#)dataset_run_xattr.ksh 1.3 07/07/31 SMI"
+#
+
+. $STF_SUITE/include/libtest.kshlib
+
+#
+# Perform a bunch of extended attribute test on some newly created filesystem.
+# Create, mount and set the properties on a filesystem before clobbering it
+# with a bunch of commands.
+#
+# @return: 0 if all the work completed ok
+#
+
+NUM_FILE=${NUM_FILE:-5}
+NUM_ATTR=${NUM_ATTR:-20}
+RES_DIR=${RES_DIR:-res}
+INI_DIR=${INI_DIR:-init}
+TST_DIR=${TST_DIR:-test}
+TMP_DIR=${TMP_DIR:-tmp}
+
+#
+# Defined for saving files and attributes' cksum results.
+#
+set -A BEFORE_FCKSUM
+set -A BEFORE_ACKSUM
+set -A AFTER_FCKSUM
+set -A AFTER_ACKSUM
+
+#
+# Get the specified item of the specified string
+#
+# $1: Item number, count from 0.
+# $2-n: strings
+#
+function getitem {
+ typeset -i n=$1
+ shift
+
+ (( n += 1 ))
+ eval echo \${$n}
+}
+
+#
+# This function calculate the specified directory files checksum and write
+# to the specified array.
+#
+# $1 directory in which the files will be cksum.
+# $2 file array name which was used to store file cksum information.
+# $3 attribute array name which was used to store attribute information.
+#
+function cksum_file {
+ typeset dir=$1
+ typeset farr_name=$2
+ typeset aarr_name=$3
+
+ [[ ! -d $dir ]] && return
+ cd $dir
+ typeset files=$($LS file*)
+
+ typeset -i i=0
+ typeset -i n=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $files)
+ eval $farr_name[$i]=\$\(\$CKSUM $f\)
+
+ typeset -i j=0
+ while (( j < NUM_ATTR )); do
+ eval $aarr_name[$n]=\$\(\$RUNAT \$f \$CKSUM \
+ attribute.$j\)
+
+ (( j += 1 ))
+ (( n += 1 ))
+ done
+
+ (( i += 1 ))
+ done
+}
+
+#
+# This function compare two cksum results array.
+#
+# $1 The array name which stored the cksum before operation.
+# $2 The array name which stored the cksum after operation.
+#
+function compare_cksum {
+ typeset before=$1
+ typeset after=$2
+ eval typeset -i count=\${#$before[@]}
+
+ typeset -i i=0
+ while (( i < count )); do
+ eval typeset var1=\${$before[$i]}
+ eval typeset var2=\${$after[$i]}
+
+ if [[ $var1 != $var2 ]]; then
+ log_fail "($var1 != $var2)chksum failed."
+ fi
+
+ (( i += 1 ))
+ done
+}
+
+#
+# This function calculate all the files cksum information in current directory
+# and output them to the specified file.
+#
+# $1 output file
+#
+function record_cksum {
+ typeset outfile=$1
+
+ [[ ! -d ${outfile%/*} ]] && $MKDIR -p ${outfile%/*}
+
+ $FIND . -depth -type f -exec cksum {} \; | $SORT > $outfile
+ $FIND . -depth -type f -xattr -exec runat {} cksum attribute \; | \
+ $SORT >> $outfile
+}
+
+#
+# The clean_up function is called periodically throughout
+# the script to either get rid of files that have already
+# been used by other scripts or to get rid of the test
+# files after the script is finished.
+#
+# $1 base directory
+#
+function clean_up {
+ typeset basedir=$1
+ if [[ -d $basedir ]]; then
+ cd $basedir
+ $RM -rf $basedir/*
+ fi
+}
+
+#
+# The function create_files creates the directories and files that the script
+# will operate on to test extended attribute functionality.
+#
+# $1 The basic directory in which to create directories and files.
+#
+function create_files {
+ typeset basedir=$1
+ typeset resdir=$basedir/$RES_DIR
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+ typeset tmpdir=$basedir/$TMP_DIR
+
+ [[ ! -d $basedir ]] && $MKDIR -m 777 $basedir
+ [[ ! -d $resdir ]] && $MKDIR -m 777 $resdir
+ [[ ! -d $initdir ]] && $MKDIR -m 777 $initdir
+ [[ ! -d $testdir ]] && $MKDIR -m 777 $testdir
+ [[ ! -d $tmpdir ]] && $MKDIR -m 777 $tmpdir
+
+ #
+ # Create the original file and its attribute files.
+ #
+ [[ ! -a $resdir/file ]] && \
+ $FILE_WRITE -o create -f $resdir/file -b 1024 -d 0 -c 1
+ [[ ! -a $resdir/attribute ]] && \
+ $CP $resdir/file $resdir/attribute
+
+ cd $initdir
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset dstfile=$initdir/file.$$.$i
+ $CP $resdir/file $dstfile
+
+ typeset -i j=0
+ while (( j < NUM_ATTR )); do
+ $RUNAT $dstfile \
+ $CP $resdir/attribute ./attribute.$j
+ (( j += 1 ))
+ done
+
+ (( i += 1 ))
+ done
+}
+
+#
+# The test_compress function tests the functionality of the compress and
+# uncompress utility. The function verifies that compress will keep file
+# attribute intact after the file is compressed and uncompressed.
+#
+# $1 Base directory for compress testing.
+#
+function test_compress
+{
+ log_assert "($$)Starting compress/uncompress test..."
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+
+ create_files $basedir
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+
+ $COMPRESS $initdir/*
+ $MV $initdir/* $testdir
+ $UNCOMPRESS $testdir/*
+
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+ log_note "($$) Finished compress/uncompress test."
+}
+
+#
+# The test_cp function tests the functionality of the cp
+# utility. The function tests the following:
+#
+# * verifies that cp will include file attribute when
+# using the -@ flag
+# * verifies that cp will not be able to include file
+# attribute when attribute is unreadable (unless the
+# user is root)
+# * verifies that cp will not include file attribute
+# when the -@ flag is not present
+#
+function test_cp
+{
+ log_assert "($$)Starting cp test..."
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+
+ log_note "Verify that 'cp -@' will include file attribute."
+ create_files $basedir
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+
+ #
+ # Get initial directory files name and 'cp -@p' to the test directory.
+ #
+ typeset ini_files=$($LS $initdir/file*)
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ $CP -@p $f $testdir
+
+ (( i += 1 ))
+ done
+
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+
+ log_note "Verifies that cp won't be able to include file " \
+ "attribute when attribute is unreadable (except root)"
+ create_files $basedir
+ ini_files=$($LS $initdir/file*)
+
+ i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ typeset -i j=0
+ while (( j < NUM_ATTR )); do
+ #
+ # chmod all the attribute files to '000'.
+ #
+ $RUNAT $f $CHMOD 000 attribute.$j
+
+ (( j += 1 ))
+ done
+
+ #
+ # Implement 'cp -@p' to the file whose attribute files
+ # models are '000'.
+ #
+ $CP -@p $f $testdir
+
+ typeset tst_files=$($LS $testdir/file*)
+ typeset tf=$(getitem $i $tst_files)
+ typeset ls_attr=$($LS -@ $tf | \
+ $AWK '{print substr($1, 11, 1)}')
+ if [[ $ls_attr != "@" ]]; then
+ log_fail "Should be able to cp attribute when " \
+ "attribute files is unreadable as root."
+ fi
+
+ (( i += 1 ))
+ done
+
+ clean_up $basedir
+
+ log_note "Verifies that cp will not include file attribute " \
+ "when the -@ flag is not present."
+ create_files $basedir
+ ini_files=$($LS $initdir/file*)
+
+ i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ $CP $f $testdir
+
+ tst_files=$($LS $testdir/file*)
+ typeset tf=$(getitem $i $tst_files)
+ typeset ls_attr=$($LS -@ $tf | \
+ $AWK '{print substr($1, 11, 1)}')
+ if [[ $ls_attr == "@" ]]; then
+ log_fail "cp of attribute successful without " \
+ "-@ or -p option"
+ fi
+
+ (( i += 1 ))
+ done
+
+ clean_up $basedir
+ log_note "($$) Finished cp test."
+}
+
+#
+# The test_find function tests the functionality of the find
+# utility. The function tests the following:
+#
+# * verifies ability to find files with attribute with -xattr
+# flag and using "-exec runat ls"
+# * verifies -xattr doesn't include files without attribute
+# and using "-exec runat ls"
+# * verifies that using the command "find . -xattr" will only
+# return those files known to have attribute
+#
+function test_find
+{
+
+ log_assert "($$)Starting find test ..."
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+
+ log_note "Verifies ability to find files with attribute with" \
+ "-xattr flag and using '-exec runat ls'"
+ typeset oldpwd=$PWD
+ create_files $basedir
+ typeset ini_files=$($LS $initdir/file*)
+ typeset ff fa
+
+ cd $initdir
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ ff=$($FIND $initdir -type f -name ${f##*/} -xattr -print)
+ if [[ $ff != $f ]]; then
+ log_fail "find file containing attribute fail."
+ fi
+
+ cd $initdir
+ typeset j=0
+ while (( j < NUM_ATTR )); do
+ typeset af=attribute.$j
+ fa=$($FIND . -type f -name ${f##*/} -xattr \
+ -exec runat {} ls $af \;)
+ if [[ $fa != $af ]]; then
+ log_fail "find file attribute fail"
+ fi
+ (( j += 1 ))
+ done
+ (( i += 1 ))
+ done
+
+ log_note "verifies -xattr doesn't include files without " \
+ "attribute and using '-exec runat ls'"
+ i=0
+ while (( i < NUM_FILE )); do
+ f=$(getitem $i $ini_files)
+ $RUNAT $f $RM attribute*
+ (( i += 1 ))
+ done
+
+ i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ ff=$($FIND $initdir -type f -name ${f##*/} -xattr -print)
+ if [[ $ff == $f ]]; then
+ log_fail "find not containing attribute should fail."
+ fi
+ typeset j=0
+ while (( j < NUM_ATTR )); do
+ fa=$($FIND . -type f -name ${f##*/} -xattr \
+ -exec runat {} ls attribute.$j \;)
+ if [[ $fa == attribute.$j ]]; then
+ log_note "find file attribute should fail."
+ fi
+ (( j += 1 ))
+ done
+ (( i += 1 ))
+ done
+
+ clean_up $basedir
+ cd $oldpwd
+ log_note "($$) Finished find test."
+}
+
+#
+# The test_ls function tests the functionality of the ls
+# utility. The function tests the following:
+#
+# * verifies that ls displays @ in the file permissions
+# using ls -@ for files with attribute
+# * verifies that ls doesn't display @ in the file
+# permissions using ls -@ for files without attribute
+#
+function test_ls
+{
+ log_assert "($$)Starting ls test ..."
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+
+ log_note "Verifies that ls displays @ in the file permissions " \
+ "using ls -@ for files with attribute."
+ create_files $basedir
+
+ typeset ini_files=$($LS $initdir/file*)
+ typeset ls_attr
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ ls_attr=$($LS -@ $f | $AWK '{print substr($1, 11, 1)}')
+ if [[ $ls_attr != "@" ]]; then
+ log_fail "ls with attribute failed"
+ fi
+ (( i += 1 ))
+ done
+
+ log_note "Verifies that ls doesn't display @ in the file " \
+ "permissions using ls -@ for files without attribute."
+ i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ $RUNAT $f $RM attribute*
+ ls_attr=$($LS -l $f | $AWK '{print substr($1, 11, 1)}')
+ if [[ $ls_attr == "@" ]]; then
+ log_fail "ls with attribute shouldn't success."
+ fi
+ (( i += 1 ))
+ done
+
+ clean_up $basedir
+ log_note "($$) Finished ls test."
+}
+
+#
+# The mv_test function tests the functionality of the mv
+# utility. The function tests the following:
+#
+# * verifies that mv will include file attribute
+#
+function test_mv
+{
+ log_assert "($$)Starting mv test ... "
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+
+ create_files $basedir
+ typeset ini_files=$($LS $initdir/file*)
+
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ $MV $f $testdir
+ (( i += 1 ))
+ done
+
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+ log_note "($$) Finished mv test."
+}
+
+#
+# The pack_test function tests the functionality of the pack
+# and unpack utility. The function tests the following:
+#
+# * verifies that pack will keep file attribute intact after
+# the file is packed and unpacked
+#
+function test_pack
+{
+ log_assert "($$)Starting pack/unpack test ... "
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+
+ create_files $basedir
+
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+ $PACK -f $initdir/file* > /dev/null 2>&1
+ $MV $initdir/* $testdir
+ $UNPACK $testdir/file* > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+ log_note "($$) Finished pack/unpack test."
+}
+
+#
+# The test_pax function tests the functionality of the pax
+# utility. The function tests the following:
+#
+# * include attribute in pax archive and restore with pax
+# * include attribute in tar archive and restore with pax
+# * include attribute in cpio archive and restore with pax
+# * include attribute in tar archive and restore with tar
+# * include attribute in cpio archive and restore with cpio
+#
+function test_pax
+{
+ log_assert "($$)Starting pax test ..."
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+ typeset tmpdir=$basedir/$TMP_DIR
+ typeset oldpwd=$PWD
+
+ log_note "Include attribute in pax archive and restore with pax"
+ [[ ! -d $initdir ]] && $MKDIR -m 777 -p $initdir
+ $MKTREE -b $initdir -l 6 -d 2 -f 2
+
+ #
+ # Enter into initial directory and record all directory information,
+ # then pax all the files to $tmpdir/files.pax.
+ #
+ [[ ! -d $tmpdir ]] && $MKDIR $tmpdir
+ typeset initout=$tmpdir/initout.$$
+ cd $initdir
+ record_cksum $initout
+ typeset paxout=$tmpdir/files.pax
+ $PAX -w -@ -f $paxout * > /dev/null 2>&1
+
+ #
+ # Enter into test directory and pax $tmpdir/files.pax to current
+ # directory. Record all directory information and compare with initial
+ # directory record.
+ #
+ [[ ! -d $testdir ]] && $MKDIR -m 777 $testdir
+ typeset testout=$tmpdir/testout.$$
+ cd $testdir
+ $PAX -r -@ -f $paxout > /dev/null 2>&1
+ record_cksum $testout
+ $DIFF $initout $testout
+
+ clean_up $basedir
+
+ log_note "Include attribute in tar archive and restore with pax"
+ [[ ! -d $initdir ]] && $MKDIR -m 777 $initdir
+ $MKTREE -b $initdir -l 5 -d 2 -f 2
+ [[ ! -d $tmpdir ]] && $MKDIR -m 777 $tmpdir
+ cd $initdir
+ record_cksum $initout
+ paxout=$tmpdir/files.$$.tar
+ $PAX -w -x ustar -@ -f $paxout * > /dev/null 2>&1
+
+ [[ ! -d $testdir ]] && $MKDIR -m 777 $testdir
+ cd $testdir
+ $TAR xpf@ $paxout
+ record_cksum $testout
+
+ $DIFF $initout $testout
+
+ clean_up $basedir
+
+ log_note "Include attribute in cpio archive and restore with pax"
+ [[ ! -d $initdir ]] && $MKDIR -m 777 $initdir
+ $MKTREE -b $inidir -l 5 -d 2 -f 2
+
+ cd $initdir
+ record_cksum $initout
+ paxout=$tmpdir/files.cpio
+ $PAX -w -x cpio -@ -f $paxout * > /dev/null 2>&1
+
+ [[ ! -d $testdir ]] && $MKDIR -m 777 $testdir
+ cd $testdir
+ $CPIO -ivd@ < $paxout > /dev/null 2>&1
+ record_cksum $testout
+
+ $DIFF $initout $testout
+
+ clean_up $basedir
+
+ log_note "Include attribute in tar archive and restore with tar"
+ create_files $basedir
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+ cd $initdir
+ paxout=$tmpdir/files.pax
+ $PAX -w -@ -f $paxout file* > /dev/null 2>&1
+ cd $testdir
+ $PAX -r -@ -f $paxout > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+ clean_up $basedir
+
+ log_note "Include attribute in cpio archive and restore with cpio"
+ create_files $basedir
+ cd $initdir
+ paxout=$tmpdir/files.cpio
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+ $PAX -w -x cpio -@ -f $paxout file* > /dev/null 2>&1
+
+ cd $testdir
+ $PAX -r -x cpio -@ -f $paxout > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ $RM -rf file*
+ $CPIO -iv@ < $paxout > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+
+ create_files $basedir
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+ paxout=$tmpdir/files.$$.tar
+ cd $initdir
+ $PAX -w -x ustar -@ -f $paxout file* > /dev/null 2>&1
+ cd $testdir
+ $PAX -r -x ustar -@ -f $paxout > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ $RM -rf file*
+ $TAR xf@ $tmpdir/files.$$.tar > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ clean_up $basedir
+ cd $oldpwd
+ log_note "($$) Finished pax test."
+}
+
+#
+# The test_rm function tests the functionality of the rm
+# utility. The function tests the following:
+#
+# * removal of file and associated attribute
+#
+function test_rm
+{
+ log_assert "($$)Starting rm test ..."
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+
+ create_files $basedir
+ typeset ini_files=$($LS $initdir/file*)
+
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $ini_files)
+ $RM $f
+ $LS $f
+
+ (( i += 1 ))
+ done
+
+ clean_up $basedir
+ log_note "($$) Finished rm test."
+}
+
+#
+# The test_tar function tests the functionality of the tar
+# utility. The function tests the following:
+#
+# * verifies that tar will include file attribute when
+# @ flag is present
+# * verifies that tar will not include files attribute
+# when @ flag is not present
+#
+function test_tar
+{
+ log_assert "($$)Starting tar test ..."
+
+ typeset basedir=$1
+ typeset initdir=$basedir/$INI_DIR
+ typeset testdir=$basedir/$TST_DIR
+ typeset tmpdir=$basedir/$TMP_DIR
+ typeset oldpwd=$PWD
+
+ [[ ! -d $initdir ]] && $MKDIR -m 777 $initdir
+ [[ ! -d $tmpdir ]] && $MKDIR -m 777 $tmpdir
+ [[ ! -d $testdir ]] && $MKDIR -m 777 $testdir
+ $MKTREE -b $initdir -l 5 -d 2 -f 2
+
+ log_note "Verifies that tar will include file attribute " \
+ "when @ flag is present."
+ typeset initout=$tmpdir/initout.$$
+ typeset tarout=$tmpdir/files.$$.tar
+ cd $initdir
+ record_cksum $initout
+ $TAR cpf@ $tarout *
+
+ typeset testout=$tmpdir/testout.$$
+ cd $testdir
+ $TAR xpf@ $tarout
+ record_cksum $testout
+
+ $DIFF $initout $testout
+ clean_up $basedir
+
+ log_note "Verifies that tar will not include files attribute " \
+ "when @ flag is not present."
+ create_files $basedir
+ cd $initdir
+ cksum_file $initdir BEFORE_FCKSUM BEFORE_ACKSUM
+ tarout=$tmpdir/files.$$.tar
+ $TAR cpf@ $tarout * > /dev/null 2>&1
+ cksum_tara=$($CKSUM $tarout)
+ $CP $tarout $testdir
+
+ cd $testdir
+ $TAR xpf@ $tarout > /dev/null 2>&1
+ cksum_file $testdir AFTER_FCKSUM AFTER_ACKSUM
+
+ compare_cksum BEFORE_FCKSUM AFTER_FCKSUM
+ compare_cksum BEFORE_ACKSUM AFTER_ACKSUM
+
+ ck_tvf=$($TAR tvf $tarout | $GREP attribute | $WC -l)
+ if (( $ck_tvf != NUM_ATTR * NUM_FILE + NUM_FILE )); then
+ log_note "table of contents displayed attribute fail"
+ fi
+
+ clean_up $basedir
+
+ create_files $basedir
+
+ cd $initdir
+ $TAR cpf $tarout file* > /dev/null 2>&1
+ cksum_tarb=$($CKSUM $tarout)
+ $CP $tarout $testdir
+
+ cd $testdir
+ $TAR xpf $tarout > /dev/null 2>&1
+ typeset test_files=$($LS $testdir/file*)
+ typeset -i i=0
+ while (( i < NUM_FILE )); do
+ typeset f=$(getitem $i $test_files)
+ ls_attr=$($LS -@ $f | $AWK '{print substr($1, 11, 1)}')
+ if [[ $ls_attr == "@" ]]; then
+ log_fail "extraction of attribute successful w/ -@ flag"
+ fi
+
+ (( i += 1 ))
+ done
+
+ if [[ $cksum_tara == $cksum_tarb ]]; then
+ log_fail "inclusion of attribute in tar file without -@ failed"
+ fi
+
+ clean_up $basedir
+ cd $oldpwd
+ log_note "($$) Finished tar test."
+}
+
+function test_all #<directory>
+{
+ typeset dir=$1
+
+ test_compress $dir
+ test_cp $dir
+ test_find $dir
+ test_ls $dir
+ test_mv $dir
+ test_pack $dir
+ test_pax $dir
+ test_rm $dir
+ test_tar $dir
+
+ exit 0
+}
+
+function trap_handle
+{
+ typeset pid
+
+ for pid in $@; do
+ $KILL -9 $pid
+ done
+ $KILL -9 $$
+}
+
+typeset dataset=$1
+typeset ddirb=${TEST_BASE_DIR%%/}/dir.$$
+typeset -i runat=0
+
+(( count = TOTAL_COUNT * NUM_CREATORS ))
+
+while (( runat < count )); do
+ typeset -i run_count=0
+ typeset tfs=$dataset/fs.$$.$runat
+ typeset tdir=$ddirb/$runat
+
+ $MKDIR -p $tdir
+ $ZFS create $tfs
+ $ZFS set mountpoint=$tdir $tfs
+ if ! dataset_set_defaultproperties $tfs; then
+ log_fail "dataset_set_defaultproperties failed"
+ fi
+
+ typeset runpids=""
+ while (( run_count < NUM_CREATORS )); do
+ log_note "Starting No.$run_count running..."
+
+ [[ ! -d $tdir/$run_count ]] && \
+ $MKDIR -m 777 $tdir/$run_count
+
+ test_all $tdir/$run_count > /dev/null 2>&1 &
+ runpids="$! $runpids"
+
+ (( run_count += 1 ))
+ done
+
+ trap 'trap_handle $runpids' USR1
+
+ for pid in $runpids; do
+ wait $pid
+ typeset status=$?
+ if [ $status -ne 0 ]; then
+ log_note "($pid)Extend attribute test failed. ($status)"
+ fi
+ done
+ runpids=""
+
+ if datasetexists $tfs; then
+ $ZFS destroy -Rf $tfs
+ fi
+ if [[ -d $tdir ]]; then
+ $RM -rf $tdir
+ fi
+
+ (( runat += 1 ))
+done
View
BIN ZFS-Test_Suite/tests/stress/bin/file_write
Binary file not shown.
View
25 ZFS-Test_Suite/tests/stress/bin/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP=""
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP=""
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES=""
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
77 ZFS-Test_Suite/tests/stress/replica_stress/default.cfg
@@ -0,0 +1,77 @@
+#
+# 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 "@(#)default.cfg 1.3 07/10/09 SMI"
+#
+. ${STF_SUITE}/commands.cfg
+
+export TESTPOOL=${TESTPOOL-mtestpool}
+typeset -i NUMBER_OF_DISKS=0
+for i in $DISKS; do
+ (( NUMBER_OF_DISKS = NUMBER_OF_DISKS + 1 ))
+done
+
+
+#
+# Heuristic:
+#
+# 1 Pool per GB of memory
+#
+
+#MEMORY=`prtconf | $GREP Memory | $NAWK '{ print $3 }'`
+
+MEMORY=`$CAT /proc/meminfo | $GREP MemTotal | $AWK '{ print $2 }'`
+MEMORY=$(($MEMORY / 1024 ))
+
+echo "MEMORY : $MEMORY"
+
+MAXPOOLS=$(( (MEMORY / 1024) + 1 ))
+
+echo "MAXPOOLS=$MAXPOOLS"
+echo "NUMBER_OF_DISKS=$NUMBER_OF_DISKS"
+
+#
+# Heuristic:
+#
+# Number of Mirrors = MIN(NUMBER_OF_DISKS, MAXPOOLS)
+#
+NUMBER_OF_MIRRORS=$(( NUMBER_OF_DISKS / 2 ))
+if (( MAXPOOLS < NUMBER_OF_MIRRORS )); then
+ NUMBER_OF_MIRRORS=$MAXPOOLS
+fi
+
+#
+# Heuristic:
+#
+# Assume 10 Processes per 1gb of memory
+#
+NUM_CREATORS=10
+
+echo "NUMBER_OF_MIRRORS=$NUMBER_OF_MIRRORS"
+echo "NUM_CREATORS=$NUM_CREATORS"
+
+export NUMBER_OF_MIRRORS
+export NUMBER_OF_DISKS
+export NUM_CREATORS
View
32 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/cleanup
@@ -0,0 +1,32 @@
+#!/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.2 07/01/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
97 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/mirror_stress_002
@@ -0,0 +1,97 @@
+#!/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 "@(#)mirror_stress_002.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+. ${STF_SUITE}/tests/stress/stress.cfg
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: mirror_stress_002
+#
+# DESCRIPTION:
+# running multiple copies of zfs_dataset_create_write_destroy on
+# separate mirrored pools shall not cause the system to fail, hang
+# or panic.
+#
+# STRATEGY:
+# the setup phase will have created several mirrored pools
+# multiple copies of zfs_dataset_create_write_destroy are fired off
+# one per mirror in the background
+# wait a minute
+# Fire off a second round of the same tests
+# Wait for our stress timeout value to finish, and kill any remaining
+# tests.
+# The test is considered to have passed if the machine stays up during the
+# time the stress tests are running and doesn't hit the stf time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy's on multiple mirrored " \
+ "pools won't fail"
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+typeset stresslog=/tmp/${0##*/}.$$
+typeset -i child=0
+
+echo " Name : $CREATE_WRITE_DESTROY_SCRIPT $pool"
+for pool in $(get_pools); do
+ echo $pool
+ log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool >$stresslog.$child"
+ $CREATE_WRITE_DESTROY_SCRIPT $pool >$stresslog.$child 2>&1 &
+ $CREATE_WRITE_DESTROY_SCRIPT $pool >$stresslog.$child
+ child_pids="$child_pids $!"
+ (( child += 1 ))
+done
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+
+
+while (( child > 0 )); do
+ (( child -= 1 ))
+# log_must $RM -f $stresslog.$child
+done
+
+log_pass
View
38 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/setup
@@ -0,0 +1,38 @@
+#!/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 "@(#)setup.ksh 1.3 07/10/09 SMI"
+#
+
+DISKS=$@
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/commands.cfg
+. ${STF_SUITE}/tests/stress/replica_stress/default.cfg
+
+setup_mirrors $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_002/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES="mirror_stress_002"
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
32 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/cleanup
@@ -0,0 +1,32 @@
+#!/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 "@(#)cleanup.ksh 1.2 07/01/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
101 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/mirror_stress_003
@@ -0,0 +1,101 @@
+#!/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 "@(#)mirror_stress_003.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+. ${STF_SUITE}/tests/stress/stress.cfg
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: mirror_stress_003
+#
+# DESCRIPTION:
+# running multiple copies of zfs_dataset_create_write_destroy and
+# zfs_dataset_create_write_destroy_attr on separate mirrored pools
+# shall not cause the system to fail, hang or panic.
+#
+# STRATEGY:
+# the setup phase will have created several mirrored pools
+# multiple copies of zfs_dataset_create_write_destroy and
+# zfs_dataset_create_write_destroy_attr are fired off
+# one per mirror in the background
+# Wait for our stress timeout value to finish, and kill any remaining
+# tests.
+# The test is considered to have passed if the machine stays up during the
+# time the stress tests are running and doesn't hit the stf time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy's and " \
+ "dataset_create_write_destroy_exattr's on multiple mirrored " \
+ "pools won't fail"
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+typeset stresslog=/tmp/${0##*/}.$$
+typeset -i child=0
+
+echo " in : $CREATE_WRITE_DESTROY_SCRIPT $CREATE_WRITE_DESTROY_EXATTR_SCRIPT "
+for pool in $(get_pools); do
+ #log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool >$stresslog.$child"
+ #$CREATE_WRITE_DESTROY_SCRIPT $pool >$stresslog.$child 2>&1 &
+ #child_pids="$child_pids $!"
+ #(( child += 1 ))
+
+ log_note "$CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > " \
+ "$stresslog.$child"
+ $CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > \
+ $stresslog.$child 2>&1 &
+ child_pids="$child_pids $!"
+ (( child += 1 ))
+done
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+
+while (( child > 0 )); do
+ (( child -= 1 ))
+ log_must $RM -f $stresslog.$child
+done
+
+log_pass
View
39 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/setup
@@ -0,0 +1,39 @@
+#!/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 "@(#)setup.ksh 1.3 07/10/09 SMI"
+#
+
+DISKS=$@
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/commands.cfg
+. ${STF_SUITE}/tests/stress/replica_stress/default.cfg
+
+
+setup_mirrors $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_003/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES="mirror_stress_003"
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
32 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/cleanup
@@ -0,0 +1,32 @@
+#!/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 "@(#)cleanup.ksh 1.2 07/01/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
96 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/mirror_stress_004
@@ -0,0 +1,96 @@
+#!/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 "@(#)mirror_stress_004.ksh 1.4 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: mirror_stress_004
+#
+# DESCRIPTION:
+# Running multiple copies of dataset_create_write_destroy,
+# dataset_create_write_destroy_attr and dataset_xattr on separate
+# mirrored pools shall not cause the system to fail, hang or panic.
+#
+# STRATEGY:
+# 1. Setup phase will have created several mirrored pools
+# 2. Multiple copies of dataset_create_write_destroy are fired off
+# one per mirror in the background.
+# 3. Multiple copies of dataset_create_write_destroy_attr are filed off
+# one per mirror in the background.
+# 4. Multiple copies of dataset_xattr are filed off one per mirror in the
+# background.
+# 5. Wait for 10 seconds, then repeat the operation at step 2,3,4.
+# 6. Wait for our stress timeout value to finish, and kill any remaining
+# tests. The test is considered to have passed if the machine stays up
+# during the time the stress tests are running and doesn't hit the stf
+# time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy, " \
+ "dataset_create_write_destroy_attr and dataset_run_xattr " \
+ "on multiple mirrored pools won't fail"
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+
+for pool in $(get_pools); do
+ log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$DATASET_RUN_XATTR_SCRIPT $pool "
+ $DATASET_RUN_XATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+done
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+
+log_pass
View
34 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/setup
@@ -0,0 +1,34 @@
+#!/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 "@(#)setup.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+setup_mirrors $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_004/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES="mirror_stress_004"
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
32 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/cleanup
@@ -0,0 +1,32 @@
+#!/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 "@(#)cleanup.ksh 1.2 07/01/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
103 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/mirror_stress_005
@@ -0,0 +1,103 @@
+#!/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 "@(#)mirror_stress_005.ksh 1.4 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: mirror_stress_005
+#
+# DESCRIPTION:
+# Running multiple copies of dataset_create_write_destroy,
+# dataset_create_write_destroy_attr and dataset_xattr on separate
+# mirrored pools. Create new filesystem and write file at the same time
+# shall not cause the system to fail, hang or panic.
+#
+# STRATEGY:
+# 1. Setup phase will have created several mirrored pools
+# 2. Multiple copies of dataset_create_write_destroy are fired off
+# one per mirror in the background.
+# 3. Multiple copies of dataset_create_write_destroy_attr are filed off
+# one per mirror in the background.
+# 4. Multiple copies of dataset_xattr are filed off one per mirror in the
+# background.
+# 6. Create three datasets in each pool and start writing files in
+# background.
+# 7. Wait for 30 seconds, then repeat the operation at step 2 - 8.
+# 8. Start writing to the same files, making holes in those files in
+# background.
+# 9. Wait for our stress timeout value to finish, and kill any remaining
+# tests. The test is considered to have passed if the machine stays up
+# during the time the stress tests are running and doesn't hit the stf
+# time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy, " \
+ "dataset_create_write_destroy_attr , dataset_run_xattr " \
+ "create three filesystems per pool and write files on them won't fail"
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+
+for pool in $(get_pools); do
+ log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$DATASET_RUN_XATTR_SCRIPT $pool "
+ $DATASET_RUN_XATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ create_write_fs $pool $loop
+done
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+
+log_pass
View
34 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/setup
@@ -0,0 +1,34 @@
+#!/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 "@(#)setup.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+setup_mirrors $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_005/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES="mirror_stress_005"
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
32 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/cleanup
@@ -0,0 +1,32 @@
+#!/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 "@(#)cleanup.ksh 1.2 07/01/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
122 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/mirror_stress_006
@@ -0,0 +1,122 @@
+#!/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 "@(#)mirror_stress_006.ksh 1.4 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: mirror_stress_006
+#
+# DESCRIPTION:
+# Running multiple copies of dataset_create_write_destroy,
+# dataset_create_write_destroy_attr and dataset_xattr on separate
+# mirrored pools. Create new filesystem and write file at the same time.
+# At the same time, synchronize it every 10 seconds.
+# The system shall not cause the system to fail, hang or panic.
+#
+# STRATEGY:
+# 1. Setup phase will have created several mirrored pools
+# 2. Multiple copies of dataset_create_write_destroy are fired off
+# one per mirror in the background.
+# 3. Multiple copies of dataset_create_write_destroy_attr are filed off
+# one per mirror in the background.
+# 4. Multiple copies of dataset_xattr are filed off one per mirror in the
+# background.
+# 5. Create three datasets in each pool and start writing files in
+# background.
+# 6. Wait for 30 seconds, then repeat the operation at step 2 - 7.
+# 7. Start writing to the same files, making holes in those files in
+# background.
+# 8. Sync every 10 seconds.
+# 9. Wait for our stress timeout value to finish, and kill any remaining
+# tests. The test is considered to have passed if the machine stays up
+# during the time the stress tests are running and doesn't hit the stf
+# time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy, " \
+ "dataset_create_write_destroy_attr , dataset_run_xattr " \
+ "create separated filesystem and create files on them." \
+ "Then synchronize per 10 seconds won't fail"
+
+function regular_sync #<seconds>
+{
+ typeset -i timeout=$1
+
+ while true; do
+ $SLEEP $timeout
+ $SYNC
+ done
+
+ exit 0
+}
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+
+for pool in $(get_pools); do
+ log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$DATASET_RUN_XATTR_SCRIPT $pool "
+ $DATASET_RUN_XATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ create_write_fs $pool $loop
+done
+
+regular_sync 10 > /dev/null 2>&1 &
+typeset sync_pid=$!
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+$KILL -9 $sync_pid
+
+log_pass
View
34 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/setup
@@ -0,0 +1,34 @@
+#!/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 "@(#)setup.ksh 1.3 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+setup_mirrors $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/mirror_stress_006/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""
+STF_TESTCASES_GEN=""
+STF_ROOT_TESTCASES="mirror_stress_006"
+STF_USER_TESTCASES=""
+STF_DATAFILES=""
+STF_ENVFILES=""
+STF_CONFIGFILES=""
+STF_EXECUTE_SUBDIRS=""
+STF_DONTBUILDMODES="true"
+MSTF_ROLES=""
+MSTF_ENVMAPS=""
+STF_ROOT_CASEFILES=""
+STF_USER_CASEFILES=""
View
32 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/cleanup
@@ -0,0 +1,32 @@
+#!/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 "@(#)cleanup.ksh 1.1 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+destroy_mirrors
View
103 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/raidz_stress_001
@@ -0,0 +1,103 @@
+#!/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 "@(#)raidz_stress_001.ksh 1.1 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+. ${STF_SUITE}/tests/stress/replica_stress/replica_stress_common.kshlib
+
+###############################################################################
+#
+# __stc_assertion_start
+#
+# ID: raidz_stress_001
+#
+# DESCRIPTION:
+# Running multiple copies of dataset_create_write_destroy,
+# dataset_create_write_destroy_attr and dataset_xattr on separate
+# raidz pools. Create new filesystem and write file at the same time
+# shall not cause the system to fail, hang or panic.
+#
+# STRATEGY:
+# 1. Setup phase will have created several raidz pools
+# 2. Multiple copies of dataset_create_write_destroy are fired off
+# one per raidz in the background.
+# 3. Multiple copies of dataset_create_write_destroy_attr are filed off
+# one per raidz in the background.
+# 4. Multiple copies of dataset_xattr are filed off one per raidz in the
+# background.
+# 6. Create three datasets in each pool and start writing files in
+# background.
+# 7. Wait for 30 seconds, then repeat the operation at step 2 - 8.
+# 8. Start writing to the same files, making holes in those files in
+# background.
+# 9. Wait for our stress timeout value to finish, and kill any remaining
+# tests. The test is considered to have passed if the machine stays up
+# during the time the stress tests are running and doesn't hit the stf
+# time limit.
+#
+# TESTABILITY: explicit
+#
+# TEST_AUTOMATION_LEVEL: automated
+#
+# CODING_STATUS: COMPLETED (2006-06-08)
+#
+# __stc_assertion_end
+#
+###############################################################################
+
+log_assert "parallel dataset_create_write_destroy, " \
+ "dataset_create_write_destroy_attr , dataset_run_xattr " \
+ "create three filesystems per pool and write files on them won't fail"
+
+log_onexit cleanup
+
+typeset pool=
+typeset child_pids=
+
+for pool in $(get_pools); do
+ log_note "$CREATE_WRITE_DESTROY_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool"
+ $CREATE_WRITE_DESTROY_EXATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ log_note "$DATASET_RUN_XATTR_SCRIPT $pool "
+ $DATASET_RUN_XATTR_SCRIPT $pool > /dev/null 2>&1 &
+ child_pids="$child_pids $!"
+
+ create_write_fs $pool $loop
+done
+
+#
+# Monitor stress processes until they exit or timed out
+#
+stress_timeout $STRESS_TIMEOUT $child_pids
+
+log_pass
View
34 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/setup
@@ -0,0 +1,34 @@
+#!/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 "@(#)setup.ksh 1.1 07/10/09 SMI"
+#
+
+. ${STF_SUITE}/include/libtest.kshlib
+
+setup_raidzs $NUMBER_OF_MIRRORS $DISKS
+
+log_pass
View
25 ZFS-Test_Suite/tests/stress/replica_stress/raidz_stress_001/stf_description
@@ -0,0 +1,25 @@
+STF_BUILD_MODES="none"
+STF_EXECUTE_MODES="sparc sparc-f64 sparcv9 i386 i386-f64 amd64"
+
+STF_ROOT_CHECKENV=""
+STF_USER_CHECKENV=""
+STF_ROOT_CONFIGURE=""
+STF_USER_CONFIGURE=""
+STF_ROOT_UNCONFIGURE=""
+STF_USER_UNCONFIGURE=""
+STF_ROOT_SETUP="setup"
+STF_USER_SETUP=""
+STF_ROOT_CLEANUP="cleanup"
+STF_USER_CLEANUP=""