Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 2013 06:56:43 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r247530 - user/pho/stress2/misc
Message-ID:  <201303010656.r216uh2Y031807@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Fri Mar  1 06:56:43 2013
New Revision: 247530
URL: http://svnweb.freebsd.org/changeset/base/247530

Log:
  Added two "umount -f" scenarios.

Added:
  user/pho/stress2/misc/umountf5.sh   (contents, props changed)
  user/pho/stress2/misc/umountf6.sh   (contents, props changed)

Added: user/pho/stress2/misc/umountf5.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/umountf5.sh	Fri Mar  1 06:56:43 2013	(r247530)
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2008-2013 Peter Holm <pho@FreeBSD.org>
+# All rights reserved.
+#
+# 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$
+#
+
+# Test with "umount -f" and SU
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+D=$diskimage
+dd if=/dev/zero of=$D$m bs=1m count=10 2>&1 |
+	egrep -v "records|transferred"
+
+mount | grep "$mntpoint" | grep md${mdstart}$part > /dev/null && umount $mntpoint
+mdconfig -l | grep md${mdstart} > /dev/null &&  mdconfig -d -u ${mdstart}
+
+mdconfig -a -t vnode -f $D -u ${mdstart}
+bsdlabel -w md${mdstart} auto
+newfs -U md${mdstart}$part > /dev/null 2>&1
+mount /dev/md${mdstart}$part $mntpoint
+
+export RUNDIR=$mntpoint/stressX
+export runRUNTIME=2m
+cd ..; ./run.sh vfs.cfg > /dev/null 2>&1 &
+pid=$!
+
+sleep 30
+
+umount -f $mntpoint
+mdconfig -d -u $mdstart
+rm -f $D
+
+while ps | egrep "testcases|swap|mkdir|creat" | grep -vq grep; do
+   ps | egrep "testcases|swap|mkdir|creat" | grep -v grep | awk '{print $1}' | xargs kill
+   sleep 1
+done

Added: user/pho/stress2/misc/umountf6.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/umountf6.sh	Fri Mar  1 06:56:43 2013	(r247530)
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2008-2013 Peter Holm <pho@FreeBSD.org>
+# All rights reserved.
+#
+# 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$
+#
+
+# Variation of umountf4.sh; FS with "soft updates"
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+mounts=15		# Number of parallel scripts
+mdstart=$mdstart	# Use md unit numbers from this point
+D=$diskimage
+
+if [ $# -eq 0 ]; then
+	for i in `jot $mounts`; do
+		m=$(( i + mdstart - 1 ))
+		[ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m
+		mount | grep "$mntpoint" | grep -q md$m && umount ${mntpoint}$m
+		mdconfig -l | grep -q md$m &&  mdconfig -d -u $m
+
+		dede $D$m 1m 10
+		dd if=/dev/zero of=$D$m bs=1m count=10 2>&1 |
+			egrep -v "records|transferred"
+		mdconfig -a -t vnode -f $D$m -u $m
+		bsdlabel -w md$m auto
+		newfs -U md${m}$part > /dev/null 2>&1
+	done
+
+	# start the parallel tests
+	for i in `jot $mounts`; do
+		m=$((i + mdstart - 1))
+		./$0 $m &
+		./$0 find &
+	done
+
+	for i in `jot $mounts`; do
+		wait; wait
+	done
+
+	for i in `jot $mounts`; do
+		m=$((i + mdstart - 1))
+		mdconfig -d -u $m
+		rm -f $D$m
+	done
+
+else
+	if [ $1 = find ]; then
+		for i in `jot 100`; do
+			find ${mntpoint}* -type f > /dev/null 2>&1
+		done
+	else
+
+		# The test: Parallel mount and unmounts
+		for i in `jot 100`; do
+			m=$1
+			opt=`[ $(( m % 2 )) -eq 0 ] && echo -f`
+			mount $opt /dev/md${m}$part ${mntpoint}$m
+			cp -r /usr/include/machine/a* ${mntpoint}$m
+			while mount | grep -qw $mntpoint$m; do
+				umount -f ${mntpoint}$m > /dev/null 2>&1
+			done
+		done
+	fi
+fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303010656.r216uh2Y031807>