Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F3112012
metadata_csum_test.sh
fsu (Fedor Uporov)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
fsu
Jan 9 2018, 10:24 AM
2018-01-09 10:24:20 (UTC+0)
Size
4 KB
Referenced Files
None
Subscribers
None
metadata_csum_test.sh
View Options
#!/bin/sh
# This test require specially hacked fsx and fstorture binaries from here:
# https://github.com/thedrgreenthumb/fstools
#
# Test for metadata_csum feature.
# All csums are supported, excluding MMP csum.
#
TEST_DEV
=
"/dev/md0"
# The md0 size is 4G
TEST_MP
=
"/mnt"
BIN_PATH
=
"/root/Tests"
MY_PATH
=
${
PWD
}
run_fstorture
()
# ${1} => TEST_DIR_PATH
{
if
[
!
-f
${
BIN_PATH
}
/fstorture
]
;
then
echo
"Can not find fstorture binary in
${
PWD
}
"
exit
1
fi
cp
${
BIN_PATH
}
/fstorture
${
TEST_MP
}
/fstorture
mkdir
${
1
}
/root0
${
1
}
/root1
cd
${
1
}
&&
./fstorture
root0
root1
4
-c
1000
if
[
"
${
?
}
"
-ne
"0"
]
;
then
exit
1
;
fi
}
run_fsx
()
# ${1} => TEST_DIR_PATH
{
if
[
!
-f
${
BIN_PATH
}
/fsx
]
;
then
echo
"Can not find fsx binary in
${
PWD
}
"
exit
1
fi
cp
${
BIN_PATH
}
/fsx
${
1
}
/fsx
cd
${
1
}
&&
./fsx
-S
0
-l
1234567
-N
10000
./TEST_FILE0
if
[
"
${
?
}
"
-ne
"0"
]
;
then
exit
1
;
fi
}
run_ea_fsx
()
# ${1} => TEST_DIR_PATH
{
if
[
!
-f
${
BIN_PATH
}
/fsx
]
;
then
echo
"Can not find fsx binary in
${
PWD
}
"
exit
1
fi
cp
${
BIN_PATH
}
/fsx
${
1
}
/fsx
cd
${
1
}
&&
truncate
-s
1M
./TEST_FILE_EA
&&
./fsx
-S
0
-e
989
-N
10000
./TEST_FILE_EA
if
[
"
${
?
}
"
-ne
"0"
]
;
then
exit
1
;
fi
}
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
}
run_fsx
${
TEST_MP
}
run_ea_fsx
${
TEST_MP
}
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 clean ext3..."
FEATURES
=
""
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
echo
"Tests for clean ext3 with metadata_csum..."
FEATURES
=
"-O metadata_csum"
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O uninit_bg"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O metadata_csum"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O uninit_bg -O extents"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
# run_test "4096" "${FEATURES}"
#
# Do not run 64k with extents, because it was decided,
# that this combination will be not supported.
#
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O uninit_bg -O extents -O metadata_csum"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O extents -O 64bit"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O extents -O 64bit -O metadata_csum"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O uninit_bg -O extents -O 64bit"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
FEATURES
=
"-O huge_file -O dir_nlink -O extents -O 64bit -O metadata_csum"
echo
"Tests for metadata_csum with features:
${
FEATURES
}
..."
run_test
"1024"
"
${
FEATURES
}
"
run_test
"2048"
"
${
FEATURES
}
"
run_test
"4096"
"
${
FEATURES
}
"
# run_test "64k" "${FEATURES}"
echo
PASSED
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1251974
Default Alt Text
metadata_csum_test.sh (4 KB)
Attached To
Mode
D13810: Add metadata_csum feature support.
Attached
Detach File
Event Timeline
Log In to Comment