btrfs-progs: test/convert: Add test case for invalid large inline data extent
[platform/upstream/btrfs-progs.git] / tests / convert-tests / 016-invalid-large-inline-extent / test.sh
1 #!/bin/bash
2 # Check if btrfs-convert refuses to rollback the filesystem, and leave the fs
3 # and the convert image untouched
4
5 source "$TEST_TOP/common"
6 source "$TEST_TOP/common.convert"
7
8 setup_root_helper
9 prepare_test_dev
10 check_prereq btrfs-convert
11 check_global_prereq mke2fs
12
13 convert_test_prep_fs ext4 mke2fs -t ext4 -b 4096
14
15 # Create a 6K file, which should not be inlined
16 run_check $SUDO_HELPER dd if=/dev/zero bs=2k count=3 of="$TEST_MNT/file1"
17
18 run_check_umount_test_dev
19
20 # convert_test_do_convert() will call btrfs check, which should expose any
21 # invalid inline extent with too large size
22 convert_test_do_convert