svn commit: r228951 - projects/stress2/misc
Peter Holm
pho at FreeBSD.org
Thu Dec 29 11:38:03 UTC 2011
Author: pho
Date: Thu Dec 29 11:38:02 2011
New Revision: 228951
URL: http://svn.freebsd.org/changeset/base/228951
Log:
Use the global configuration file for MD(4) operations. Limit run time to
half an hour.
Modified:
projects/stress2/misc/snap4.sh
Modified: projects/stress2/misc/snap4.sh
==============================================================================
--- projects/stress2/misc/snap4.sh Thu Dec 29 11:37:15 2011 (r228950)
+++ projects/stress2/misc/snap4.sh Thu Dec 29 11:38:02 2011 (r228951)
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2008 Peter Holm <pho at FreeBSD.org>
+# Copyright (c) 2008, 2011 Peter Holm <pho at FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -32,21 +32,24 @@
# Test with snapshot file unlinked before unmount
-mount | grep "/dev/md0 on /mnt" > /dev/null && umount /mnt
-mdconfig -l | grep -q md0 && mdconfig -d -u 0
+. ../default.cfg
+
+mount | grep -q "/dev/md$mdstart on $mntpoint" && umount $mntpoint
+mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart
rm -f /tmp/.snap/pho
trap "rm -f /tmp/.snap/pho" 0
-for i in `jot 64`; do
+start=`date '+%s'`
+while [ `date '+%s'` -lt $((start + 1800)) ]; do
mksnap_ffs /tmp /tmp/.snap/pho
- mdconfig -a -t vnode -f /tmp/.snap/pho -u 0 -o readonly
- mount -o ro /dev/md0 /mnt
+ mdconfig -a -t vnode -f /tmp/.snap/pho -u $mdstart -o readonly
+ mount -o ro /dev/md$mdstart $mntpoint
- ls -l /mnt > /dev/null
+ ls -l $mntpoint > /dev/null
rm -f /tmp/.snap/pho
sleep 1
- umount /mnt
- mdconfig -d -u 0
+ umount $mntpoint
+ mdconfig -d -u $mdstart
rm -f /tmp/.snap/pho
done
More information about the svn-src-projects
mailing list