From nobody Thu Nov 11 09:12:57 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBE7B183F99D; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqbbY5Rfcz3mJk; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B4261059; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AB9CveB033730; Thu, 11 Nov 2021 09:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AB9CvjG033729; Thu, 11 Nov 2021 09:12:57 GMT (envelope-from git) Date: Thu, 11 Nov 2021 09:12:57 GMT Message-Id: <202111110912.1AB9CvjG033729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 7e3c4b09a09e - main - stress2: Added two test scenarios for future gunion(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde commit 7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde Author: Peter Holm AuthorDate: 2021-11-11 09:11:49 +0000 Commit: Peter Holm CommitDate: 2021-11-11 09:11:49 +0000 stress2: Added two test scenarios for future gunion(8) --- tools/test/stress2/misc/gunion.sh | 83 +++++++++++++++++++++++++++++ tools/test/stress2/misc/gunion2.sh | 106 +++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) diff --git a/tools/test/stress2/misc/gunion.sh b/tools/test/stress2/misc/gunion.sh new file mode 100755 index 000000000000..6ba60de3f988 --- /dev/null +++ b/tools/test/stress2/misc/gunion.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# 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. +# + +# geom union test + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +kldstat -v | grep -q geom_union.ko || + { kldload geom_union.ko 2>/dev/null || exit 0; loaded=1; } +log=/tmp/gunion.sh.log +md1=$mdstart +md2=$((mdstart + 1)) +mp1=$mntpoint$md1 +mp2=$mntpoint$md2 +s=0 + +set -e +mdconfig -a -t swap -s 5g -u $md1 +newfs $newfs_flags -n /dev/md$md1 +mkdir -p $mp1 $mp2 +mount /dev/md$md1 $mp1 +cp -r ../../stress2 $mp1 +umount $mp1 + +mdconfig -a -t swap -s 5g -u $md2 +gunion create -v /dev/md$md2 /dev/md$md1 +mount /dev/md$md2-md$md1.union $mntpoint + +export RUNDIR=$mntpoint/stressX +export runRUNTIME=5m +export RUNTIME=2m +export CTRLDIR=$mntpoint/stressX.control + +set +e +chmod 777 $mntpoint +su $testuser -c \ + "(cd $mntpoint/stress2; ./run.sh marcus.cfg)" + +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +fsck_ffs -fyR /dev/md$md2-md$md1.union > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=2; cat $log; } +set +e +gunion commit /dev/md$md2-md$md1.union +gunion destroy /dev/md$md2-md$md1.union +fsck_ffs -fyR /dev/md$md1 > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=3; cat $log; } +mdconfig -d -u $md2 +mdconfig -d -u $md1 +rm -f $log +[ loaded ] && gunion unload +exit $s diff --git a/tools/test/stress2/misc/gunion2.sh b/tools/test/stress2/misc/gunion2.sh new file mode 100755 index 000000000000..e6a7ab6331cb --- /dev/null +++ b/tools/test/stress2/misc/gunion2.sh @@ -0,0 +1,106 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# 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. +# + +# geom union test + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +kldstat -v | grep -q geom_union.ko || + { kldload geom_union.ko 2>/dev/null || exit 0; loaded=1; } +log=/tmp/gunion2.sh.log +md1=$mdstart +md2=$((mdstart + 1)) +mp1=$mntpoint$md1 +mp2=$mntpoint$md2 +s=0 + +set -e +mdconfig -a -t swap -s 5g -u $md1 +newfs $newfs_flags -n /dev/md$md1 > /dev/null +mkdir -p $mp1 $mp2 +mount /dev/md$md1 $mp1 +cp -r ../../stress2 $mp1 +umount $mp1 + +mdconfig -a -t swap -s 5g -u $md2 +gunion create -v /dev/md$md2 /dev/md$md1 +mount /dev/md$md2-md$md1.union $mntpoint + +export CTRLDIR=$mntpoint/stressX.control +export INCARNATIONS=10 +export LOAD=80 +export RUNDIR=$mntpoint/stressX +export runRUNTIME=5m +export rwLOAD=80 +export symlinkLOAD=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 +testcases/dirnprename/dirnprename +testcases/dirrename/dirrename +testcases/swap/swap +" +export TESTPROGS=`echo $TESTPROGS | sed 's/\n/ /g'` + +set +e +chmod 777 $mntpoint +su $testuser -c \ + "(cd $mntpoint/stress2; ./testcases/run/run $TESTPROGS)" + +n=`find $mntpoint/stressX | wc -l` +[ $n -eq 1 ] && s=0 || s=1 +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +fsck_ffs -fyR /dev/md$md2-md$md1.union > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=2; cat $log; } +set +e +gunion commit /dev/md$md2-md$md1.union +gunion destroy /dev/md$md2-md$md1.union +fsck_ffs -fyR /dev/md$md1 > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=3; cat $log; } +mdconfig -d -u $md2 +mdconfig -d -u $md1 +rm -f $log +[ loaded ] && gunion unload +exit $s