Honor $TMP, instead of using /test .
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/testscripts/ltp-aiodio.sh b/testscripts/ltp-aiodio.sh
index ab54c54..fb82e03 100755
--- a/testscripts/ltp-aiodio.sh
+++ b/testscripts/ltp-aiodio.sh
@@ -16,7 +16,8 @@
cd ..
export LTPROOT=${PWD}
fi
-export PATH=$LTPROOT/testcases/bin:$PATH
+export PATH=$LTPROOT$TMPcases/bin:$PATH
+export TMP=${TMP:=/tmp}
run0=0
runTest=0
@@ -130,9 +131,9 @@
usage;
fi
-mkdir /test > /dev/nul 2>&1
-mkdir /test/aiodio > /dev/nul 2>&1
-mkdir /test/aiodio2 > /dev/nul 2>&1
+mkdir $TMP > /dev/nul 2>&1
+mkdir $TMP/aiodio > /dev/nul 2>&1
+mkdir $TMP/aiodio2 > /dev/nul 2>&1
while [ "$runTest" -lt "$run0" ]
do
@@ -144,16 +145,16 @@
echo "* Testing ext2 filesystem *"
echo "***************************"
mkfs -t ext2 $part1
- mount -t ext2 $part1 /test/aiodio
+ mount -t ext2 $part1 $TMP/aiodio
if [ "$runExtendedStress" -eq 1 -a -n "$ext3" ]; then
mkfs -t ext3 $part2
- mount -t ext3 $part2 /test/aiodio2
+ mount -t ext3 $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$jfs" ]; then
mkfs.jfs $part2 <testscripts/yesenter.txt
- mount -t jfs $part2 /test/aiodio2
+ mount -t jfs $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$xfs" ]; then
mkfs.xfs -f $part2
- mount -t xfs $part2 /test/aiodio2
+ mount -t xfs $part2 $TMP/aiodio2
fi
elif [ $nextTest -eq 0 ]; then
nextTest=$(($nextTest+1))
@@ -164,16 +165,16 @@
echo "* Testing ext3 filesystem *"
echo "***************************"
mkfs -t ext3 $part1
- mount -t ext3 $part1 /test/aiodio
+ mount -t ext3 $part1 $TMP/aiodio
if [ "$runExtendedStress" -eq 1 -a -n "$jfs" ]; then
mkfs.jfs $part2 <testscripts/yesenter.txt
- mount -t jfs $part2 /test/aiodio2
+ mount -t jfs $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$xfs" ]; then
mkfs.xfs -f $part2
- mount -t xfs $part2 /test/aiodio2
+ mount -t xfs $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$ext2" ]; then
mkfs -t ext2 $part2
- mount -t ext2 $part2 /test/aiodio2
+ mount -t ext2 $part2 $TMP/aiodio2
fi
elif [ $nextTest -eq 1 ]; then
nextTest=$(($nextTest+1))
@@ -184,16 +185,16 @@
echo "* Testing jfs filesystem *"
echo "**************************"
mkfs.jfs $part1 <testscripts/yesenter.txt
- mount -t jfs $part1 /test/aiodio
+ mount -t jfs $part1 $TMP/aiodio
if [ "$runExtendedStress" -eq 1 -a -n "$ext3" ]; then
mkfs -t ext3 $part2
- mount -t ext3 $part2 /test/aiodio2
+ mount -t ext3 $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$xfs" ]; then
mkfs.xfs -f $part2
- mount -t xfs $part2 /test/aiodio2
+ mount -t xfs $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$ext2" ]; then
mkfs -t ext2 $part2
- mount -t ext2 $part2 /test/aiodio2
+ mount -t ext2 $part2 $TMP/aiodio2
fi
elif [ $nextTest -eq 2 ]; then
nextTest=$(($nextTest+1))
@@ -204,16 +205,16 @@
echo "* Testing xfs filesystem *"
echo "**************************"
mkfs.xfs -f $part1
- mount -t xfs $part1 /test/aiodio
+ mount -t xfs $part1 $TMP/aiodio
if [ "$runExtendedStress" -eq 1 -a -n "$ext2" ]; then
mkfs -t ext2 $part2
- mount -t ext2 $part2 /test/aiodio2
+ mount -t ext2 $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$ext3" ]; then
mkfs -t ext3 $part2
- mount -t ext3 $part2 /test/aiodio2
+ mount -t ext3 $part2 $TMP/aiodio2
elif [ "$runExtendedStress" -eq 1 -a -n "$jfs" ]; then
mkfs.jfs $part2 <testscripts/yesenter.txt
- mount -t jfs $part2 /test/aiodio2
+ mount -t jfs $part2 $TMP/aiodio2
fi
elif [ $nextTest -eq 3 ]; then
nextTest=$(($nextTest+1))
@@ -222,8 +223,8 @@
nextTest=$(($nextTest+1))
runTest=$(($runTest+1))
-mkdir /test/aiodio/junkdir
-dd if=$file1 of=/test/aiodio/junkfile bs=8192 conv=block,sync
+mkdir $TMP/aiodio/junkdir
+dd if=$file1 of=$TMP/aiodio/junkfile bs=8192 conv=block,sync
date
echo "************ Running aio-stress tests "
@@ -248,11 +249,11 @@
sync
fi
-dd if=$file1 of=/test/aiodio/junkfile bs=8192 conv=block,sync
-dd if=$file1 of=/test/aiodio/fff bs=4096 conv=block,sync
-dd if=$file1 of=/test/aiodio/ff1 bs=2048 conv=block,sync
-dd if=$file1 of=/test/aiodio/ff2 bs=1024 conv=block,sync
-dd if=$file1 of=/test/aiodio/ff3 bs=512 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/junkfile bs=8192 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/fff bs=4096 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/ff1 bs=2048 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/ff2 bs=1024 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/ff3 bs=512 conv=block,sync
echo "************ Running aiocp tests "
${LTPROOT}/bin/rand_lines -g ${LTPROOT}/runtest/ltp-aiodio.part1 > ${TMPBASE}/ltp-aiodio.part1
@@ -287,10 +288,10 @@
sync
fi
-dd if=$file1 of=/test/aiodio/file2 bs=2048 conv=block,sync
-dd if=$file1 of=/test/aiodio/file3 bs=1024 conv=block,sync
-dd if=$file1 of=/test/aiodio/file4 bs=512 conv=block,sync
-dd if=$file1 of=/test/aiodio/file5 bs=4096 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/file2 bs=2048 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/file3 bs=1024 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/file4 bs=512 conv=block,sync
+dd if=$file1 of=$TMP/aiodio/file5 bs=4096 conv=block,sync
@@ -306,13 +307,13 @@
echo "************ Cleaning/Umounting"
-rm -f /test/aiodio/fff
-rm -f /test/aiodio/ff1
-rm -f /test/aiodio/ff2
-rm -f /test/aiodio/ff3
-rm -f /test/aiodio/junkfile*
-rm -f /test/aiodio/file*
-rm -rf /test/aiodio/junkdir
+rm -f $TMP/aiodio/fff
+rm -f $TMP/aiodio/ff1
+rm -f $TMP/aiodio/ff2
+rm -f $TMP/aiodio/ff3
+rm -f $TMP/aiodio/junkfile*
+rm -f $TMP/aiodio/file*
+rm -rf $TMP/aiodio/junkdir
umount $part1