Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2017 22:14:07 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326862 - head/tests/sys/geom/class/mirror
Message-ID:  <201712142214.vBEME7lx013943@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Dec 14 22:14:07 2017
New Revision: 326862
URL: https://svnweb.freebsd.org/changeset/base/326862

Log:
  Make indentation consistent with other tests, and use syncwait.
  
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/tests/sys/geom/class/mirror/8_test.sh
  head/tests/sys/geom/class/mirror/9_test.sh

Modified: head/tests/sys/geom/class/mirror/8_test.sh
==============================================================================
--- head/tests/sys/geom/class/mirror/8_test.sh	Thu Dec 14 22:11:35 2017	(r326861)
+++ head/tests/sys/geom/class/mirror/8_test.sh	Thu Dec 14 22:14:07 2017	(r326862)
@@ -35,9 +35,7 @@ devwait # This will take kern.geom.mirror.timeout seco
 
 # Re-attach the second mirror and wait for it to synchronize.
 us1=$(attach_md -t vnode -f $m2) || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-    sleep 1
-done
+syncwait
 
 # Verify the two mirrors are identical. Destroy the gmirror first so that
 # the mirror metadata is wiped; otherwise the metadata blocks will fail
@@ -45,9 +43,9 @@ done
 # command instead.
 gmirror destroy $name
 if cmp -s ${m1} ${m2}; then
-    echo "ok 1"
+	echo "ok 1"
 else
-    echo "not ok 1"
+	echo "not ok 1"
 fi
 
 rm -f $m1 $m2

Modified: head/tests/sys/geom/class/mirror/9_test.sh
==============================================================================
--- head/tests/sys/geom/class/mirror/9_test.sh	Thu Dec 14 22:11:35 2017	(r326861)
+++ head/tests/sys/geom/class/mirror/9_test.sh	Thu Dec 14 22:14:07 2017	(r326862)
@@ -33,9 +33,7 @@ sysctl debug.fail_point.g_mirror_metadata_write='off' 
 # Replace the broken mirror, and then stop the gmirror.
 gmirror forget $name || exit 1
 gmirror insert $name /dev/$us2 || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-    sleep 1
-done
+syncwait
 gmirror stop $name || exit 1
 
 # Restart the gmirror on the original two mirrors. One of them is broken,
@@ -49,14 +47,12 @@ dd if=/dev/random of=/dev/mirror/$name bs=$ddbs count=
 # the metadata blocks will fail the comparison. It would be nice to do this
 # with a "gmirror verify" command instead.
 gmirror activate $name /dev/$us2 || exit 1
-while [ $(gmirror status $name | grep ACTIVE | wc -l) -ne 2 ]; do
-    sleep 1
-done
+syncwait
 gmirror destroy $name || exit 1
 if cmp -s $m1 $m3; then
-    echo "ok 1"
+	echo "ok 1"
 else
-    echo "not ok 1"
+	echo "not ok 1"
 fi
 
 rm -f $m1 $m2 $m3



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