From owner-svn-src-user@freebsd.org Thu Mar 5 09:19:28 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E031263637 for ; Thu, 5 Mar 2020 09:19:28 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Y4vN0LByz3Pg8; Thu, 5 Mar 2020 09:19:27 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE51D4EE7; Thu, 5 Mar 2020 09:19:26 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0259JQvp061431; Thu, 5 Mar 2020 09:19:26 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0259JQBj061430; Thu, 5 Mar 2020 09:19:26 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202003050919.0259JQBj061430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Thu, 5 Mar 2020 09:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r358667 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 358667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2020 09:19:28 -0000 Author: pho Date: Thu Mar 5 09:19:26 2020 New Revision: 358667 URL: https://svnweb.freebsd.org/changeset/base/358667 Log: Added an old test scenario. Added: user/pho/stress2/misc/fifo4.sh (contents, props changed) Added: user/pho/stress2/misc/fifo4.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/fifo4.sh Thu Mar 5 09:19:26 2020 (r358667) @@ -0,0 +1,82 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# 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. +# +# $FreeBSD$ +# + +# tmpfs(5) version of fifo2.sh +# No problems seen on HEAD. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +odir=`pwd` +cd /tmp +sed '1,/^EOF/d' < $odir/fifo2.sh > fifo2.c +rm -f /tmp/fifo2 +mycc -o fifo2 -Wall -Wextra -O2 -g fifo2.c -lpthread || exit 1 +rm -f fifo2.c + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint + +mount -o size=1g -t tmpfs tmpfs $mntpoint +chmod 777 $mntpoint +for i in `jot 5`; do + mkfifo $mntpoint/f$i + chmod 777 $mntpoint/f$i +done + +daemon sh -c "(cd $odir/../testcases/swap; ./swap -t 10m -i 20 -l 100)" > \ + /dev/null +sleeptime=12 +st=`date '+%s'` +while [ $((`date '+%s'` - st)) -lt $((10 * sleeptime)) ]; do + (cd $mntpoint; /tmp/fifo2) & + while ! pgrep -q fifo2; do :; done + start=`date '+%s'` + while [ $((`date '+%s'` - start)) -lt $sleeptime ]; do + pgrep -q fifo2 || break + sleep .5 + done + while pgrep -q fifo2; do pkill -9 fifo2; done + wait +done +pkill -9 swap fifo2 +while pgrep -q "swap|fifo2"; do pkill -9 swap fifo2; done + +for i in `jot 10`; do + mount | grep -q "on $mntpoint " && \ + umount $mntpoint > /dev/null 2>&1 && break + sleep 10 +done +s=0 +mount | grep -q "on $mntpoint " && + { echo "umount $mntpoint failed"; s=1; } +rm -f /tmp/fifo2 +exit $s