diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh index 849a09b81439..e0aa85617f9b 100755 --- a/tools/test/stress2/misc/buildkernel.sh +++ b/tools/test/stress2/misc/buildkernel.sh @@ -1,63 +1,64 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2021 Peter Holm # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Buildkernel test with SU . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -d /usr/src/sys ] || exit 0 set -e mount | grep -q "on $mntpoint " && umount $mntpoint mdconfig -a -t swap -s 5g -u $mdstart newfs $newfs_flags md$mdstart > /dev/null mount /dev/md$mdstart $mntpoint set +e cd /usr/src export MAKEOBJDIRPREFIX=$mntpoint/obj export TMPDIR=$mntpoint/tmp mkdir $TMPDIR chmod 0777 $TMPDIR log=$mntpoint/log p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap p=`jot -r 1 1 $p` echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" \ "TARGET=amd64 TARGET_ARCH=amd64" make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > $log 2>&1; s=$? [ $s -ne 0 ] && tail -50 $log while mount | grep -q "on $mntpoint "; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart exit $s diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh index 595b387c90ae..3b362ec7041a 100755 --- a/tools/test/stress2/misc/buildworld.sh +++ b/tools/test/stress2/misc/buildworld.sh @@ -1,66 +1,67 @@ #!/bin/sh # # Copyright (c) 2015 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # "panic: Invalid page 0xfffff8007f227cf0 on inact queue" seen. # https://people.freebsd.org/~pho/stress/log/buildworld.txt # Fixed by r289377 . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -d /usr/src/sys ] || exit 0 [ `sysctl -n hw.physmem` -gt $(( 2 * 1024 * 1024 * 1024)) ] && { echo "RAM must be clamped to 2GB or less for this test."; exit 0; } rm -f $diskimage [ `df -k $(dirname $diskimage) | tail -1 | awk '{print $4}'` -lt \ $((3 * 1024 * 1024)) ] && { echo "Need 3GB on `dirname $diskimage`"; \ exit 0; } mount | grep -q "on $mntpoint " && umount $mntpoint dd if=/dev/zero of=$diskimage bs=1m count=3k status=none trap "rm -f $diskimage" EXIT INT mdconfig -a -t vnode -f $diskimage -u $mdstart newfs $newfs_flags md$mdstart > /dev/null mount -o async /dev/md$mdstart $mntpoint cd /usr/src export MAKEOBJDIRPREFIX=$mntpoint/obj export TMPDIR=$mntpoint/tmp mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null while mount | grep -q "on $mntpoint "; do umount $mntpoint || sleep 1 done checkfs /dev/md$mdstart || s=$? mdconfig -d -u $mdstart exit $s diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh index 9c1eed97b7ea..3653cb1db5b4 100755 --- a/tools/test/stress2/misc/buildworld2.sh +++ b/tools/test/stress2/misc/buildworld2.sh @@ -1,57 +1,58 @@ #!/bin/sh # # Copyright (c) 2015 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # tmpfs version of buildworld.sh . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -d /usr/src/sys ] || exit 0 [ `swapinfo | wc -l` -eq 1 ] && exit 0 [ `sysctl -n hw.physmem` -gt $(( 2 * 1024 * 1024 * 1024)) ] && { echo "RAM must be clamped to 2GB or less."; exit 0; } mount | grep -q "on $mntpoint " && umount $mntpoint mount -t tmpfs tmpfs $mntpoint || exit 1 cd /usr/src export MAKEOBJDIRPREFIX=$mntpoint/obj export TMPDIR=$mntpoint/tmp mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \ > /dev/null & sleep $((20 * 60)) kill $! wait while mount | grep -q "on $mntpoint "; do umount $mntpoint || sleep 1 done diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh index 0c660cae8eae..e3bce2764c0c 100755 --- a/tools/test/stress2/misc/buildworld3.sh +++ b/tools/test/stress2/misc/buildworld3.sh @@ -1,94 +1,95 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2018 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Buildworld / quota test scenario. # "panic: chkdquot: missing dquot" seen # https://people.freebsd.org/~pho/stress/log/kostik1113.txt # Fixed in r338798 + r338799 . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ "`sysctl -in kern.features.ufs_quota`" != "1" ] && exit 0 [ -d /usr/src/sys ] || exit 0 mount | grep -q "on $mntpoint " && umount $mntpoint mdconfig -a -t swap -s 2g -u $mdstart newfs $newfs_flags md$mdstart > /dev/null export PATH_FSTAB=/tmp/fstab trap "rm -f $PATH_FSTAB" EXIT INT echo "/dev/md$mdstart $mntpoint ufs rw,userquota 2 2" > $PATH_FSTAB mount $mntpoint set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export QK=$(($1 / 2)) export QI=$(($2 / 2)) edquota -u -f $mntpoint -e \ ${mntpoint}:$((QK - 50)):$QK:$((QI - 50 )):$QI $testuser quotaon $mntpoint mount | grep $mntpoint cd /usr/src export MAKEOBJDIRPREFIX=$mntpoint/obj export TMPDIR=$mntpoint/tmp mkdir $TMPDIR $MAKEOBJDIRPREFIX chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Arbitrary cap su $testuser -c \ "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null" & sleep 2 start=`date +%s` while [ $((`date +%s` - start)) -lt 1200 ]; do kill -0 $! > /dev/null 2>&1 || break sleep 2 done kill $! > /dev/null 2>&1 # Let make run 50% of the time so quotaoff runs on an active FS [ `jot -r 1 0 1` -eq 1 ] && pkill -U$testuser make wait while ! quotaoff $mntpoint; do sync sleep 5 done pgrep -q -U$testuser make && pkill -U$testuser make export tmp=/tmp/$(basename $0).$$ quotacheck -v $mntpoint > $tmp 2>&1 grep -q failed $tmp && { cat $tmp; s=1; } while mount | grep -q "on $mntpoint "; do umount $mntpoint || sleep 1 done checkfs /dev/md$mdstart || s=$? mdconfig -d -u $mdstart rm -f $PATH_FSTAB exit $s diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh index 6c15a72a9dcb..d1d162120952 100755 --- a/tools/test/stress2/misc/buildworld4.sh +++ b/tools/test/stress2/misc/buildworld4.sh @@ -1,73 +1,74 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2018 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Buildworld test with SUJ # "fsync: giving up on dirty (error = 35): tag devfs, type VCHR" seen. . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -d /usr/src/sys ] || exit 0 rm -f $diskimage mount | grep -q "on $mntpoint " && umount $mntpoint mdconfig -a -t swap -s 5g -u $mdstart [ "$newfs_flags" = "-U" ] && newfs_flags="-j" newfs $newfs_flags md$mdstart > /dev/null mount /dev/md$mdstart $mntpoint mount | grep $mntpoint cd /usr/src export MAKEOBJDIRPREFIX=$mntpoint/obj export TMPDIR=$mntpoint/tmp mkdir $TMPDIR chmod 0777 $TMPDIR p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 16 ] && p=16 # Arbitrary cap [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4)) p=`jot -r 1 1 $p` echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 "\ "TARGET_ARCH=amd64" make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \ > /dev/null & sleep 1 start=`date +%s` while [ $((`date +%s` - start)) -lt 600 ]; do kill -0 $! > /dev/null 2>&1 || break sleep 30 done kill $! > /dev/null 2>&1 wait while mount | grep -q "on $mntpoint "; do umount $mntpoint || sleep 1 done checkfs /dev/md$mdstart; s=$? mdconfig -d -u $mdstart exit $s diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh index 5eecb936e900..32c625a1e4ad 100755 --- a/tools/test/stress2/misc/crossmp3.sh +++ b/tools/test/stress2/misc/crossmp3.sh @@ -1,111 +1,112 @@ #!/bin/sh # # Copyright (c) 2014 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Parallel mount and umount of file systems # "panic: Bad link elm 0xfffff8052a20cc00 prev->next != elm" seen: # http://people.freebsd.org/~pho/stress/log/crossmp3.txt # Fixed in r269853 # panic: softdep_waitidle: work added after flush: # http://people.freebsd.org/~pho/stress/log/crossmp3-2.txt, fixed by r273967. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg CONT=/tmp/crossmp3.continue if [ $# -eq 0 ]; then N=`sysctl -n hw.ncpu` + [ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2)) size=$((usermem / 1024 / 1024 / N)) echo "Using $N memory disks of size $size MB." mounts=$N # Number of parallel scripts for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) [ ! -d ${mntpoint}$m ] && { mkdir ${mntpoint}$m; chmod 755 ${mntpoint}$m; } mount | grep "${mntpoint}$m " | grep -q md$m && umount ${mntpoint}$m mdconfig -l | grep -q md$m && mdconfig -d -u $m mdconfig -a -t swap -s ${size}m -u $m newfs $newfs_flags md${m} > /dev/null 2>&1 done # start the parallel tests touch $CONT for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) ./$0 $m & ./$0 find & done wait for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) while mount | grep -q "on ${mntpoint}$m "; do umount ${mntpoint}$m && break sleep 1 done mdconfig -d -u $m done exit 0 else if [ $1 = find ]; then while [ -f $CONT ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else export runRUNTIME=20s # The test: Parallel mount and unmounts start=`date +%s` for i in `jot 3`; do m=$1 mount /dev/md${m} ${mntpoint}$m && chmod 777 ${mntpoint}$m export RUNDIR=${mntpoint}$m/stressX export CTRLDIR=${mntpoint}$m/stressX.control (cd ${mntpoint}$m && find . -delete) su $testuser -c 'cd ..; ./run.sh disk.cfg' > \ /dev/null 2>&1 while mount | grep -q "on ${mntpoint}$m "; do opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 [ -f $CONT ] || break 2 done [ $((`date +%s` - start)) -gt 600 ] && { echo "Timed out"; s=1; } done rm -f $CONT fi exit $s fi diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh index e22f969b72bb..21d22bee69e5 100755 --- a/tools/test/stress2/misc/crossmp4.sh +++ b/tools/test/stress2/misc/crossmp4.sh @@ -1,106 +1,107 @@ #!/bin/sh # # Copyright (c) 2014 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Parallel mount and umount of file systems. Nullfs version. # "panic: Lock (lockmgr) null not locked @ kern/vfs_default.c:523." seen. # http://people.freebsd.org/~pho/stress/log/kostik698.txt # Fixed by r269708. # Not fixed: https://people.freebsd.org/~pho/stress/log/kostik798.txt # https://people.freebsd.org/~pho/stress/log/kostik856.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 - 2)) CONT=/tmp/crossmp4.continue mounts=$N # Number of parallel scripts if [ $# -eq 0 ]; then mount | grep "$mntpoint" | grep -q md && umount $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s ${size}m -u $mdstart newfs $newfs_flags md$mdstart > /dev/null 2>&1 mount /dev/md$mdstart $mntpoint # start the parallel tests for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) ./$0 $m & ./$0 find & done wait while mount | grep -q "on $mntpoint "; do umount $mntpoint > /dev/null 2>&1 || sleep 1 done mdconfig -d -u $mdstart exit 0 else touch $CONT if [ $1 = find ]; then while [ -f $CONT ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else m=$1 set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` export KBLOCKS=$(($1 / N)) export INODES=$(($2 / N)) export runRUNTIME=1m export INCARNATIONS=4 # The test: Parallel mount and unmounts for i in `jot 4`; do [ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m mount -t nullfs $mntpoint ${mntpoint}$m mkdir -p ${mntpoint}$m/$m chmod 777 ${mntpoint}$m/$m export RUNDIR=${mntpoint}$m/$m/stressX export CTRLDIR=${mntpoint}$m/$m/stressX.control (cd ${mntpoint}$m/$m && find . -delete) su $testuser -c 'cd ..; ./run.sh disk.cfg' > \ /dev/null 2>&1 & sleep 30 while mount | grep -q "on ${mntpoint}$m "; do opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 done wait done rm -f $CONT fi fi diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh index 038dea7ebe4f..6e504d9f20ad 100755 --- a/tools/test/stress2/misc/crossmp5.sh +++ b/tools/test/stress2/misc/crossmp5.sh @@ -1,97 +1,98 @@ #!/bin/sh # # Copyright (c) 2014 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Variation of crossmp3.sh [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / N)) mounts=$N # Number of parallel scripts if [ $# -eq 0 ]; then for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) [ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m mount | grep "${mntpoint}$m " | grep -q md$m && umount ${mntpoint}$m mdconfig -l | grep -q md$m && mdconfig -d -u $m mdconfig -a -t swap -s ${size}m -u $m newfs $newfs_flags md${m} > /dev/null 2>&1 done # start the parallel tests for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) ./$0 $m & ./$0 find & done wait for i in `jot $mounts`; do m=$(( i + mdstart - 1 )) mdconfig -d -u $m rm -f $D$m done exit 0 else touch /tmp/crossmp.continue if [ $1 = find ]; then while [ -f /tmp/crossmp.continue ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmount i=0 m=$1 start=`date +%s` while [ $((`date +%s`- start)) -lt 300 ]; do mount /dev/md${m} ${mntpoint}$m chmod 777 ${mntpoint}$m l=`jot -r 1 65535` dd if=/dev/zero of=$mntpoint/$i bs=$l count=100 \ status=none rm -f $mntpoint/$i while mount | grep -q "on ${mntpoint}$m "; do opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 done i=$((i + 1)) done rm -f /tmp/crossmp.continue fi fi diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh index e877dfaf6d1c..eec5ba9bc7c1 100755 --- a/tools/test/stress2/misc/crossmp8.sh +++ b/tools/test/stress2/misc/crossmp8.sh @@ -1,124 +1,125 @@ #!/bin/sh # # Copyright (c) 2015 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Variation of crossmp3.sh. fifos and sockets added to load. # Not really a cross mount point test, but a test of the old # non-directory use of the vnode v_un union. # mckusick@ suggested using fifos for this test. # "panic: mtx_lock() of spin mutex @ ../kern/vfs_subr.c:512" seen. # https://people.freebsd.org/~pho/stress/log/crossmp8.txt # Fixed by r291671. [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg CONT=/tmp/crossmp8.continue N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / N)) mounts=$N # Number of parallel scripts if [ $# -eq 0 ]; then oldmx=`sysctl -n kern.maxvnodes` trap "sysctl kern.maxvnodes=$oldmx > /dev/null" EXIT SIGINT sysctl kern.maxvnodes=3072 > /dev/null for i in `jot $mounts`; do m=$((i + mdstart - 1)) [ ! -d ${mntpoint}$m ] && { mkdir ${mntpoint}$m; chmod 755 ${mntpoint}$m; } mount | grep "${mntpoint}$m " | grep -q md$m && umount ${mntpoint}$m mdconfig -l | grep -q md$m && mdconfig -d -u $m mdconfig -a -t swap -s ${size}m -u $m newfs md${m} > /dev/null 2>&1 done # start the parallel tests touch $CONT for i in `jot $mounts`; do m=$((i + mdstart - 1)) ./$0 $m & ./$0 find & done sleep 60 rm -f $CONT ../tools/killall.sh wait for i in `jot $mounts`; do m=$((i + mdstart - 1)) while mount | grep -q "on ${mntpoint}$m "; do umount ${mntpoint}$m && break sleep 1 done mdconfig -d -u $m done ./cleanup.sh exit 0 else if [ $1 = find ]; then while [ -f $CONT ]; do find ${mntpoint}* -maxdepth 1 -ls > /dev/null 2>&1 sleep .1 done else export RUNTIME=15s export runRUNTIME=15s # The test: Parallel mount and unmounts start=`date '+%s'` while [ $((`date '+%s'` - start)) -lt 300 ]; do m=$1 mount /dev/md${m} ${mntpoint}$m && chmod 777 ${mntpoint}$m export RUNDIR=${mntpoint}$m/stressX export CTRLDIR=${mntpoint}$m/stressX.control export mkfifoLOAD=80 export socketLOAD=80 export TP=" testcases/mkfifo/mkfifo testcases/mkdir/mkdir " (cd ${mntpoint}$m && find . -delete) su $testuser -c 'cd ..; ./testcases/run/run $TP' > \ /dev/null 2>&1 while mount | grep -q "on ${mntpoint}$m "; do opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 [ -f $CONT ] || break 2 done done rm -f $CONT fi fi diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh index f938dd3b790b..1b4da74266f6 100755 --- a/tools/test/stress2/misc/gnop4.sh +++ b/tools/test/stress2/misc/gnop4.sh @@ -1,76 +1,79 @@ #!/bin/sh # # Copyright (c) 2016 Dell EMC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # A 8k sector size test using buildworld. # "panic: DI already started" seen: # https://people.freebsd.org/~pho/stress/log/kostik1017.txt # Fixed by r322175 +# Seen with p=513: Threads stuck in "ffsrca" + . ../default.cfg gigs=9 [ $((`sysctl -n vm.swap_total` / 1024 / 1024 / 1024)) -lt $gigs ] && exit 0 [ -d /usr/src/sys ] || exit 0 kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0 && notloaded=1; } gnop status || exit 1 mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint [ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart set -e mdconfig -a -t swap -s ${gigs}g -u $mdstart gnop create -S 8k /dev/md$mdstart newfs $newfs_flags /dev/md$mdstart.nop > /dev/null mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint set +e (cd /usr; tar --exclude compile --exclude-vcs -cf - src) | \ (cd $mntpoint; tar xf -) cd $mntpoint/src export MAKEOBJDIRPREFIX=$mntpoint/obj p=$((`sysctl -n hw.ncpu`+ 1)) +[ $p -gt 32 ] && p=32 # Temporary work around timeout 10m \ make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ TARGET_ARCH=amd64 > /dev/null cd / while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done gnop destroy /dev/md$mdstart.nop mdconfig -d -u $mdstart [ $notloaded ] && gnop unload exit 0 diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh index 29b44cbc9ad4..231c42033f9d 100755 --- a/tools/test/stress2/misc/tmpfs13.sh +++ b/tools/test/stress2/misc/tmpfs13.sh @@ -1,95 +1,96 @@ #!/bin/sh # # Copyright (c) 2014 EMC Corp. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 # umount -f test scenario # "panic: deadlkres: possible deadlock detected..." seen. # http://people.freebsd.org/~pho/stress/log/tmpfs13.txt # Fixed by r269457. # "panic: vm_domainset_iter_first: Invalid domain 2" seen. # Fixed by r339075 . ../default.cfg N=`sysctl -n hw.ncpu` +[ $N -gt 32 ] && N=32 # Arbitrary cap usermem=`sysctl -n hw.usermem` [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) size=$((usermem / 1024 / 1024 / 2)) export runRUNTIME=15m export RUNDIR=$mp1/stressX export CTRLDIR=$mp1/stressX.control export LOAD=80 export symlinkLOAD=80 export rwLOAD=80 export TESTPROGS=" testcases/lockf2/lockf2 testcases/symlink/symlink testcases/openat/openat testcases/rw/rw testcases/fts/fts testcases/link/link testcases/lockf/lockf testcases/creat/creat testcases/mkdir/mkdir testcases/rename/rename testcases/mkfifo/mkfifo " for i in `jot $N 1`; do eval mp$i=${mntpoint}$i done for i in `jot $N 1`; do eval mp=\$mp$i [ -d $mp ] || mkdir -p $mp mount | grep $mp | grep -q tmpfs && umount -f $mp mount -o size=${size}m -t tmpfs tmpfs $mp chmod 777 $mp export RUNDIR=$mp/stressX export CTRLDIR=$mp/stressX.control su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > \ /dev/null 2>&1 & done sleep 60 for i in `jot $N 1`; do eval mp=\$mp$i while mount | grep "$mp " | grep -q tmpfs; do umount -f $mp || sleep 1 done done ../tools/killall.sh while pgrep -q swap; do pkill -9 swap done wait diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh index 2104eb156c86..e1bf867d8d5f 100755 --- a/tools/test/stress2/misc/zzbuildworld.sh +++ b/tools/test/stress2/misc/zzbuildworld.sh @@ -1,54 +1,55 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2019 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Run a "make buildworld" as last test in stress2/misc. . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 kernel=`sysctl -n kern.bootfile` kerneldir=`strings -a $kernel | egrep -m 1 "$(hostname).*/compile/" | sed 's/.*://;s/ .*//'` [ -z "$kerneldir" ] && { echo "Can not find kerneldir"; exit 1; } src=`echo $kerneldir | sed 's#/sys/.*##'` [ ! -d $src ] && { echo "Can not find source in $src"; exit 1; } start=`date +%s` mount | grep -q "on $mntpoint " && exit 1 mount -t tmpfs tmpfs $mntpoint top=$mntpoint export MAKEOBJDIRPREFIX=$top/obj export log=$top/buildworld.`date +%Y%m%dT%H%M` n=$((`sysctl -n hw.ncpu` + 1)) +[ $n -gt 32 ] && n=32 # Arbitrary cap cd $src make -j$n buildworld > $log 2>&1 && s=0 ||s=1 grep '\*\*\*' $log && s=2 stop=`date +%s` echo "Elapsed `date -u -j -f '%s' '+%H:%M' $((stop - start))`" [ $s -ne 0 ] && { xz $log; cp -a $log.xz /tmp; } umount $mntpoint exit $s