Permalink
Browse files

stress folder added

  • Loading branch information...
tushk2 committed Dec 3, 2010
1 parent 2de4152 commit 7f22056dfe852e0bae40779551bba2552b6c39fd
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
Binary file not shown.
Binary file not shown.
@@ -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
@@ -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
Oops, something went wrong.

0 comments on commit 7f22056

Please sign in to comment.