From nobody Wed Dec 15 08:57:50 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 22AF218ECCBB; Wed, 15 Dec 2021 08:57:51 +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 4JDTfQ5qTWz4Wmv; Wed, 15 Dec 2021 08:57:50 +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 A285E18F51; Wed, 15 Dec 2021 08:57:50 +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 1BF8votN094342; Wed, 15 Dec 2021 08:57:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BF8vopa094341; Wed, 15 Dec 2021 08:57:50 GMT (envelope-from git) Date: Wed, 15 Dec 2021 08:57:50 GMT Message-Id: <202112150857.1BF8vopa094341@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: 8296d2f9a3bf - main - stress2: Added 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: 8296d2f9a3bf8e68de2f8e3f98f911b9b9542dad Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639558670; 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=ZJnYx/adIaoomdcuFMhCEu+QbfK+gkCBNGx644SKo2g=; b=HXbN6HronexfHfM3KA0rnBFurgOpFwrczWuuDke2P856Bl5rAoHNr9Oi9+yjxP+JW5cz/Y FI83l6vBAMDwtl/1AKt+KqOHN6pv7y5hKpgYbzAZ5DSujje26AoM05i7HoFYkxFvdN3vH3 DKHb8DoOxGJeur2fTjR8PYyUwIII3AMqziNgPyPJMVpwIYEMGSYfFFdYV171ORGpK3ERAH yF9W6eW6RksIsMLbn5Uqqtocx4VUM/dsSSFn2ATT/bewrnfNhmpBwusjnEMwMD/F5xBZPm 1fzihK4SJ2lR45s/ig7VlJMQertgzg8LYlWhDvDo4gPUvy7F6ZUljjRpZsaFmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639558670; a=rsa-sha256; cv=none; b=NCd0CBBYRWZzmkHrWNVGEwndj1aIBQSZ41up12EU758kGNtLN2pOxIPAUanH2R12tWcfZr Z6wOOU0+9pg/Y2Z+qRNnpFNAjMxkZI8jOsnJR7pBncYXNOc4iA2+dqjuGWepFARlfs/NoD UanC2a7oHXhlKfh1pckGRTIRYGErGsem1iTQiNq84gHY4N8lSp6FEuH/4XITxwPldDpYOV NZoBXiAZzzA8kGWXYoZTjkTP8XPr6WkwhSujqV+x07AeKYSmz0IX1yObtA89QfrUIm/MRH 8JCnl6x4Qwm9EJWJMIay6/7z8fytJBSBu0ccSpYGSgTPRdhiiJm0r6cQsbvWEA== 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=8296d2f9a3bf8e68de2f8e3f98f911b9b9542dad commit 8296d2f9a3bf8e68de2f8e3f98f911b9b9542dad Author: Peter Holm AuthorDate: 2021-12-15 08:57:15 +0000 Commit: Peter Holm CommitDate: 2021-12-15 08:57:15 +0000 stress2: Added new tests --- tools/test/stress2/misc/all.exclude | 1 + tools/test/stress2/misc/avx_sig.sh | 16 +++++ tools/test/stress2/misc/unionfs7.sh | 103 ++++++++++++++++++++++++++++++++ tools/test/stress2/misc/vm_fault.sh | 113 ++++++++++++++++++++++++++++++++++++ 4 files changed, 233 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index f14a83668079..0898673a53e3 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -73,6 +73,7 @@ syzkaller43.sh WiP 20210906 syzkaller46.sh WiP 20210925 syzkaller47.sh WiP 20210925 truss3.sh WiP 20200915 +unionfs7.sh https://people.freebsd.org/~pho/stress/log/log0202.txt 20211215 # Test not to run for other reasons: diff --git a/tools/test/stress2/misc/avx_sig.sh b/tools/test/stress2/misc/avx_sig.sh new file mode 100755 index 000000000000..2a328daa340d --- /dev/null +++ b/tools/test/stress2/misc/avx_sig.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Test AVX context integrity under ctx switches and signals (amd64) + +src=/usr/src/tools/test/avx_sig/avx_sig.c +[ -f $src ] || exit 0 +[ `uname -p` != "amd64" ] && exit 0 + +cd /tmp +cc -Wall -Wextra -O -g -o avx_sig $src -lpthread || exit 1 + +timeout 1m /tmp/avx_sig; s=$? +[ $s -eq 124 ] && s=0 + +rm /tmp/avx_sig +exit $s diff --git a/tools/test/stress2/misc/unionfs7.sh b/tools/test/stress2/misc/unionfs7.sh new file mode 100755 index 000000000000..58fad6183517 --- /dev/null +++ b/tools/test/stress2/misc/unionfs7.sh @@ -0,0 +1,103 @@ +#!/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. +# + +# unionfs(8) test + +# "unionfs_get_node_status: 0xfffffe018f356770 is not exclusive locked but +# should be" seen. +# https://people.freebsd.org/~pho/stress/log/log0202.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +md1=$mdstart +md2=$((md1 + 1)) +mp1=/mnt$md1 +mp2=/mnt$md2 +mkdir -p $mp1 $mp2 +set -e +for i in $mp1 $mp2; do + mount | grep -q "on $i " && umount -f $i +done +for i in $md1 $md2; do + mdconfig -l | grep -q md$i && mdconfig -d -u $i +done + +mdconfig -a -t swap -s 4g -u $md1 +mdconfig -a -t swap -s 4g -u $md2 +newfs $newfs_flags -n md$md1 > /dev/null +newfs $newfs_flags -n md$md2 > /dev/null +mount /dev/md$md1 $mp1 +mount /dev/md$md2 $mp2 + +mount -t unionfs -o noatime $mp1 $mp2 +set +e +mount | grep -E "$mp1|$mp2" + +export CTRLDIR=$mp2/stressX.control +export INCARNATIONS=10 +export LOAD=80 +export RUNDIR=$mp2/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 +" + +cp -r ../../stress2 $mp2 +export TESTPROGS=`echo $TESTPROGS | sed 's/\n/ /g'` + +set +e +chmod 777 $mp2 +su $testuser -c \ + "(cd $mp2/stress2; ./testcases/run/run $TESTPROGS)" + +umount $mp2 # The unionfs mount +umount $mp2 +n=`find $mp1/stressX | wc -l` +[ $n -eq 1 ] && s=0 || { find $mp1/stressX -ls | head -12; s=1; } +umount $mp1 +mdconfig -d -u $md2 +mdconfig -d -u $md1 +exit $s diff --git a/tools/test/stress2/misc/vm_fault.sh b/tools/test/stress2/misc/vm_fault.sh new file mode 100755 index 000000000000..540aa609a301 --- /dev/null +++ b/tools/test/stress2/misc/vm_fault.sh @@ -0,0 +1,113 @@ +#!/bin/sh + +# Regression test for D33416 vm_fault: Fix vm_fault_populate()'s handling of VM_FAULT_WIRE +# Bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260347 + +# Test scenario by: martin + +# Fixed by 88642d978a99 + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ -d /usr/src/sys ] || exit 0 +builddir=`sysctl kern.version | grep @ | sed 's/.*://'` +[ -d "$builddir" ] && export KERNBUILDDIR=$builddir || exit 0 +export SYSDIR=`echo $builddir | sed 's#/sys.*#/sys#'` + +. ../default.cfg + +odir=`pwd` +dir=$RUNDIR/skeleton +mkdir -p $dir + +cd $dir +cat > skeleton.c < +#include +#include /* uprintf */ +#include +#include /* defines used in kernel.h */ +#include /* types used in module initialization */ + +#define BUFFER_SIZE 10*1000*1024 // 10 MB +static char gBuffer[BUFFER_SIZE]; + +static int demo_init (void) +{ + for (int i=0; i Makefile < +EOF + +make +old=`sysctl -n vm.stats.vm.v_wire_count` +kldload $dir/skeleton.ko +kldunload $dir/skeleton.ko +leak=$((`sysctl -n vm.stats.vm.v_wire_count` - old)) +if [ $leak -gt 25 ]; then + echo "Test leaked $leak pages in the skeleton.ko module" + s=1 +else + s=0 +fi + +cd $odir +rm -rf $dir +exit $s