From 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:49:25 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- tests/u_direct_io/script | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/u_direct_io/script (limited to 'tests/u_direct_io/script') diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script new file mode 100644 index 0000000..b4f0775 --- /dev/null +++ b/tests/u_direct_io/script @@ -0,0 +1,49 @@ +DESCRIPTION="direct I/O in unix_io" +OUT=$test_name.log +if test "$(id -u)" -ne 0 ; then + echo "$test_name: $DESCRIPTION: skipped (not root)" +elif ! command -v losetup >/dev/null ; then + echo "$test_name: $DESCRIPTION: skipped (no losetup)" +elif test ! -x $DEBUGFS_EXE; then + echo "$test_name: $DESCRIPTION: skipped (no debugfs)" +else + dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1 + LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE) + if [ ! -b "$LOOP" ]; then + echo "$test_name: $DESCRIPTION: skipped (no loop devices)" + rm -f $TMPFILE + exit 0 + fi + echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT + $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \ + sed -f $cmd_dir/filter.sed >> $OUT + + echo debugfs -D -R stats \$LOOP >> $OUT + $DEBUGFS -D -R stats $LOOP 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT + + echo e2fsck -fn -N test_filesys \$LOOP > $OUT.new + $FSCK -fn -N test_filesys $LOOP >> $OUT.new 2>&1 + echo Exit status is $? >> $OUT.new + sed -f $cmd_dir/filter.sed $OUT.new >> $OUT + rm -f $OUT.new + + losetup -d $LOOP + + echo e2fsck -fn -N test_filesys \$TMPFILE > $OUT.new + $FSCK -fn -N test_filesys $TMPFILE >> $OUT.new 2>&1 + echo Exit status is $? >> $OUT.new + sed -f $cmd_dir/filter.sed $OUT.new >> $OUT + rm -f $OUT.new + + cmp -s $test_name.log $test_dir/expect + + if [ "$?" -eq 0 ]; then + echo "$test_name: $DESCRIPTION: ok" + touch $test_name.ok + else + echo "$test_name: $DESCRIPTION: failed" + diff $DIFF_OPTS $test_dir/expect $test_name.log >> $test_name.failed + fi +fi + +unset LOOP -- cgit v1.2.3