summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* New upstream releaseDimitri John Ledkov2019-01-26
|
* btrfs-progs: tests: fsck/025, fix typo in helpre nameJosh Soref2018-11-26
| | | | | | | | Generated by https://github.com/jsoref/spelling Issue: #154 Author: Josh Soref <jsoref@users.noreply.github.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix typos in test commentsJosh Soref2018-11-26
| | | | | | | | Generated by https://github.com/jsoref/spelling Issue: #154 Author: Josh Soref <jsoref@users.noreply.github.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: fix typos in READMEs, INSTALL and CHANGESJosh Soref2018-11-26
| | | | | | | | Generated by https://github.com/jsoref/spelling Issue: #154 Author: Josh Soref <jsoref@users.noreply.github.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add the testcase for subvolume name length limit testSu Yanjun2018-10-25
| | | | | | | | | | | Total of three conditions are tested. One for short name, one with name length 255, the last one with more than 255. This case should pass after commit 'btrfs-progs: change filename limit to 255 when creating subvolume'. Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add runtime check for free-space-treeDavid Sterba2018-10-25
| | | | | | | The CI hosts have old kernel that does not support the FST, make the test fail gracefully. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Test for FST corruption detection/repairNikolay Borisov2018-10-25
| | | | | | | | Simple test case which preps a filesystem, then corrupts the FST and finally repairs it. Tests both extent based and bitmap based FSTs. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add test for missing device delete error valueNikolay Borisov2018-10-23
| | | | | | | | | Add a test which ensures the kernel returns the correct error value when missing device removal is requested. This test verifies that kernel refactoring didn't break the return value. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: renumber last fsck test to 036-rescan-not-kicked-inDavid Sterba2018-10-23
| | | | | | | | The commit d99615284a83452c019f5bed05a882f93a4ef19a ("btrfs-progs: fsck-tests: Add test image to check if btrfs check reports uninitialized rescan as error") added test 035, should have been 036. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Add test image to check if btrfs check reports ↵Qu Wenruo2018-08-06
| | | | | | | uninitialized rescan as error Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: add test case with keyed data backref with reloc ↵Su Yue2018-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tree blocks For trees have been balanced, leaves are with flag BTRFS_HEADER_FLAG_RELOC and extent data backrefs are shared. Like: ===================== item 0 key (11927552 EXTENT_ITEM 524288) itemoff 3932 itemsize 63 refs 129 gen 7 flags DATA shared data backref parent 35897344 count 41 shared data backref parent 35426304 count 37 shared data backref parent 35422208 count 51 ===================== Then make the leaf which owns the extent data cowed. The shared data backref was to transferred to keyed data ref, but remaining backrefs are still shared. Like: ===================== item 0 key (11927552 EXTENT_ITEM 524288) itemoff 3887 itemsize 108 refs 129 gen 7 flags DATA extent data backref root 5 objectid 258 offset 0 count 40 extent data backref root 5 objectid 257 offset 0 count 1 shared data backref parent 35426304 count 37 shared data backref parent 35422208 count 51 ===================== However lowmem mode used to iterate the whole inode to find all references, and doesn't care if a reference is already counted by the shared tree block. Add the test case to check it. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fuzz: Add image for BUG_ON() when opening the fs by btrfs ↵Qu Wenruo2018-08-06
| | | | | | | | check Link: https://bugzilla.kernel.org/show_bug.cgi?id=199839 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/fuzz: Add fuzzed test image for btrfs check BUG_ONQu Wenruo2018-08-06
| | | | | | | | | | | | | | | | | | | | | | This fuzzed image will not only cause kernel BUG_ON(), but also btrfs check BUG_ON() for original mode. Checking filesystem on /home/adam/btrfs/crafted_images/runtime/0.img UUID: 3381d111-94a3-4ac7-8f39-611bbbdab7e6 checking extents check/main.c:3677: check_owner_ref: BUG_ON `rec->is_root` triggered, value 1 btrfs(+0x572c2)[0x562d65da72c2] btrfs(+0x6098d)[0x562d65db098d] btrfs(+0x60bb6)[0x562d65db0bb6] btrfs(+0x6179b)[0x562d65db179b] btrfs(cmd_check+0x1199)[0x562d65db5589] btrfs(main+0x88)[0x562d65d62768] /usr/lib/libc.so.6(__libc_start_main+0xeb)[0x7f4fcbb1b06b] btrfs(_start+0x2a)[0x562d65d6288a] Link: https://bugzilla.kernel.org/show_bug.cgi?id=200403 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/fuzz: Add image for bko-200409Qu Wenruo2018-08-06
| | | | | | | Reported-by: Xu Wen <wen.xu@gatech.edu> Link: https://bugzilla.kernel.org/show_bug.cgi?id=200409 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Add test case for corrupted inline ram_bytesQu Wenruo2018-08-06
| | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc-tests: Fix 029 test cases for sudo test environmentQu Wenruo2018-08-06
| | | | | | | | | | | | | Test misc/029 only works if the test case is executed as root, while for sudo usage, it doesn't work as initial mkdir and final cleanup doesn't use $SUDO_HELPER. Add "run_check $SUDO_HELPER" for such cases to allow it works under sudo usage. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fuzzed image that triggers crash in reloc setup on mountDavid Sterba2018-08-06
| | | | | Reported-by: Wen Xu <wen.xu@gatech.edu> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix fsck-tests/031 when on NFSDavid Sterba2018-06-07
| | | | | | | | 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>
* btrfs-progs: fsck-tests: add test case to check symlinks with bad flagsSu Yue2018-06-07
| | | | | | | | There are two bad symlinks in the test case. One is with immutable attribute. Another one is with append attribute. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: test mkfs.btrfs fails on small backing size thin ↵Su Yue2018-06-07
| | | | | | | | | | | | | | | provision device This tests is most similar to xfstests generic/405. It calls device mapper to create a thin provision device with small backing size and big virtual size. mkfs.btrfs should fail on such devices. This test should pass after commit e805b143a4fe ("btrfs-progs: mkfs: return nozero value on thin provisioned device"). Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test for collision DIR_ITEM handlingNikolay Borisov2018-06-07
| | | | | | | | | | | | | | Verify that if we have an otherwise clean filesystem, containging collided DIR_ITEM, btrfs check lowmem's mode can correctly handle those and not produce any false positives. This if fixed by commit titled: "btrfs-progs: check: fix DIR_ITEM checking in lowmem" Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case to ensure btrfs check returns error for ↵Qu Wenruo2018-06-07
| | | | | | | | | | | | corrupted qgroups Since the test case uses run_mustfail(), which is pretty easy pass due to other unexpected problems, so here an extra run_check() is added to ensure we don't only report qgroup error, but also fix it without problem. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: check btrfs qgroup parent-child relation outputLu Fengqi2018-06-07
| | | | | | | | | | | Since commit aaf2dac5ef37 ("btrfs-progs: qgroup: split update_qgroup to reduce arguments") cause qgroup show to output the wrong qgroup parent-child relationship, in addition to fixing the problem, a test case is needed to prevent the similar problem in the future. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case for dump-tree on heavily corrupted leafQu Wenruo2018-06-07
| | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: update log markersDavid Sterba2018-06-07
| | | | | | | Use visual markers that separate tests and individual commands run via the run_* helpers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add image with no extent with normal device sizeSu Yue2018-06-07
| | | | | | | | | | | | | | This new image misses one extent which leads lowmem mode to allocate new chunks in repair. Rename original image to no_extent_bad_dev.img. Because of its bad used bytes, it should let lowmem mode exclude blocks in repair. Due to problems of btrfs-image, choose xz as compression tool. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/fsck: Add test case to check if btrfs check can skip data ↵Qu Wenruo2018-04-24
| | | | | | | csum verfication for metadata dump Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Remove deprecated btrfs-zero-log standalone toolNikolay Borisov2018-04-24
| | | | | | | | | | | Its function has been subsumed by "btrfs rescue zero-log". Remove its source file and adjust make/tests soruces accordingly. Deprecated since 4.0. Issue: #97 Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Test if btrfs-image can handle RAID1 missing deviceQu Wenruo2018-03-30
| | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Test if mkfs.btrfs --rootdir can handle ng symlinkQu Wenruo2018-03-30
| | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add shell quotes to misc test scriptsDavid Sterba2018-03-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add shell quotes to mkfs test scriptsDavid Sterba2018-03-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: remove trivial use of local variablesDavid Sterba2018-03-30
| | | | | | | No need to use a temporary variable if the parameter usage is obvious from the context. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add shell quoting to fuzz test scriptsDavid Sterba2018-03-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: convert/014 use shell builtin for generating contentDavid Sterba2018-03-30
| | | | | | | We can remove dependency on perl and use shell builtin go generate sequence of bytes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: update README, images, coding styleDavid Sterba2018-03-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: mkfs fills uuid and otime for FS_TREEDavid Sterba2018-03-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: don't use fallocate in mkfs/014-rootdir-inline-extentDavid Sterba2018-03-30
| | | | | | | If fallocate is not supported, this test fails. Use a shell trick to fill with given number of bytes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add testcase for rootdir inline extent sizeQu Wenruo2018-03-30
| | | | | | | | Add a test case for mkfs --rootdir, using files with different file sizes to check if invalid large inline extent could exist. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/convert: Add test case for invalid large inline data extentQu Wenruo2018-03-30
| | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs-progs: add fsck test for filesystem with shared prealloc extentsFilipe Manana2018-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that a filesystem check operation (fsck) does not report the following scenario as an error: An extent is shared between two inodes, as a result of clone/reflink operation, and for one of the inodes, lets call it inode A, the extent is referenced through a file extent item as a prealloc extent, while for the other inode, call it inode B, the extent is referenced through a regular file extent item, that is, it was written to. The goal of this test is to make sure a filesystem check operation will not report "odd csum items" errors for the prealloc extent at inode A, because this scenario is valid since the extent was written through inode B and therefore it is expected to have checksum items in the filesystem's checksum btree for that shared extent. Such scenario can be created with the following steps for example: mkfs.btrfs -f /dev/sdb mount /dev/sdb /mnt touch /mnt/foo xfs_io -c "falloc 0 256K" /mnt/foo sync xfs_io -c "pwrite -S 0xab 0 256K" /mnt/foo touch /mnt/bar xfs_io -c "reflink /mnt/foo 0 0 256K" /mnt/bar xfs_io -c "fsync" /mnt/bar <power fail> mount /dev/sdb /mnt umount /mnt This scenario is fixed by the following patch for the filesystem checker: "Btrfs-progs: check, fix false error reports for shared prealloc extents" Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix source path for testsuiteDavid Sterba2018-03-30
| | | | | | | | The commit cebf3b37228cbde730a5 ("btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests") did not convert all test paths. This would break the exported testsutie. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case with valid orphan inodeQu Wenruo2018-03-30
| | | | | | | | Regression test for false alerts in lowmem mode. Signed-off-by: Qu Wenruo <wqu@suse.com> [ update test ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Introduce test case with keyed data backref with ↵Lu Fengqi2018-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the extent offset Add the testcase for false alert of data extent backref lost with the extent offset. The image can be reproduced by the following commands: ------ dev=~/test.img mnt=/mnt/btrfs umount $mnt &> /dev/null fallocate -l 128M $dev mkfs.btrfs $dev mount $dev $mnt for i in `seq 1 10`; do xfs_io -f -c "pwrite 0 2K" $mnt/file$i done xfs_io -f -c "falloc 0 64K" $mnt/file11 for i in `seq 1 32`; do xfs_io -f -c "reflink $mnt/file11 0 $(($i * 64))K 64K" $mnt/file11 done xfs_io -f -c "reflink $mnt/file11 32K $((33 * 64))K 32K" $mnt/file11 btrfs subvolume snapshot $mnt $mnt/snap1 umount $mnt btrfs-image -c9 $dev extent_data_ref.img ------ Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add helper to log pipe stdoutDavid Sterba2018-02-19
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add test for send -p on 2 mont pointsDavid Sterba2018-02-19
| | | | | | | Add testcase from issue, use reproducer from Axel Burri. Issue: #96 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: document exported testsuiteDavid Sterba2018-02-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: update clean-test.sh after the TEST_TOP updateDavid Sterba2018-02-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: unify test drivers, make ready for extenral testsuiteDavid Sterba2018-02-13
| | | | | | | | | | | Make the TOP variable more configurable, allow to set it to any path where to find binaries when the testsuite is exported, or fallback to system binaries. There's now more code duplication, the logic is now more complex so it's left open coded for clarity. Further cleanups are possible. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: update README.mdDavid Sterba2018-02-13
| | | | | | Irregular proofreading with adjustments and enhancements. Signed-off-by: David Sterba <dsterba@suse.com>