From nobody Thu Jan 13 07:08:56 2022 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 0F8481936868; Thu, 13 Jan 2022 07:08: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 4JZFsN6GCrz4b8Y; Thu, 13 Jan 2022 07:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642057736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+0KI19+WiuIiq1YVVvgAfRKgA6CyfzLfdSPdZITaZU=; b=u9skJnXLH1ayTYjuXIL8Vjcatngir+6ZxpPdYlOzY/aQPoleHogCxSPSCQ+ghPWPfBAT2c yZX3kuP4yV+DBYLAA9wXvUYkzV69vp2tsWcHfkkFFFcUwdsO5vgyvXjRuGP58N8Bs6F1VF 6BCtgwNMT56aWzA3SARnTdZECzCFUd8WfREqcLGzoO+3GFQmcbPKBsvRGyfSOFnqbSrRex 0gaG93cFa2IQF/4x5YLogcYUDcLyycSEwkTB8FG2QADfFXMyNRpgrok9u52WRstxUD69Io GCUsBNzfdxCNGHE3B6S3ARq2842hhFXUrlWPXTw1/HK0rrc1BaZe/CoRgHxTNA== 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 B907E1BB78; Thu, 13 Jan 2022 07:08:56 +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 20D78uQH082641; Thu, 13 Jan 2022 07:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20D78uxa082640; Thu, 13 Jan 2022 07:08:56 GMT (envelope-from git) Date: Thu, 13 Jan 2022 07:08:56 GMT Message-Id: <202201130708.20D78uxa082640@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: 48031e6caf0b - main - stress2: Added two new tests 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: 48031e6caf0bb666b2d60d87b2a3b05fd424d5c3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642057736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+0KI19+WiuIiq1YVVvgAfRKgA6CyfzLfdSPdZITaZU=; b=yXy0RdCyL8uf+ONiYplkcHYJKAHISqUVLRMLed3n8xD5YfI1+aJAA4b/rD0LlcPfFSKrmS NNIPU+eElRGTJMq00DunNZxD+UhUZ37QUhpFSYcBQmgrgkXQSTsWd8v1mecDu24Baq6pEP AYRB+ST7cJf0FTYpV6u885MAyWSBfMZ++3OdDvQs5CZYFllSdUx8DTmAo/k6w1QhaN1M8b b+wjYNdt72YVclBy2nA5dOh7hnVR1ZpaINwUvPyaZCMaH2mklKKvKNWHvVLW989UWeLhXn mElmERltCK/KIz/m7CRriN/D8P+pBB/3MsQjZdGxKLOLzTNclpN+2j9BvnlkIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642057736; a=rsa-sha256; cv=none; b=s8XBtJJ3rCWaHtjKKS/zFvpiS8tOT7tRyj7oRDBpQWIeGvgg5g34y9JVE279IajeYAhR8y h2G+cd9/f1GNE1a1F/bBNvTlza9YtY3XvUkwbfyioCEAz+M+JuPLz6x96hT6lV80EgZQEh p+WIIN1VdsrIBg5nB0m6C4UxgwpjDedzGDLXf/uv+ko5LHYa2Ki7wHRy8iWY6hIeqWdxRk MPQds1AcTZSBbniOmLw7pHNqkJXJGYcb3b3laUTCnnRVWrVS5P8EMlk5zD2hfJV6XAaXjY Tj+VSfPzr8jtGYzfTlVcZ83fMODkHyEg19rDkfNN/bFhct0ygOH2ZihIX9w0Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=48031e6caf0bb666b2d60d87b2a3b05fd424d5c3 commit 48031e6caf0bb666b2d60d87b2a3b05fd424d5c3 Author: Peter Holm AuthorDate: 2022-01-13 07:08:05 +0000 Commit: Peter Holm CommitDate: 2022-01-13 07:08:05 +0000 stress2: Added two new tests --- tools/test/stress2/misc/nullfs28.sh | 81 +++++++++++++++++++++++++++++++ tools/test/stress2/misc/unionfs14.sh | 94 ++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+) diff --git a/tools/test/stress2/misc/nullfs28.sh b/tools/test/stress2/misc/nullfs28.sh new file mode 100755 index 000000000000..3e313de6f64c --- /dev/null +++ b/tools/test/stress2/misc/nullfs28.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2022 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. +# + +# Scenario: mount -t nullfs /mnt /mnt + +# Seen: +# [root@mercat1 /home/pho]# ps -lUroot | grep -v grep | grep -E "find|umount" +# 0 23496 3144 0 52 0 12856 2544 ufs D+ 0 0:00.00 find /mnt -type f -maxdepth 2 -ls +# 0 23497 3126 6 52 0 12812 2512 mount dr D+ 0 0:00.00 umount /mnt +# [root@mercat1 /home/pho]# + +# Test suggestion by Jason Harmening: + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +nullfs_srcdir=$mntpoint +nullfs_dstdir=$mntpoint +runtime=300 + +set -e +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +newfs $newfs_flags md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +chmod 777 $mntpoint +set +e + +start=`date '+%s'` +while [ `date '+%s'` -lt $((start + $runtime)) ]; do + find $nullfs_dstdir -type f -maxdepth 2 -ls > \ + /dev/null 2>&1 +done & + +(cd ../testcases/swap; ./swap -t ${runtime}s -i 20) & +start=`date '+%s'` +while [ `date '+%s'` -lt $((start + $runtime)) ]; do + mount_nullfs $nullfs_srcdir $nullfs_dstdir + opt=$([ `jot -r 1 0 1` -eq 0 ] && echo "-f") + while mount | grep nullfs | grep -q ${nullfs_dstdir}; do + umount $opt $nullfs_dstdir + done +done > /dev/null 2>&1 +pkill swap +wait +n=0 +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 + n=$((n + 1)) + [ $n -gt 30 ] && { echo FAIL; status=2; } +done +mdconfig -d -u $mdstart +exit 0 diff --git a/tools/test/stress2/misc/unionfs14.sh b/tools/test/stress2/misc/unionfs14.sh new file mode 100755 index 000000000000..ca9fa3a5b274 --- /dev/null +++ b/tools/test/stress2/misc/unionfs14.sh @@ -0,0 +1,94 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2022 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. +# + +# Parallel mount and umount test. +# Copy of unionfs9.sh, with a subdirectory mount point. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +mounts=3 # Number of parallel scripts +CONT=/tmp/unionfs9.continue + +set -e +mdconfig -a -t swap -s 256m -u $mdstart +newfs $newfs_flags -n md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint + +for i in `jot $mounts $((mdstart + 2))`; do + mdconfig -a -t swap -s 512m -u $((mdstart + i)) + newfs $newfs_flags -n md$((mdstart + i)) > /dev/null + mkdir -p ${mntpoint}$i + mount /dev/md$((mdstart + i)) ${mntpoint}$i + mkdir -p ${mntpoint}$i/dir +done +set +e +echo Pre: +mount | grep mnt + +(cd $mntpoint; jot 500 | xargs touch) +(cd ../testcases/swap; ./swap -t 5m -i 20 > /dev/null) & + +# Start the parallel tests +touch $CONT +for i in `jot $mounts $((mdstart + 2))`; do + while [ -f $CONT ]; do + find ${mntpoint}$i -type f -maxdepth 2 -ls > \ + /dev/null 2>&1 + done & + # The test: Parallel mount and unmounts + start=`date +%s` + ( + while [ $((`date +%s` - start)) -lt 300 ]; do + mount_unionfs $mntpoint ${mntpoint}$i/dir + opt=$([ `jot -r 1 0 1` -eq 0 ] && echo "-f") + while mount | grep -q ${mntpoint}$i/dir; do + umount $opt ${mntpoint}$i/dir + done + done > /dev/null 2>&1 + rm -f $CONT + ) & +done +while [ -f $CONT ] ; do sleep 1; done +while pgrep -q swap; do pkill swap; done +wait +echo Post: +mount | grep mnt + +for i in `jot $mounts $((mdstart + 2))`; do + umount ${mntpoint}$i > /dev/null 2>&1 + mdconfig -d -u $((mdstart + i)) + rmdir ${mntpoint}$i +done +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 + [ $((n += 1)) -gt 300 ] && { echo FAIL; exit 1; } +done +mdconfig -d -u $mdstart +exit 0