Page MenuHomeFreeBSD
Authored By
fsu
Jun 15 2017, 8:19 AM
Size
2 KB
Referenced Files
None
Subscribers
None

gd_csum_test.sh

#!/bin/sh
TEST_DEV="/dev/md0"
TEST_MP="/mnt"
MY_PATH=${PWD}
run_fstorture() # ${1} => TEST_DIR_PATH
{
if [ ! -f ./fstorture ]; then
echo "Can not find test binary in ${PWD}"
exit 1
fi
mkdir ${1}/root0 ${1}/root1
cd ${1} && ./fstorture root0 root1 4 -c 1000
}
echo " =========== Test notmal case without gd_csum to avoid regression..."
mkfs.ext3 -F ${TEST_DEV}
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 2
umount ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "Can not unmount..."
exit 1
fi
e2fsck -f -n ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "e2fsck fail"
exit 1
fi
echo " =========== Test feature in normal block size..."
mkfs.ext3 -F -O uninit_bg ${TEST_DEV}
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 2
umount ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "Can not unmount..."
exit 1
fi
e2fsck -f -n ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "e2fsck fail"
exit 1
fi
echo " =========== Test feature in block size 1K..."
mkfs.ext3 -F -O uninit_bg -b 1k ${TEST_DEV}
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 2
umount ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "Can not unmount..."
exit 1
fi
e2fsck -f -n ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "e2fsck fail"
exit 1
fi
echo " =========== Test feature in block size 2K..."
mkfs.ext3 -F -O uninit_bg -b 2k ${TEST_DEV}
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 2
umount ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "Can not unmount..."
exit 1
fi
e2fsck -f -n ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "e2fsck fail"
exit 1
fi
echo " =========== Test feature in block size 64K..."
mkfs.ext3 -F -O uninit_bg -b 64k ${TEST_DEV}
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 2
umount ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "Can not unmount..."
exit 1
fi
e2fsck -f -n ${TEST_DEV}
if [ "$?" -ne "0" ]
then
echo "e2fsck fail"
exit 1
fi

File Metadata

Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
942953
Default Alt Text
gd_csum_test.sh (2 KB)

Event Timeline