Patchwork [73/74] tests: add large symlink test

login
register
mail settings
Submitter Darrick J. Wong
Date Dec. 11, 2013, 1:26 a.m.
Message ID <20131211012631.30655.22099.stgit@birch.djwong.org>
Download mbox | patch
Permalink /patch/299741/
State Superseded
Headers show

Comments

Darrick J. Wong - Dec. 11, 2013, 1:26 a.m.
Test the creation and reading of a large symlink.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/metadata-checksum-test.sh |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/tests/metadata-checksum-test.sh b/tests/metadata-checksum-test.sh
index 4e353e1..d34985b 100755
--- a/tests/metadata-checksum-test.sh
+++ b/tests/metadata-checksum-test.sh
@@ -3277,6 +3277,30 @@  ${E2FSPROGS}/debugfs/debugfs -R 'stat /bigfile' "${DEV}" | grep -c "Size: ${FILE
 ${E2FSPROGS}/debugfs/debugfs -R 'stat /bigfile2' "${DEV}" | grep -c "Size: ${FILE_SIZE}"
 }
 
+##########################
+function big_symlink_test {
+msg "big_symlink_test"
+
+$VALGRIND ${E2FSPROGS}/misc/mke2fs -T ext4icsum $MKFS_OPTS $MKFS_FEATURES -F "${DEV}"
+test -z "$NO_CSUM" && $VALGRIND ${E2FSPROGS}/misc/tune2fs -O metadata_csum $DEV
+${E2FSPROGS}/misc/dumpe2fs -h $DEV 2> /dev/null | egrep -q "^Filesystem state:[ ]*clean$" || ${fsck_cmd} -fDy $DEV || true
+
+set +x
+LINK_TARGET="/$(printf "x%.0s" {1..1000})"
+set -x
+${mount_cmd} ${MOUNT_OPTS} "${DEV}" "${MNT}" -t ext4 -o journal_checksum
+ln -s "${LINK_TARGET}" "${MNT}/biglink"
+umount "${MNT}"
+${E2FSPROGS}/debugfs/debugfs -R 'stat /biglink' "${DEV}" | cat -
+${fsck_cmd} -C0 -f -n "${DEV}"
+
+${mount_cmd} ${MOUNT_OPTS} "${DEV}" "${MNT}" -t ext4 -o journal_checksum
+LINK_NOW="$(readlink "${MNT}/biglink")"
+umount "${MNT}"
+
+test "${LINK_NOW}" = "${LINK_TARGET}"
+}
+
 # This test should be the last one (before speed tests, anyway)
 
 #### ALL SPEED TESTS GO AT THE END