summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* btrfs-progs: tests: mkfs/008 mkfs with forceDavid Sterba2018-01-03
| | | | | | | With extended tests in the following patch a file based filesystem image also needs -f, otherwise it will fail. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck/021: Cleanup custom check by overriding check_imageQu Wenruo2018-01-03
| | | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> [ update comment ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck/020: Cleanup custom check function by overriding ↵Qu Wenruo2018-01-03
| | | | | | | check_image function Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck: Introduce test images containing tree reloc treeQu Wenruo2018-01-03
| | | | | | | | | | | | | Reloc tree is a special tree with very short life span. It acts as a special snapshot for any tree, with related nodes/leaves or EXTENT_DATA modified to point to new position. Considering the short life span and its special purpose, it should be quite reasonable to keep them as both corner case for fsck and educational dump for anyone interested in relocation. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Introduce test case with keyed data backref with ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | shared tree blocks For snapshot shared tree blocks with source subvolume, the keyed backref counter only counts the exclusive owned references. In the following case, 258 is a snapshot of 257, which inherits all the reference to this data extent. ------ item 4 key (12582912 EXTENT_ITEM 524288) itemoff 3741 itemsize 140 refs 179 gen 9 flags DATA extent data backref root 257 objectid 258 offset 0 count 49 extent data backref root 257 objectid 257 offset 0 count 1 extent data backref root 256 objectid 258 offset 0 count 128 extent data backref root 256 objectid 257 offset 0 count 1 ------ 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: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-test: Add new image with shared block ref only metadata ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backref The image is dumped by modifying kernel to sleep long enough before merging relocation trees, so we can just copy the whole image to other place before kernel begins to merge reloc trees. And the base image is created by the following script to bump metadata size: ------ dev=~/test.img mnt=/mnt/btrfs umount $mnt &> /dev/null fallocate -l 128M $dev mkfs.btrfs -f -n 4k -m single -d single $dev mount $dev $mnt -o nospace_cache,max_inline=2048 btrfs subvolume create $mnt/src for i in $(seq -w 0 128); do xfs_io -f -c "pwrite 0 2k" $mnt/src/file_$i > /dev/null done for i in $(seq -w 0 64); do btrfs subvolume snapshot $mnt/src/ $mnt/snapshot_$i touch $mnt/snapshot_$i/new done sync ------ The image triggers several corner cases that the old lowmem mode didn't consider. Like metadata backref with FULL_BACKREF flag and only SHARED_BLOCK_REF backrefs for metadata. And several tree reloc trees with shared leaves/nodes to confuse old lowmem mode. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-test: Introduce test case for false data extent backref lostQu Wenruo2018-01-03
| | | | | | | | | | | Introduce a new test image, which has an extent item with no inlined extent data ref, but all keyed extent data ref. Only in this case we can trigger fase data extent backref lost bug in lowmem mode. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add test image for lowmem mode referencer count mismatch ↵Lu Fengqi2017-11-14
| | | | | | | | | | | false alert Add a image which can reproduce the extent item referencer count mismatch false alert for lowmem mode. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add test image for lowmem mode file extent interruptLu Fengqi2017-11-14
| | | | | | | | Add a image that the inlined extent coexist with the regular extent. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: extend fsck/028 to test fix-device-size and mountDavid Sterba2017-11-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/fsck: Add test case image for 'rescue fix-dev-size'Qu Wenruo2017-11-14
| | | | | | | | | | | | | | | | The image has 2 problems mixed: 1) Too small super total_bytes This super total_bytes is manually modified to create such problem. 2) Unaligned dev item total_bytes This is created by v4.12 kernel, with 128M + 2K device added, and original device removed. Then we can create such image with unaligned dev item total_bytes. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/common: Display warning only after searching for btrfs ↵Lakshmipathi.G2017-11-14
| | | | | | | kernel module Signed-off-by: Lakshmipathi.G <lakshmipathi.g@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: don't pass size to prepare_test_dev if not necessaryDavid Sterba2017-11-14
| | | | | | | Most tests don't need a specific size of the test device, the default 2GiB should be fine. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: add new cli-test for subvol get/set-defaultMisono, Tomohiro2017-11-14
| | | | | | | | Add new test to check functionality of subvol get/set-default. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> [ fix style issues, add missing SUDO_HELPER ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: 027/bad_extent_inline_ref_typeSu Yue2017-11-14
| | | | | | | | This case is for avoiding crash in lowmem check mode. Field type of extent_inline_ref in an extent is corrupted. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Allow check test to repair in lowmem mode for certain errorsQu Wenruo2017-10-16
| | | | | | | | | | | | | | Since lowmem mode can repair certain corruptions (mostly in fs tree), insert a beacon into each fsck test cases to allow some of them be tested in lowmem mode. With this patch, fsck option override will check the beacon file ".lowmem_repairable" in the same directory of the test image, and if the beacon exists, then it will also run lowmem mode repair to repair the image. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more configure option coverageDavid Sterba2017-10-13
| | | | | | | * test convert spec string * explicitly ask for zstd, as it is now autodetected Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fsck/007 fix so check --force worksDavid Sterba2017-10-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: arg override in command lineSu Yue2017-10-06
| | | | | | | | | | | | | | | | | Lowmem mode only repairs few cases which has a beacon file ".lowmem_repairable" in the case' directory. However, defining TEST_ENABLE_OVERRIDE=true in command line does work in above strategy. Because _skip_spec() in tests/common.local isn't interpreted by shell in that case. Solve it by making _skip_spec() always be defined in common.local. Reported-by: David Sterba <dsterba@suse.cz> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> [ keep the _skip_spec check ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: don't list toplevel subvolme in 'subvol list'David Sterba2017-10-06
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc-test: use raid1 for data to enable mount with -o degradedMisono, Tomohiro2017-10-06
| | | | | | | | | | | | | | | | | kernel 4.14 introduces new function for checking if all chunks is ok for mount with -o degraded option. commit 21634a19f646 ("btrfs: Introduce a function to check if all chunks a OK for degraded rw mount") As a result, raid0 profile cannot be mounted with -o degraded on 4.14. This causes failure of the misc-test 011 "delete missing device". Fix this by using raid1 profile for both data and metadata. This also should work for kernel before 4.13. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: check there are no unprintable characters in btrfs-image ↵David Sterba2017-09-25
| | | | | | -ss output Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Remove misleading BCP 78 boilerplate from SHA implementationNicholas D Steeves2017-09-25
| | | | | | | | | | | | | | | | | | | BCP 78 applies to RFC 6234, but sha224-256.c is Simplified BSD. This causes the following lintian error when building on Debian and Debian derivatives: E: btrfs-progs source: license-problem-non-free-RFC-BCP78 tests/sha224-256.c Please consult the following email from debian-legal@lists.debian.org for more information: https://lists.debian.org/debian-legal/2017/08/msg00004.html Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com> [ I've copied too much from the RFC that's not related to the code, covered by the explicit copyright notice in the file ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add required IETF Trust copyright to SHA implementationNicholas D Steeves2017-09-25
| | | | | Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: make sure _is_file_or_command does not get confusedDavid Sterba2017-09-25
| | | | | | | | | | | The test cli/007-check-force reports something like: $ type -p '--string that starts with dashes' bash: type: --: invalid option Add the option/argument separator. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: remove temporary images in mkfs/005 and mkfs/006David Sterba2017-09-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: remove temporary loopdev filesDavid Sterba2017-09-25
| | | | | | Remove files for testing loop devices when using the helper. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add testing image for zstd for btrfs-restoreNick Terrell2017-09-25
| | | | | | | | | | | Adds tests for the new features based on a prebuilt btrfs image with a zstd compressed file. Split from the previous patch. Signed-off-by: Nick Terrell <terrelln@fb.com> [ with some cleanups ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix run_mustfail in cli-tests/007-check-forceDavid Sterba2017-09-25
| | | | | | | | The sanity check in run_mustfail does not work as expected and allowed the command to continue without the missing parameter Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196893 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: add new test for inspect-internal rootidMisono, Tomohiro2017-09-08
| | | | | | | | | | | This new test checks inspect-internal rootid - handle path to subvolume/directory/file as an argument - get different id for each subvolume - get the expected id for each file/directory (i.e. the same as containing subvolume) Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: check for kernel support for reiserfsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: enhance post-rollback fsck testsDavid Sterba2017-09-08
| | | | | | | | The post-rollback helper still assumes just extN, we need an extra argument that'll get passed to fsck. Change all callsites at once so the tests do not fail temporarily. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: fix name generation not to contain trailing spacesMisono, Tomohiro2017-09-08
| | | | | | | | | | | | | First patch causes test-convert fails. This is because generate_dataset() creates a name containing trailing spaces for "slow_symlink" type, and cause getfacl error in convert_test_perm(). (This is not noticed since original run_check_stdout() throws away the error.) Fix this by use space for delimiter for cut. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: fix run_check_stdout() call _fail()Misono, Tomohiro2017-09-08
| | | | | | | | | | run_check_stdout() uses "... | tee ... || _fail". However, since tee won't fail, _fail() is not called even if first command fails. Fix this by checking PIPESTATUS in the end. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case for mkfs --rootdir parameterQu Wenruo2017-09-08
| | | | | | | | Add test case which checks if -r|--rootdir mkfs option can handle symlink/char/block/fifo files. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: missing device and slack space reportDavid Sterba2017-09-08
| | | | | | | Verify that a missing device will not result in reporting a negative value interpreted as 16EiB. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: convert misc/011-delete-missing-device to loopdevsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: convert misc/006-image-on-missing-device to loopdevsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: move loopdev helpers out of the testcase to commonDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: cleanup loop device helpersDavid Sterba2017-09-08
| | | | | | | Make the loop device helpers a bit more generic before moving them to the common helpers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add testcase for 'fi du' and empty subvolDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add test for check --forceDavid Sterba2017-09-08
| | | | | | Basic test of the --force functionality, on an empty filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more sanitizer message patterns to log scannerDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: limit size of log dump from conver testsDavid Sterba2017-09-08
| | | | | | | The convert tests generate lots of log material, travis CI has limit 4MB so we don't see anything useful when a late test fails. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix TEST_LOG=dump in convert testsDavid Sterba2017-09-08
| | | | | | | Test failure in convert tests with log dump does not happen because _fail is called before that and exits. Other test types are ok. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: update READMEDavid Sterba2017-09-08
| | | | | | Wording, runtime dependencies. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more checks for tools used in convert testsDavid Sterba2017-09-08
| | | | | | | Tools that may not be present in common installations should be checked in the tests. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add build checks for sanitization featuresDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more fuzzed images from bugzillaDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add support for converting reiserfsJeff Mahoney2017-09-08
| | | | | | | | | | Many of the test cases for convert apply regardless of what the source file system is and using ext4 is sufficient. I've included several test cases that are reiserfs-specific. Signed-off-by: Jeff Mahoney <jeffm@suse.com> [ patch split from the previous one, minor cleanups in common.convert ] Signed-off-by: David Sterba <dsterba@suse.com>