From nobody Tue Jun 04 07:40:09 2024 X-Original-To: dev-commits-src-main@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 4VtjDT2RX7z5Mklr; Tue, 04 Jun 2024 07:40:09 +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 4VtjDT1f62z4vh9; Tue, 4 Jun 2024 07:40:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717486809; 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=ejINXpiHP0q2AF/E/7BfniJFbWBIrfNxYm3cOsmKNVU=; b=s00WDxA38zbtAtcnYLuL5i/8Qui2JGCLcH7XgmNJwPssdI5oikLlC/PBQkEMpBqEp6+B7G 9cZYNVrY0fGfoWmRy/sj/0LcobKCbeDlAj4b0K+EdEzFSZ4eP1JjS8AYgqWDzXTWUyWn+s cp99HTVJ7Al34PdiUJaOGFjnB6VrZC7fClLVswjGRTD52UMrOI5XfFS9j8Nex1tFC2wZZU 9IOkqo2MIhho0HljC0oiwy29CVoipV5TKIs9+/m0EJaf2JwHqumVBwQKU8o2RYUqd3q4fl PWtEyNW3ST4W9RLSnzWRCdLLHI7wPaUhRQjtVSiOSkfTNMU65cFn5zw0pkSPYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717486809; a=rsa-sha256; cv=none; b=ZutoqubhZsWJNAN4l/GN2ESAK0v94AIG+kZU6iPbNZjXtQBUdoki62vRfMtx/PllKagP5B Ub7YbdmnuMEml3XToQwpjNQVjbDX4L5FlbLZbqo9oNOjkJ/HfderqoQaTOxm+4VpuohpK2 9OEY3PzLaElMplO2kFw00RMP7OUR81LvmH11I5TimLb4cnqDr+zI8zXsNQ8cBSqGP4TMcg An+t/z8B9RtoM3PsLzi30+7bYgcpb3YRqcrEWfoslbkIrMn7eU+WhpFXiBA8RbTp62AMyk lnSnYqqx99nY7pUMjnKisbm4Sjfa6rdzDTeAThlUPq8a8RPb/+VOZ7GZ9F6AdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717486809; 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=ejINXpiHP0q2AF/E/7BfniJFbWBIrfNxYm3cOsmKNVU=; b=pawYV35x+U5kHhIK8OqpRP2WUY/hcm7tGXDNO/jiDWuY3hR4shcpBVb2SaVJcAfDcWKjHU X1tLV6v2wjGlrSkklj92heNdzxz5fq404a4Rb19XdV4lvIU893h1etU+Kv4oskFyPzht70 jgTqeUNuY03zTDXi7ntHoS8L196xLX2u5Rcxfpuh5PV+X9fCAZDgLjYwU1UroKPd4KhxDt DGywHEN1dsDRaKVSx46x836rfM4CFQS0I+ZVj4z7vEyzX6UQ9rCnf+m1w+MDc6Q6t7A8Gx dpGH+DFJPMCU5P9P5EARVQ5sl2yj0F4bTxiiDGB8l4/MWFb0QKosOAf9tf1jdw== 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 4VtjDT0ycvz18xC; Tue, 4 Jun 2024 07:40:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4547e9OY011463; Tue, 4 Jun 2024 07:40:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4547e91D011458; Tue, 4 Jun 2024 07:40:09 GMT (envelope-from git) Date: Tue, 4 Jun 2024 07:40:09 GMT Message-Id: <202406040740.4547e91D011458@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: 005dd61dd6d6 - main - stress2: Change fixed number of test loops to timed loops. This to improve testing with qemu. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 005dd61dd6d64a60bb01c27319cd457302e20aee Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=005dd61dd6d64a60bb01c27319cd457302e20aee commit 005dd61dd6d64a60bb01c27319cd457302e20aee Author: Peter Holm AuthorDate: 2024-06-04 07:39:40 +0000 Commit: Peter Holm CommitDate: 2024-06-04 07:39:40 +0000 stress2: Change fixed number of test loops to timed loops. This to improve testing with qemu. --- tools/test/stress2/misc/crossmp.sh | 3 ++- tools/test/stress2/misc/crossmp2.sh | 3 ++- tools/test/stress2/misc/crossmp5.sh | 5 ++++- tools/test/stress2/misc/crossmp6.sh | 3 ++- tools/test/stress2/misc/crossmp7.sh | 3 ++- tools/test/stress2/misc/flock_open_close.sh | 7 +++++-- tools/test/stress2/misc/gnop2.sh | 2 ++ tools/test/stress2/misc/mmap5.sh | 14 ++++++++------ tools/test/stress2/misc/procfs.sh | 3 ++- tools/test/stress2/misc/rename3.sh | 3 ++- tools/test/stress2/misc/rename7.sh | 6 ++++-- tools/test/stress2/misc/tmpfs2.sh | 6 ++++-- tools/test/stress2/misc/umountf4.sh | 6 ++++-- tools/test/stress2/misc/umountf6.sh | 6 ++++-- tools/test/stress2/misc/vunref.sh | 3 ++- 15 files changed, 49 insertions(+), 24 deletions(-) diff --git a/tools/test/stress2/misc/crossmp.sh b/tools/test/stress2/misc/crossmp.sh index 0bd07cea2aaf..b61506dcc477 100755 --- a/tools/test/stress2/misc/crossmp.sh +++ b/tools/test/stress2/misc/crossmp.sh @@ -74,7 +74,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount /dev/md${m} ${mntpoint}$m while mount | grep -q "on ${mntpoint}$m "; do diff --git a/tools/test/stress2/misc/crossmp2.sh b/tools/test/stress2/misc/crossmp2.sh index 03cd04e077c1..1f2f1a921e10 100755 --- a/tools/test/stress2/misc/crossmp2.sh +++ b/tools/test/stress2/misc/crossmp2.sh @@ -67,7 +67,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount -t nfs -o tcp -o nfsv3 -o retrycnt=3 \ -o intr,soft -o rw $nfs_export ${mntpoint}$m diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh index b5a8304f2dcb..038dea7ebe4f 100755 --- a/tools/test/stress2/misc/crossmp5.sh +++ b/tools/test/stress2/misc/crossmp5.sh @@ -74,8 +74,10 @@ else done else # The test: Parallel mount and unmount + i=0 m=$1 - for i in `jot 200`; do + 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` @@ -88,6 +90,7 @@ else echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 done + i=$((i + 1)) done rm -f /tmp/crossmp.continue fi diff --git a/tools/test/stress2/misc/crossmp6.sh b/tools/test/stress2/misc/crossmp6.sh index 92ca0abcba27..d5abd27f99f1 100755 --- a/tools/test/stress2/misc/crossmp6.sh +++ b/tools/test/stress2/misc/crossmp6.sh @@ -72,7 +72,8 @@ if [ $# -eq 0 ]; then exit 0 else if [ $1 = find ]; then - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -maxdepth 1 -type f > \ /dev/null 2>&1 (lockf -t 10 ${mntpoint}$2/$0.$$.$i sleep 1 &) > \ diff --git a/tools/test/stress2/misc/crossmp7.sh b/tools/test/stress2/misc/crossmp7.sh index c2c2752f38e7..f4f12e64c35f 100755 --- a/tools/test/stress2/misc/crossmp7.sh +++ b/tools/test/stress2/misc/crossmp7.sh @@ -91,7 +91,8 @@ else else # The test: Parallel mount and unmounts m=$1 - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do zfs mount stress2_tank/test$m zfs umount -f stress2_tank/test$m done 2>/dev/null diff --git a/tools/test/stress2/misc/flock_open_close.sh b/tools/test/stress2/misc/flock_open_close.sh index 01e376319abe..39b894da8a63 100755 --- a/tools/test/stress2/misc/flock_open_close.sh +++ b/tools/test/stress2/misc/flock_open_close.sh @@ -87,6 +87,7 @@ EOF #include #include #include +#include #include static void @@ -135,7 +136,8 @@ main(int ac, char **av) { struct stat sb; pid_t pid; - int e, i, status; + time_t start; + int e, status; if (ac < 2) usage(); @@ -150,7 +152,8 @@ main(int ac, char **av) if (pid == 0) child(av[1]); e = 0; - for (i = 0; i < 200000; i++) { + start = time(NULL); + while (time(NULL) - start < 150) { pid = fork(); if (pid < 0) err(1, "vfork"); diff --git a/tools/test/stress2/misc/gnop2.sh b/tools/test/stress2/misc/gnop2.sh index d38754d58456..0a6b830ce749 100755 --- a/tools/test/stress2/misc/gnop2.sh +++ b/tools/test/stress2/misc/gnop2.sh @@ -71,8 +71,10 @@ test() { gnop status || exit 1 +start=`date +%s` for i in 1k 2k 4k 8k; do test $i + [ $((`date +%s` - start)) -gt 1200 ] && break done [ $notloaded ] && gnop unload diff --git a/tools/test/stress2/misc/mmap5.sh b/tools/test/stress2/misc/mmap5.sh index e6dee6d551de..c7369118e0e2 100755 --- a/tools/test/stress2/misc/mmap5.sh +++ b/tools/test/stress2/misc/mmap5.sh @@ -52,15 +52,16 @@ rm -f /tmp/mmap5 /tmp/mmap5.inputfile exit EOF -#include -#include -#include +#include #include #include -#include #include #include #include +#include +#include +#include +#include #include const char *file; @@ -113,13 +114,14 @@ test(void) int main(int argc, char *argv[]) { - int i; + time_t start; if (argc != 2) errx(1, "Usage: %s ", argv[0]); file = argv[1]; - for (i = 0; i < 30000; i++) { + start = time(NULL); + while (time(NULL) - start < 120) { if (fork() == 0) test(); wait(NULL); diff --git a/tools/test/stress2/misc/procfs.sh b/tools/test/stress2/misc/procfs.sh index 6b445b0d7e48..a59235c6d521 100755 --- a/tools/test/stress2/misc/procfs.sh +++ b/tools/test/stress2/misc/procfs.sh @@ -56,7 +56,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount -t procfs proc ${mntpoint}$m while mount | grep -qw $mntpoint$m; do diff --git a/tools/test/stress2/misc/rename3.sh b/tools/test/stress2/misc/rename3.sh index c7ce91f0d359..aa4a3754bfab 100755 --- a/tools/test/stress2/misc/rename3.sh +++ b/tools/test/stress2/misc/rename3.sh @@ -36,7 +36,8 @@ # Test scenario by Tor Egge root=/tmp -for i in `jot 10000`; do +start=`date +%s` +while [ $((`date +%s` - start)) -lt 60 ]; do rm -rf $root/a mkdir -p $root/a/b/c/d/e/f/g mkdir -p $root/a/b/c/d/e/f/z diff --git a/tools/test/stress2/misc/rename7.sh b/tools/test/stress2/misc/rename7.sh index 9f6954916411..fdaa8f575117 100755 --- a/tools/test/stress2/misc/rename7.sh +++ b/tools/test/stress2/misc/rename7.sh @@ -122,7 +122,8 @@ int main(void) { pid_t wpid, spid; - int e, fd, i, status; + time_t start; + int e, fd, status; if ((wpid = fork()) == 0) r1(); @@ -132,7 +133,8 @@ main(void) setproctitle("main"); e = 0; - for (i = 0; i < 800000; i++) { + start = time(NULL); + while (time(NULL) - start < 60) { if ((fd = open(logfile, O_RDWR | O_CREAT | O_TRUNC, 0644)) == -1) warn("creat(%s)", logfile); close(fd); diff --git a/tools/test/stress2/misc/tmpfs2.sh b/tools/test/stress2/misc/tmpfs2.sh index 80885c331e14..09a2cfd68266 100755 --- a/tools/test/stress2/misc/tmpfs2.sh +++ b/tools/test/stress2/misc/tmpfs2.sh @@ -45,13 +45,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount -t tmpfs tmpfs ${mntpoint}$m diff --git a/tools/test/stress2/misc/umountf4.sh b/tools/test/stress2/misc/umountf4.sh index 4f5ea0fff660..e26555e7c6f3 100755 --- a/tools/test/stress2/misc/umountf4.sh +++ b/tools/test/stress2/misc/umountf4.sh @@ -65,13 +65,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount $opt /dev/md${m} ${mntpoint}$m diff --git a/tools/test/stress2/misc/umountf6.sh b/tools/test/stress2/misc/umountf6.sh index aeb4454ea69c..628342689b38 100755 --- a/tools/test/stress2/misc/umountf6.sh +++ b/tools/test/stress2/misc/umountf6.sh @@ -65,13 +65,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount $opt /dev/md${m} ${mntpoint}$m diff --git a/tools/test/stress2/misc/vunref.sh b/tools/test/stress2/misc/vunref.sh index f844a0dd3625..f08035a95694 100755 --- a/tools/test/stress2/misc/vunref.sh +++ b/tools/test/stress2/misc/vunref.sh @@ -82,7 +82,8 @@ if [ $# -eq 0 ]; then else if [ $1 = mmap ]; then touch $RUNDIR/active.$2 - for i in `jot 500`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do cd ${mntpoint}$2 /tmp/vunref > /dev/null 2>&1 cd /