summaryrefslogtreecommitdiff
path: root/tests/btrfs/098
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2015-11-17 08:41:32 +1100
committerDave Chinner <david@fromorbit.com>2015-11-17 08:41:32 +1100
commit1a22b6820e2e62b053da3ba92cae91e5c4a38320 (patch)
tree84859106f853d0ced6017516c088ef0122fb7975 /tests/btrfs/098
parent71f68b47e16bdcfbacaeeaf1e228e05d17a3ae6f (diff)
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>
Diffstat (limited to 'tests/btrfs/098')
-rwxr-xr-xtests/btrfs/0988
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/btrfs/098 b/tests/btrfs/098
index f12df5f5..8aef1191 100755
--- a/tests/btrfs/098
+++ b/tests/btrfs/098
@@ -84,11 +84,6 @@ $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
echo "File digest before power failure:"
md5sum $SCRATCH_MNT/foo | _filter_scratch
-# Silently drop all writes and ummount to simulate a crash/power failure.
-_load_flakey_table $FLAKEY_DROP_WRITES
-_unmount_flakey
-
-# Allow writes again, mount to trigger log replay and validate file contents.
# The fsync log replay first processes the file extent item corresponding to the
# file offset 400K (the one which refers to the [20K, 40K[ sub-range of our 100K
# extent) and then processes the file extent item for file offset 800K. It used
@@ -109,8 +104,7 @@ _unmount_flakey
# "BTRFS warning (device dm-0): csum failed ino 257 off 917504 csum 1322675045\
# expected csum 0"
#
-_load_flakey_table $FLAKEY_ALLOW_WRITES
-_mount_flakey
+_flakey_drop_and_remount
echo "File digest after log replay:"
# Must match the same digest he had after cloning the extent and before the