mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: add helper function _flakey_drop_and_remount
To avoid having many tests repeating the following pattern:
_load_flakey_table $FLAKEY_DROP_WRITES
_unmount_flakey
_load_flakey_table $FLAKEY_ALLOW_WRITES
_mount_flakey
add the helper function _flakey_drop_and_remount to remove
the existing duplicated code and serve as a shortcut.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
71f68b47e1
commit
1a22b6820e
+1
-7
@@ -72,13 +72,7 @@ ln $SCRATCH_MNT/testdir/bar $SCRATCH_MNT/testdir/bar_link
|
||||
ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/foo_link
|
||||
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/testdir/bar
|
||||
|
||||
# Silently drop all writes on our scratch device to simulate a power failure.
|
||||
_load_flakey_table $FLAKEY_DROP_WRITES
|
||||
_unmount_flakey
|
||||
|
||||
# Allow writes again and mount the fs to trigger log/journal replay.
|
||||
_load_flakey_table $FLAKEY_ALLOW_WRITES
|
||||
_mount_flakey
|
||||
_flakey_drop_and_remount
|
||||
|
||||
# Now verify both our files have a link count of 2.
|
||||
echo "Link count for file foo: $(stat -c %h $SCRATCH_MNT/testdir/foo)"
|
||||
|
||||
Reference in New Issue
Block a user