svn commit: r285625 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Thu Jul 16 10:12:13 UTC 2015
Author: pho
Date: Thu Jul 16 10:12:10 2015
New Revision: 285625
URL: https://svnweb.freebsd.org/changeset/base/285625
Log:
Do not use hardcoded "/tmp" for temporary files.
Sponsored by: EMC / Isilon storage division
Modified:
user/pho/stress2/misc/sendfile.sh
user/pho/stress2/misc/sendfile3.sh
user/pho/stress2/misc/sendfile5.sh
user/pho/stress2/misc/sendfile7.sh
user/pho/stress2/misc/sendfile_shm.sh
Modified: user/pho/stress2/misc/sendfile.sh
==============================================================================
--- user/pho/stress2/misc/sendfile.sh Thu Jul 16 09:08:36 2015 (r285624)
+++ user/pho/stress2/misc/sendfile.sh Thu Jul 16 10:12:10 2015 (r285625)
@@ -43,8 +43,8 @@ rm -f sendfile.c
[ -d "$RUNDIR" ] || mkdir -p $RUNDIR
cd $RUNDIR
-in=/tmp/inputFile
-out=/tmp/outputFile
+in=inputFile
+out=outputFile
for i in 1 2 3 4 8 16 1k 2k 3k 4k 5k 1m 2m 3m 4m 5m ; do
rm -f $in $out
Modified: user/pho/stress2/misc/sendfile3.sh
==============================================================================
--- user/pho/stress2/misc/sendfile3.sh Thu Jul 16 09:08:36 2015 (r285624)
+++ user/pho/stress2/misc/sendfile3.sh Thu Jul 16 10:12:10 2015 (r285625)
@@ -44,8 +44,8 @@ rm -f sendfile3.c
[ -d "$RUNDIR" ] || mkdir -p $RUNDIR
cd $RUNDIR
-in=/tmp/inputFile
-out=/tmp/outputFile
+in=inputFile
+out=outputFile
parallel=20
for i in 50m 100m; do
@@ -56,9 +56,7 @@ for i in 50m 100m; do
rm -f ${out}$j
/tmp/sendfile3 $in ${out}$j 1234$j &
done
- for j in `jot $parallel`; do
- wait
- done
+ wait
for j in `jot $parallel`; do
rm -f ${out}$j
done
Modified: user/pho/stress2/misc/sendfile5.sh
==============================================================================
--- user/pho/stress2/misc/sendfile5.sh Thu Jul 16 09:08:36 2015 (r285624)
+++ user/pho/stress2/misc/sendfile5.sh Thu Jul 16 10:12:10 2015 (r285625)
@@ -36,11 +36,13 @@
. ../default.cfg
here=`pwd`
+file=`basename $diskimage`
+dir=`dirname $diskimage`
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=/tmp/big bs=1m count=1k 2>&1 | egrep -v "records|transferred"
+dd if=/dev/zero of=$diskimage bs=1m count=1k 2>&1 | egrep -v "records|transferred"
cd $here
mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint
@@ -48,8 +50,8 @@ mdconfig -l | grep -q md$mdstart && mdc
mount -t tmpfs tmpfs $mntpoint
echo "Testing tmpfs(5)"
-cp /tmp/big $mntpoint
-/tmp/sendfile5 $mntpoint/big
+cp $diskimage $mntpoint
+/tmp/sendfile5 $mntpoint/$file
umount $mntpoint
mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart
@@ -58,16 +60,16 @@ bsdlabel -w md$mdstart auto
newfs $newfs_flags md${mdstart}$part > /dev/null
mount /dev/md${mdstart}$part $mntpoint
echo "Testing FFS"
-cp /tmp/big $mntpoint
-/tmp/sendfile5 $mntpoint/big
+cp $diskimage $mntpoint
+/tmp/sendfile5 $mntpoint/$file
umount $mntpoint
-mount -t nullfs /tmp $mntpoint
+mount -t nullfs $dir $mntpoint
echo "Testing nullfs(5)"
-/tmp/sendfile5 $mntpoint/big
+/tmp/sendfile5 $mntpoint/$file
umount $mntpoint
-rm -f /tmp/sendfile5 /tmp/big
+rm -f /tmp/sendfile5 $diskimage
exit
EOF
#include <sys/types.h>
Modified: user/pho/stress2/misc/sendfile7.sh
==============================================================================
--- user/pho/stress2/misc/sendfile7.sh Thu Jul 16 09:08:36 2015 (r285624)
+++ user/pho/stress2/misc/sendfile7.sh Thu Jul 16 10:12:10 2015 (r285625)
@@ -36,6 +36,6 @@
./sendfile5.sh &
while kill -0 $! 2>/dev/null; do
- ../testcases/swap/swap -t 2m -i 40
+ ../testcases/swap/swap -t 2m -i 40 > /dev/null 2>&1
done
wait
Modified: user/pho/stress2/misc/sendfile_shm.sh
==============================================================================
--- user/pho/stress2/misc/sendfile_shm.sh Thu Jul 16 09:08:36 2015 (r285624)
+++ user/pho/stress2/misc/sendfile_shm.sh Thu Jul 16 10:12:10 2015 (r285625)
@@ -37,6 +37,7 @@
[ -r /boot/kernel/kernel ] || exit 0
here=`pwd`
+dir=`dirname $diskimage`
cd /tmp
sed '1,/^EOF/d' < $here/$0 > sendfile_shm.c
mycc -o sendfile_shm -Wall -Wextra -O2 sendfile_shm.c || exit 1
@@ -46,7 +47,7 @@ cd $here
daemon ../testcases/swap/swap -t 2m -i 20 > /dev/null 2>&1
sleep 5
for i in `jot 10`; do
- /tmp/sendfile_shm /boot/kernel/kernel /tmp/sendfile_shm.$i > \
+ /tmp/sendfile_shm /boot/kernel/kernel $dir/sendfile_shm.$i > \
/dev/null &
done
for i in `jot 10`; do
@@ -56,9 +57,9 @@ while pkill -9 swap; do
sleep .5
done
for i in `jot 10`; do
- cmp -s /boot/kernel/kernel /tmp/sendfile_shm.$i 2>/dev/null ||
+ cmp -s /boot/kernel/kernel $dir/sendfile_shm.$i 2>/dev/null ||
e=1
- rm -f /tmp/sendfile_shm.$i
+ rm -f $dir/sendfile_shm.$i
done
[ -n "$e" ] && echo FAIL
wait
More information about the svn-src-user
mailing list