mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests 311: test fsync with dm flakey V4
This test sets up a dm flakey target and then runs my fsync tester I've been using to verify btrfs's fsync() is working properly. It will create a dm flakey device, mount it, run my test, make the flakey device start dropping writes, and then unmount the fs. Then we mount it back up and make sure the md5sums match and then run fsck on the device to make sure we got a consistent fs. I used the output from a run on BTRFS since it's the only one that passes this test properly. I verified each test manually to make sure they were in fact valid files. XFS and Ext4 both fail this test in one way or another. Signed-off-by: Josef Bacik <jbacik@fusionio.com> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Rich Johnston <rjohnston@sgi.com> [rjohnston@sgi.com changed syncfs() to sync() for older kernels] Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
7f622f44b6
commit
dd3b526831
@@ -57,6 +57,13 @@ dd()
|
||||
fi
|
||||
}
|
||||
|
||||
# Prints the md5 checksum of a given file
|
||||
_md5_checksum()
|
||||
{
|
||||
md5sum $1 | cut -d ' ' -f1
|
||||
}
|
||||
|
||||
|
||||
# ls -l w/ selinux sometimes puts a dot at the end:
|
||||
# -rwxrw-r--. id1 id2 file1
|
||||
|
||||
@@ -1050,6 +1057,22 @@ _require_command()
|
||||
[ -n "$1" -a -x "$1" ] || _notrun "$_cmd utility required, skipped this test"
|
||||
}
|
||||
|
||||
# this test requires the device mapper flakey target
|
||||
#
|
||||
_require_dm_flakey()
|
||||
{
|
||||
_require_command $DMSETUP_PROG
|
||||
|
||||
modprobe dm-flakey >/dev/null 2>&1
|
||||
$DMSETUP_PROG targets | grep flakey >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
:
|
||||
else
|
||||
_notrun "This test requires dm flakey support"
|
||||
fi
|
||||
}
|
||||
|
||||
# this test requires the projid32bit feature to be available in
|
||||
# mkfs.xfs
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user