Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 2017 07:32:57 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r316954 - user/pho/stress2/misc
Message-ID:  <201704150732.v3F7WvZs096921@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Sat Apr 15 07:32:57 2017
New Revision: 316954
URL: https://svnweb.freebsd.org/changeset/base/316954

Log:
  Added gmirror(8) regression tests.
  
  Sponsored by:	Dell EMC Isilon

Added:
  user/pho/stress2/misc/graid1_2.sh   (contents, props changed)
  user/pho/stress2/misc/graid1_3.sh   (contents, props changed)
  user/pho/stress2/misc/graid1_4.sh   (contents, props changed)
  user/pho/stress2/misc/graid1_5.sh   (contents, props changed)
  user/pho/stress2/misc/graid1_6.sh   (contents, props changed)
  user/pho/stress2/misc/graid1_7.sh   (contents, props changed)

Added: user/pho/stress2/misc/graid1_2.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_2.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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 scenario by Mark Johnston <markj@FreeBSD.org>
+# "physwr DL /tmp/graid1_2 /dev/mirror/test" seen.
+# Fixed by r307691.
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+dir=/tmp
+odir=`pwd`
+cd $dir
+sed '1,/^EOF/d' < $odir/$0 > $dir/graid1_2.c
+mycc -o graid1_2 -Wall -Wextra -O0 -g graid1_2.c || exit 1
+rm -f graid1_2.c
+cd $odir
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+    sysctl kern.geom.mirror.debug=$old > /dev/null
+
+md1=$mdstart
+md2=$((mdstart + 1))
+s=0
+size=$((128 * 1024))
+
+for u in $md1 $md2; do
+	dd if=/dev/zero of=/tmp/graid1_2_di$u bs=$size count=1 2>&1 | \
+	    egrep -v "records|transferred"
+	[ -c /dev/md$u ] && mdconfig -d -u $u
+	mdconfig -a -t vnode -f /tmp/graid1_2_di$u -u $u
+done
+gmirror label test /dev/md$md1 /dev/md$md2 || exit 1
+[ -c /dev/mirror/test ] || exit 1
+
+for i in `jot 150`; do /tmp/graid1_2 /dev/mirror/test; done &
+
+sleep 5
+start=`date '+%s'`
+while [ $((`date '+%s'` - start)) -lt 300 ]; do
+	gmirror rebuild test /dev/md$md1
+	sleep 2
+	n=0
+	while ps -l | grep -v grep | grep graid1_2 | grep -q D; do
+		opid=$pid
+		pid=`pgrep graid1_2`
+		[ -z "$pid" -o "$pid" != "$opid" ] && n=0
+		sleep 1
+		n=$((n + 1))
+		if [ $n -gt 180 ]; then
+			echo FAIL
+			ps -l | grep -v grep | grep graid1_2 | grep D
+			exit 1
+		fi
+	done
+done
+kill $! 2>/dev/null
+pkill graid1_2
+wait
+
+while mount | grep $mntpoint | grep -q /mirror/; do
+	umount $mntpoint || sleep 1
+done
+gmirror stop test || s=2
+[ $unload ] && gmirror unload
+
+for u in $md3 $md2 $md1; do
+	mdconfig -d -u $u || s=4
+done
+rm -d /tmp/graid1_2 /tmp/graid1_2_di?
+exit $s
+EOF
+/* Write last sector on disk */
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
+static char buf[512];
+
+int
+main(int argc __unused, char *argv[])
+{
+	time_t start;
+	int fd;
+
+	if ((fd = open(argv[1], O_RDWR)) == -1)
+		err(1, "open(%s)", argv[1]);
+	start = time(NULL);
+	while (time(NULL) - start < 2) {
+			if (lseek(fd, 254 * sizeof(buf), SEEK_SET) == -1)
+			err(1, "seek");
+		if (write(fd, buf, sizeof(buf)) != sizeof(buf))
+			err(1, "write");
+	}
+	close(fd);
+
+	return (0);
+}

Added: user/pho/stress2/misc/graid1_3.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_3.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,94 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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$
+#
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+# Test scenario by Mark Johnston <markj@FreeBSD.org>
+
+# Page fault seen:
+# https://people.freebsd.org/~pho/stress/log/graid1_3.txt
+
+. ../default.cfg
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/markj-mirror ] &&
+    { gmirror stop markj-mirror; gmirror destroy markj-mirror; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+    sysctl kern.geom.mirror.debug=$old > /dev/null
+u1=$mdstart
+u2=$((mdstart + 1))
+size=$((5 * 1024  * 1024))
+for u in $u1 $u2; do
+	dd if=/dev/zero of=/tmp/graid1_2_di$u bs=$size count=1 2>&1 | \
+	    egrep -v "records|transferred"
+	[ -c /dev/md$u ] && mdconfig -d -u $u
+	mdconfig -a -t vnode -f /tmp/graid1_2_di$u -u $u
+done
+set -e
+
+(
+gpart create -s GPT md$u1
+gpart create -s GPT md$u2
+gpart add -t freebsd-ufs -s 1M md$u1
+gpart add -t freebsd-ufs -s 1M md$u2
+) > /dev/null
+
+gmirror label markj-mirror md${u1}p1
+set +e
+
+while true; do
+	gmirror label markj-mirror md${u1}p1
+       	gmirror destroy markj-mirror
+done 2>/dev/null &
+pid1=$!
+while true; do
+	gmirror insert markj-mirror md${u2}p1
+	gmirror remove markj-mirror md${u2}p1
+done 2>/dev/null &
+pid2=$!
+
+for i in `jot 60`; do
+	gmirror list markj-mirror
+	sleep 1
+done > /dev/null 2>&1
+sleep 60
+
+kill $pid1 $pid2
+wait
+sleep 1
+
+gmirror remove markj-mirror md${u2}p1 > /dev/null 2>&1
+gmirror destroy markj-mirror > /dev/null 2>&1
+
+mdconfig -d -u $u1 || exit 1
+mdconfig -d -u $u2 || exit 1
+rm -f /tmp/graid1_2_di*
+exit 0

Added: user/pho/stress2/misc/graid1_4.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_4.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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$
+#
+
+# Non UFS SU gmirror stop -f test.
+
+# Page fault seen:
+# https://people.freebsd.org/~pho/stress/log/graid1_4.txt
+# Fixed in r316867
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+rm -f ${diskimage}*
+need=1024 # MB
+[ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \
+    $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+    sysctl kern.geom.mirror.debug=$old > /dev/null
+
+md1=$mdstart
+md2=$((mdstart + 1))
+
+s=0
+for u in $md1 $md2; do
+	disk="$diskimage.$u"
+	dd if=/dev/zero of=$disk bs=1m count=512 2>&1 | \
+	    egrep -v "records|transferred"
+	[ -c /dev/md$u ] && mdconfig -d -u $u
+	mdconfig -a -t vnode -f $disk -u $u
+done
+
+gmirror label -v -b split -s 2048 test /dev/md$md1 /dev/md$md2 \
+    > /dev/null || exit 1
+[ -c /dev/mirror/test ] || exit 1
+# Soft Updates issues with removal of backing media
+newfs /dev/mirror/test > /dev/null
+mount /dev/mirror/test $mntpoint
+chmod 777 $mntpoint
+
+export runRUNTIME=10m
+export RUNDIR=$mntpoint/stressX
+
+su $testuser -c 'cd ..; ./run.sh marcus.cfg' &
+
+while kill -0 $! > /dev/null 2>&1; do
+	sleep `jot -r 1 1 5`
+	gmirror remove test md$md2
+	sleep `jot -r 1 1 5`
+	gmirror insert test md$md2
+done
+wait
+
+gmirror stop -f test # Note the stop *before* umount
+
+while mount | grep $mntpoint | grep -q /mirror/; do
+	umount $mntpoint || sleep 1
+done
+gmirror stop test || s=1
+gmirror destroy test 2>/dev/null
+[ $unload ] && gmirror unload
+
+for u in $md3 $md2 $md1; do
+	mdconfig -d -u $u || s=3
+done
+rm -f $diskimage*
+exit $s

Added: user/pho/stress2/misc/graid1_5.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_5.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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$
+#
+
+# Mirror tests with gnop(8) errors introduced in 2 out of three partitions.
+
+# No problems seen.
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+	sysctl kern.geom.mirror.debug=$old > /dev/null
+kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0; }
+gnop status || exit 0
+
+u1=$mdstart
+u2=$((mdstart + 1))
+u3=$((mdstart + 2))
+s=0
+for u in $u1 $u2 $u3; do
+	[ -c /dev/md$u ] && mdconfig -d -u $u
+	mdconfig -a -t swap -s 341m -u $u
+	gpart create -s GPT md$u
+done > /dev/null
+
+set -e
+(
+gpart add -t freebsd-ufs -s 340m md$u1
+gpart add -t freebsd-ufs -s 340m md$u2
+gpart add -t freebsd-ufs -s 340m md$u3
+) > /dev/null
+gnop create md$u2
+gnop create md$u3
+gmirror label test md${u1}p1 md${u2}.nopp1 md${u3}.nopp1
+[ -c /dev/mirror/test ] || exit 1
+
+newfs /dev/mirror/test > /dev/null
+mount /dev/mirror/test $mntpoint
+set +e
+chmod 777 $mntpoint
+
+export runRUNTIME=5m
+export RUNDIR=$mntpoint/stressX
+rm -rf /tmp/stressX.control
+
+su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 &
+pid=$!
+
+gnop configure -r 0 -w 1 md${u2}.nop
+gnop configure -r 0 -w 1 md${u3}.nop
+while kill -0 $pid > /dev/null 2>&1; do
+	if ! gmirror status test | grep -q md${u2}.nopp1; then
+		gmirror forget test
+		gmirror remove test md${u2}.nopp1 2>/dev/null
+		gmirror insert test md${u2}.nopp1 2>/dev/null
+	fi
+	if ! gmirror status test | grep -q md${u3}.nopp1; then
+		gmirror forget test
+		gmirror remove test md${u3}.nopp1 2>/dev/null
+		gmirror insert test md${u3}.nopp1 2>/dev/null
+	fi
+	sleep 1
+done
+wait
+
+while mount | grep $mntpoint | grep -q /mirror/; do
+	umount $mntpoint || sleep 5
+done
+while gmirror status test | grep -q SYNCHRONIZING; do sleep 10; done
+for i in `jot 10`; do
+	gmirror stop test && break || sleep 30
+done
+[ $i -eq 10 ] && s=1
+gmirror destroy test 2>/dev/null
+[ $unload ] && gmirror unload
+
+for u in $u1 $u2 $u3; do
+	mdconfig -d -u $u || s=3
+done
+exit $s

Added: user/pho/stress2/misc/graid1_6.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_6.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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 graid1_4.sh
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+rm -f ${diskimage}*
+need=1024 # MB
+[ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` -lt \
+    $need ] && printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+    sysctl kern.geom.mirror.debug=$old > /dev/null
+
+md1=$mdstart
+md2=$((mdstart + 1))
+
+s=0
+for u in $md1 $md2; do
+	disk="$diskimage.$u"
+	dd if=/dev/zero of=$disk bs=1m count=512 2>&1 | \
+	    egrep -v "records|transferred"
+	[ -c /dev/md$u ] && mdconfig -d -u $u
+	mdconfig -a -t vnode -f $disk -u $u
+done
+
+gmirror label -v -b split -s 2048 test /dev/md$md1 /dev/md$md2 \
+    > /dev/null || exit 1
+[ -c /dev/mirror/test ] || exit 1
+newfs $newfs_flags /dev/mirror/test > /dev/null
+mount /dev/mirror/test $mntpoint
+chmod 777 $mntpoint
+
+export runRUNTIME=4m
+export RUNDIR=$mntpoint/stressX
+
+su $testuser -c 'cd ..; ./run.sh marcus.cfg' &
+
+while kill -0 $! > /dev/null 2>&1; do
+	sleep `jot -r 1 1 5`
+	gmirror remove test md$md2
+	sleep `jot -r 1 1 5`
+	gmirror insert test md$md2
+done
+wait
+
+while mount | grep $mntpoint | grep -q /mirror/; do
+	umount $mntpoint || sleep 1
+done
+gmirror stop -f test ||s=1
+gmirror destroy test 2>/dev/null
+[ $unload ] && gmirror unload
+
+for u in $md3 $md2 $md1; do
+	mdconfig -d -u $u || s=3
+done
+rm -f $diskimage*
+exit $s

Added: user/pho/stress2/misc/graid1_7.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/pho/stress2/misc/graid1_7.sh	Sat Apr 15 07:32:57 2017	(r316954)
@@ -0,0 +1,110 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2017 Dell EMC Isilon
+# 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$
+#
+
+# Component looses it's name:
+# g_dev_taste: make_dev_p() failed
+# (gp->name=gptid/7c598e03-19cb-11e7-b62b-001e6756c168, error=17)
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+
+. ../default.cfg
+
+gmirror load > /dev/null 2>&1 && unload=1
+[ -c /dev/mirror/test ] && { gmirror stop test; gmirror destroy test; }
+old=`sysctl -n kern.geom.mirror.debug`
+sysctl kern.geom.mirror.debug=-1 | grep -q -- -1 ||
+    sysctl kern.geom.mirror.debug=$old > /dev/null
+kldstat | grep -q geom_nop || { gnop load 2>/dev/null || exit 0; }
+gnop status || exit 0
+
+u1=$mdstart
+s=0
+[ -c /dev/md$u1 ] && mdconfig -d -u $u1
+mdconfig -a -t swap -s 1g -u $u1
+
+set -e
+(
+gpart create -s GPT md$u1
+gpart add -t freebsd-ufs -s 341m md$u1
+gpart add -t freebsd-ufs -s 341m md$u1
+gpart add -t freebsd-ufs -s 341m md$u1
+) > /dev/null
+gmirror label test md${u1}p1 md${u1}p2 md${u1}p3
+[ -c /dev/mirror/test ] || exit 1
+
+newfs /dev/mirror/test > /dev/null
+mount /dev/mirror/test $mntpoint
+set +e
+chmod 777 $mntpoint
+
+export runRUNTIME=5m
+export RUNDIR=$mntpoint/stressX
+rm -rf /tmp/stressX.control
+
+su $testuser -c 'cd ..; ./run.sh io.cfg' > /dev/null 2>&1 &
+pid=$!
+
+sleep 2
+cont=/tmp/graid1_7.cont
+touch $cont
+for i in `jot 8`; do
+	while [ -f $cont ]; do
+		for u in md${u1}p2 md${u1}p3; do
+			gmirror forget test
+			gmirror remove test $u
+			gmirror insert test $u
+			id=`gmirror status test | grep gptid | awk '{print $1}'`
+			if [ $i -eq 1 -a -n "$id" ]; then
+				echo "FAIL Remove component $id"
+				gmirror remove test $id
+			fi
+		done 2>/dev/null
+	done &
+done
+while kill -0 $pid 2>/dev/null; do sleep 5; done
+rm $cont
+wait
+gmirror status test | grep -qw md${u1}p2 || gmirror insert test md${u1}p2
+gmirror status test | grep -qw md${u1}p3 || gmirror insert test md${u1}p3
+while ! gmirror status test | grep -q COMPLETE; do sleep 5; done
+
+while mount | grep $mntpoint | grep -q /mirror/; do
+	umount $mntpoint || sleep 5
+done
+while gmirror status test | grep -q SYNCHRONIZING; do sleep 10; done
+for i in `jot 10`; do
+	gmirror stop test && break || sleep 30
+done
+[ $i -eq 10 ] && s=1
+gmirror destroy test 2>/dev/null
+[ $unload ] && gmirror unload
+
+mdconfig -d -u $mdstart || s=3
+exit $s



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