e2fsprogs/tests/m_mmp_bad_csum/script
Andreas Dilger 947315c866 libext2fs: don't use O_DIRECT for files on tmpfs
If a filesystem image is on tmpfs, opening it with O_DIRECT for
reading the MMP will fail.  This is unnecessary, since the image
file can't really be open on another node at this point.  If the
open with O_DIRECT fails, retry without it when plausible.

Remove the special-casing of tmpfs from the mmp test cases.

Change-Id: I41f4b31657b06f62f10be8d6e524d303dd36a321
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2020-03-07 11:14:02 -05:00

28 lines
646 B
Plaintext

gzip -dc < $test_dir/image.gz > $TMPFILE
OUT=$test_name.log
EXP=$test_dir/expect
$E2MMPSTATUS $TMPFILE > $OUT 2>&1
echo Exit status is $? >> $OUT
$FSCK -fy $TMPFILE >> $OUT 2>&1
echo Exit status is $? >> $OUT
$E2MMPSTATUS $TMPFILE >> $OUT 2>&1
echo Exit status is $? >> $OUT
$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1
sed -f $cmd_dir/filter.sed $OUT > $OUT.new
mv $OUT.new $OUT
rm -f $TMPFILE
cmp -s $OUT $EXP
status=$?
if [ "$status" = 0 ] ; then
echo "$test_name: $test_description: ok"
touch $test_name.ok
else
echo "$test_name: $test_description: failed"
diff $DIFF_OPTS $EXP $OUT > $test_name.failed
rm -f $test_name.tmp
fi
unset OUT EXP