svn commit: r320227 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Thu Jun 22 07:37:14 UTC 2017
Author: pho
Date: Thu Jun 22 07:37:10 2017
New Revision: 320227
URL: https://svnweb.freebsd.org/changeset/base/320227
Log:
Added test for free disk space.
Sponsored by: Dell EMC Isilon
Modified:
user/pho/stress2/misc/sendfile5.sh
Modified: user/pho/stress2/misc/sendfile5.sh
==============================================================================
--- user/pho/stress2/misc/sendfile5.sh Thu Jun 22 07:35:59 2017 (r320226)
+++ user/pho/stress2/misc/sendfile5.sh Thu Jun 22 07:37:10 2017 (r320227)
@@ -42,7 +42,12 @@ cd /tmp
sed '1,/^EOF/d' < $here/$0 > sendfile5.c
mycc -o sendfile5 -Wall -Wextra -O2 sendfile5.c
rm -f sendfile5.c
-dd if=/dev/zero of=$diskimage bs=1m count=1k 2>&1 | egrep -v "records|transferred"
+need=1024
+[ `df -k $(dirname $diskimage) | tail -1 | awk '{print int($4 / 1024)'}` \
+ -lt $need ] &&
+ printf "Need %d MB on %s.\n" $need `dirname $diskimage` && exit 0
+dd if=/dev/zero of=$diskimage bs=1m count=$need 2>&1 |
+ egrep -v "records|transferred"
cd $here
mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
More information about the svn-src-user
mailing list