Page MenuHomeFreeBSD
Authored By
fsu
Jul 8 2017, 5:00 PM
Size
1 KB
Referenced Files
None
Subscribers
None

64bit_test.sh

#!/bin/sh
# This test require specially hacked fsx and fstorture binaries from here:
# https://github.com/thedrgreenthumb/fstools
# In case of 64bit feature, we should verify that
# gd array inside the superblock is loaded and flushed correctly.
# Also, it would be great to check the blocks more then 2^32 fo files allocation
# in case of 64-bit and extents only in ro mode,
# but the large hard drive ( more than 4 TB) is required, which I does not have for now.
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
}
run_test() # ${1} => block size ${2} => features list
{
echo "Run test with bs=${1} and features ${2} ..."
mkfs.ext3 -b ${1} ${2} -F ${TEST_DEV}
dumpe2fs ${TEST_DEV} | grep 'Filesystem features'
mount -t ext2fs ${TEST_DEV} ${TEST_MP}
cp ./fstorture ${TEST_MP}/fstorture
run_fstorture ${TEST_MP}
cd ${MY_PATH}
sleep 5
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
}
# main()
echo "Tests for old gd size..."
run_test "1024"
run_test "2048"
run_test "4096"
run_test "64k"
echo "Tests for 64bit gd size..."
run_test "1024" "-O huge_file -O dir_nlink -O extents -O 64bit"
run_test "2048" "-O huge_file -O dir_nlink -O extents -O 64bit"
run_test "4096" "-O huge_file -O dir_nlink -O extents -O 64bit"
run_test "64k" "-O huge_file -O dir_nlink -O extents -O 64bit"
echo PASSED

File Metadata

Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
970566
Default Alt Text
64bit_test.sh (1 KB)

Event Timeline