svn commit: r258977 - user/pho/stress2/misc

Peter Holm pho at FreeBSD.org
Thu Dec 5 11:46:58 UTC 2013


Author: pho
Date: Thu Dec  5 11:46:57 2013
New Revision: 258977
URL: http://svnweb.freebsd.org/changeset/base/258977

Log:
  Use PATH_FSTAB, shell script cleanup.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/quota3.sh
  user/pho/stress2/misc/quota6.sh
  user/pho/stress2/misc/quota7.sh

Modified: user/pho/stress2/misc/quota3.sh
==============================================================================
--- user/pho/stress2/misc/quota3.sh	Thu Dec  5 11:42:03 2013	(r258976)
+++ user/pho/stress2/misc/quota3.sh	Thu Dec  5 11:46:57 2013	(r258977)
@@ -33,30 +33,26 @@
 . ../default.cfg
 
 D=$diskimage
-trap "rm -f $D" 0
+export PATH_FSTAB=/tmp/fstab
+trap "rm -f $D $PATH_FSTAB" 0
 dede $D 1m 1k || exit 1
 
-mount | grep "${mntpoint}" | grep md${mdstart}${part} > /dev/null && umount ${mntpoint}
-mdconfig -l | grep md${mdstart} > /dev/null &&  mdconfig -d -u ${mdstart}
+mount | grep "${mntpoint}" | grep -q md${mdstart}$part && 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
-echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" >> /etc/fstab
+mdconfig -a -t vnode -f $D -u $mdstart
+bsdlabel -w md$mdstart auto
+newfs $newfs_flags  md${mdstart}$part > /dev/null
+echo "/dev/md${mdstart}$part $mntpoint ufs rw,userquota 2 2" > $PATH_FSTAB
 mount ${mntpoint}
-edquota -u -f ${mntpoint} -e ${mntpoint}:850000:900000:130000:140000 root
-quotacheck ${mntpoint}
-quotaon ${mntpoint}
-quota root
-df -i ${mntpoint}
-sed -i -e "/md${mdstart}${part}/d" /etc/fstab	# clean up before any panics
-mksnap_ffs ${mntpoint} ${mntpoint}/.snap/pho
-export RUNDIR=${mntpoint}/stressX
+edquota -u -f $mntpoint -e $mntpoint:850000:900000:130000:140000 root
+quotacheck $mntpoint
+quotaon $mntpoint
+mksnap_ffs $mntpoint $mntpoint/.snap/pho
+export RUNDIR=$mntpoint/stressX
 export runRUNTIME=10m            # Run tests for 10 minutes
 (cd ..; ./run.sh disk.cfg)
-false
-while mount | grep -q ${mntpoint}; do
-	umount ${mntpoint} > /dev/null 2>&1
+while mount | grep $mntpoint | grep -q /dev/md; do
+	umount $mntpoint || sleep 1
 done
-mdconfig -d -u ${mdstart}
-rm -f $D
+mdconfig -d -u $mdstart

Modified: user/pho/stress2/misc/quota6.sh
==============================================================================
--- user/pho/stress2/misc/quota6.sh	Thu Dec  5 11:42:03 2013	(r258976)
+++ user/pho/stress2/misc/quota6.sh	Thu Dec  5 11:46:57 2013	(r258977)
@@ -30,37 +30,37 @@
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
+. ../default.cfg
+
 # Deadlock in umount(1) while out of disk space
 
-D=/usr/tmp/diskimage
-#truncate -s 1G $D
+D=$diskimage
 truncate -s 250M $D
 
-mount | grep "/mnt" | grep md0c > /dev/null && umount /mnt
-mdconfig -l | grep md0 > /dev/null &&  mdconfig -d -u 0
+mount | grep $mntpoint | grep -q md${mdstart}$part && umount $mntpoint
+mdconfig -l | grep -q md$mdstart &&  mdconfig -d -u $mdstart
 
-mdconfig -a -t vnode -f $D -u 0
-bsdlabel -w md0 auto
-newfs -U  md0c > /dev/null
-echo "/dev/md0c /mnt ufs rw,userquota 2 2" >> /etc/fstab
-mount /mnt
-edquota -u -f /mnt -e /mnt:850000:900000:130000:140000 root > /dev/null 2>&1
-quotaon /mnt
-sed -i -e '/md0c/d' /etc/fstab	# clean up before any panics
-export RUNDIR=/mnt/stressX
-../testcases/rw/rw -t 10m -i 200 -h -n -v -v&
+mdconfig -a -t vnode -f $D -u $mdstart
+bsdlabel -w md$mdstart auto
+newfs $newfs_flags  md${mdstart}$part > /dev/null
+export PATH_FSTAB=/tmp/fstab
+echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB
+mount $mntpoint
+edquota -u -f $mntpoint -e $mntpoint:850000:900000:130000:140000 root > /dev/null 2>&1
+quotaon $mntpoint
+export RUNDIR=$mntpoint/stressX
+../testcases/rw/rw -t 10m -i 200 -h -n &
 pid=$!
 for i in `jot 5`; do
-	echo "`date '+%T'` mksnap_ffs /mnt /mnt/.snap/snap$i"
-	mksnap_ffs /mnt /mnt/.snap/snap$i
+	echo "`date '+%T'` mksnap_ffs $mntpoint $mntpoint/.snap/snap$i"
+	mksnap_ffs $mntpoint $mntpoint/.snap/snap$i
 done
 for i in `jot 5`; do
-	rm -f /mnt/.snap/snap1
+	rm -f $mntpoint/.snap/snap1
 done
 kill $pid
-false
-while mount | grep -q /mnt; do
-	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") /mnt > /dev/null 2>&1
+while mount | grep -q ${mntpoint}; do
+	umount ${mntpoint} || sleep 1
 done
-mdconfig -d -u 0
-rm -f $D
+mdconfig -d -u $mdstart
+rm -f $D $PATH_FSTAB

Modified: user/pho/stress2/misc/quota7.sh
==============================================================================
--- user/pho/stress2/misc/quota7.sh	Thu Dec  5 11:42:03 2013	(r258976)
+++ user/pho/stress2/misc/quota7.sh	Thu Dec  5 11:46:57 2013	(r258977)
@@ -33,19 +33,22 @@
 
 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
 
-D=/var/tmp/diskimage
+. ../default.cfg
+
+D=$diskimage
 trap "rm -f $D" 0
-dd if=/dev/zero of=$D bs=1m count=1k
+dd if=/dev/zero of=$D bs=1m count=1k 2>&1 | egrep -v "records|transferred"
 
-mount | grep "/mnt" | grep -q md0 && umount -f /mnt
-mdconfig -l | grep -q md0 &&  mdconfig -d -u 0
+mount | grep $mntpoint | grep -q md$mdstart && umount -f $mntpoint
+mdconfig -l | grep -q md$mdstart &&  mdconfig -d -u $mdstart
 
-mdconfig -a -t vnode -f $D -u 0
-bsdlabel -w md0 auto
-newfs -U  md0c > /dev/null
-echo "/dev/md0c /mnt ufs rw,userquota 2 2" >> /etc/fstab
-mount /mnt
-set `df -ik /mnt | tail -1 | awk '{print $4,$7}'`
+mdconfig -a -t vnode -f $D -u $mdstart
+bsdlabel -w md$mdstart auto
+newfs $newfs_flags  md${mdstart}$part > /dev/null
+export PATH_FSTAB=/tmp/fstab
+echo "/dev/md${mdstart}${part} ${mntpoint} ufs rw,userquota 2 2" > $PATH_FSTAB
+mount $mntpoint
+set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'`
 export KBLOCKS=$(($1 / 21))
 export INODES=$(($2 / 21))
 export HOG=1
@@ -53,25 +56,25 @@ export INCARNATIONS=40
 
 export QK=$((KBLOCKS / 2))
 export QI=$((INODES / 2))
-edquota -u -f /mnt -e /mnt:$((QK - 50)):$QK:$((QI - 50 )):$QI pho
-quotaon /mnt
-sed -i -e '/md0c/d' /etc/fstab
-export RUNDIR=/mnt/stressX
-mkdir /mnt/stressX
-chmod 777 /mnt/stressX
-su pho -c "(cd ..;runRUNTIME=1h ./run.sh disk.cfg)"&	# panic: vfs_allocate_syncvnode: insmntque failed
+edquota -u -f $mntpoint -e $mntpoint:$((QK - 50)):$QK:$((QI - 50 )):$QI $testuser
+quotaon $mntpoint
+export RUNDIR=$mntpoint/stressX
+mkdir $mntpoint/stressX
+chmod 777 $mntpoint/stressX
+rm -rf /tmp/stressX.control/*
+su $testuser -c "(cd ..;runRUNTIME=30m ./run.sh disk.cfg)"&	# panic: vfs_allocate_syncvnode: insmntque failed
 for i in `jot 20`; do
-	echo "`date '+%T'` mksnap_ffs /mnt /mnt/.snap/snap$i"
-	mksnap_ffs /mnt /mnt/.snap/snap$i
+	echo "`date '+%T'` mksnap_ffs $mntpoint $mntpoint/.snap/snap$i"
+	mksnap_ffs $mntpoint $mntpoint/.snap/snap$i
 	sleep 1
 done
 i=$(($(date '+%S') % 20 + 1))
-echo "rm -f /mnt/.snap/snap$i"
-rm -f /mnt/.snap/snap$i
+echo "rm -f $mntpoint/.snap/snap$i"
+rm -f $mntpoint/.snap/snap$i
 wait
 
-while mount | grep -q /mnt; do
-	umount $([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-f" || echo "") /mnt > /dev/null 2>&1
+while mount | grep -q ${mntpoint}; do
+	umount ${mntpoint} || sleep 1
 done
-mdconfig -d -u 0
-rm -f $D
+mdconfig -d -u $mdstart
+rm -f $D $PATH_FSTAB


More information about the svn-src-user mailing list