btrfs-progs: tests: fix fsck-tests/031 when on NFS

The restore target file does not exist and creating by root does not
work on NFS, so precreating will make that work. Also fix the image name
to be deleted.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2018-06-07 15:18:50 +02:00
parent 96af160a01
commit 686dc0864e

View File

@ -16,6 +16,8 @@ run_check_mount_test_dev
run_check $SUDO_HELPER dd if=/dev/urandom of="$TEST_MNT/file" bs=4k count=16
run_check_umount_test_dev
touch restored_image
chmod a+w restored_image
run_check $SUDO_HELPER "$TOP/btrfs-image" "$TEST_DEV" "restored_image"
# use prepare_test_dev() to wipe all existing data on $TEST_DEV
@ -27,4 +29,4 @@ run_check $SUDO_HELPER "$TOP/btrfs-image" -r "restored_image" "$TEST_DEV"
# Should not report any error
run_check "$TOP/btrfs" check --check-data-csum "$TEST_DEV"
rm -rf -- "restored_image*"
rm -rf -- "restored_image"