summaryrefslogtreecommitdiff
path: root/tests/misc-tests
Commit message (Collapse)AuthorAge
* 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: 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 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: introduce TEST_TOP and INTERNAL_BIN for testsGu Jinxiang2018-02-13
| | | | | | | | | | | | Use TEST_TOP as base for tests to reference any files, this will be used for git and external testsuite. INTERNAL_BIN is needed for referencing binaries that could reside in different paths in git vs external testsuite. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> [ add quotes around sourced files, update changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: 029-super-recovery: cleanup the testDavid Sterba2018-01-31
| | | | | | | Transform the test to the common helpers and don't manage the loop devices here. The test category changes from check to misc. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix typos in test namesDavid Sterba2018-01-03
| | | | 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: 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: 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: 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: 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: add testcase for 'fi du' and empty subvolDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test for restoring multiple devices fs into a single deviceFilipe Manana2017-06-26
| | | | | | | | | | | Test that we are able to create an image from a multiple devices fs, that we are able to restore that image into a single device and finally that we are able to mount it. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> [ added shell quotation and chmod a+w so testsuite on NFS works ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix misc/019-receive-clones-on-munted-subvolDavid Sterba2017-05-15
| | | | | | | | Patches "btrfs-progs: tests: correctly receive clones to mounted subvol" (8eaf63bc9a7b957c566be23df7c6701a9a5b22a2) and followup are missing last unmount which leads to failure of misc/020. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc-tests: Superblock corruption and recovery using backupLakshmipathi.G2017-04-19
| | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/018-receive use receive -e to terminate on end markerChristian Brauner2017-04-19
| | | | | | Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> [ enhance tests to take extra options and use for -e ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/019, use fssumDavid Sterba2017-03-16
| | | | | | The fssum utility is now ready to use, test still passes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: cleanup use of IMAGE and replace by helpersDavid Sterba2017-03-16
| | | | | | | | Nearly each use of IMAGE can be replaced by common helpers as there are no specific requirements on the testing filesystem. There are still a few left that need to be evaluated and converted eventually. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: port 019-receive-clones-on-munted-subvolDavid Sterba2017-03-16
| | | | | | Port from fstests. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: correctly receive clones to mounted subvolBenedikt Morbach2017-03-16
| | | | | | | | | | | | | | | clone needs to resolve the paths of the involved subvolumes in the target fs from their UUIDs. When doing so it might need to strip the prefix that is mounted as the root of the fs from those paths. It didn't do so correctly when processing the source of "clone" commands This is a regression test for btrfs-progs: receive: handle root subvol path in clone Signed-off-by: Benedikt Morbach <benedikt.morbach@googlemail.com> [ copied the fstests version, will be updated later ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: end of stream conditionsDavid Sterba2016-11-30
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: change options to list all loop devicesDavid Sterba2016-11-23
| | | | | | | The option --list might not be available on older versions, the equvalent is --all. Discovered via failed travis build. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: use the root helper for various info retrieval commandsDavid Sterba2016-11-23
| | | | | | | The current user might not be able to peek into the loop files directly, use the helper. Discovered by running tests in travis. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add basic checks for bad stream on the receive sideDavid Sterba2016-11-23
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add checking of send multiple clone source optionTsutomu Itoh2016-11-11
| | | | | | | | Sending stream size of clone-src(-c) option is checked. Fixed by "btrfs-progs: send: fix handling of -c option". Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: switch to dump- commands from inspectDavid Sterba2016-11-09
| | | | | | | The dump-super and debug-tree commands are replacements for the standalone tools. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add 015-dump-super-garbageDavid Sterba2016-09-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: 006-image-on-missing-device: fix btrfs tool pathLuis Henriques2016-07-13
| | | | | | | | | | | | | | | | If btrfs isn't in the path, this test will fail with: [TEST/misc] 006-image-on-missing-device failed: btrfs fi show /dev/loop0 test failed for case 006-image-on-missing-device Makefile:226: recipe for target 'test-misc' failed make: *** [test-misc] Error 1 Fix the test script by adding $TOP to the path. Signed-off-by: Luis Henriques <henrix@camandro.org> [ updated to full command names ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: typo review of strings and commentsNicholas D Steeves2016-06-01
| | | | | Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add misc 014-filesystem-labelDavid Sterba2016-03-30
| | | | | | Test various label lengths on a mounted filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add 013-subvolume-sync-crashDavid Sterba2016-03-17
| | | | | | | | Test for "btrfs-progs: subvol sync: fix memory corruption, undersized array", a lot of deleted subvolumes in the 'subvol sync' will not fit into the array, should result in a glibc report. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc-test: Add regression test for find-root gives empty resultQu Wenruo2016-02-26
| | | | | | | | | Add regression test for btrfs-find-root gives empty result even the fs is OK. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ enhanced test ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add missing prerequisitesDavid Sterba2016-01-12
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add 011-delete-missing-deviceDavid Sterba2015-11-16
| | | | | | | Test for "btrfs-progs: allow device deletion using 'missing' keyword again". Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add 010-convert-delete-ext2-subvolDavid Sterba2015-11-02
| | | | | | | | Testcase for "Btrfs-progs: fix btrfs-convert rollback to check ROOT_BACKREF", make sure we don't try a rollback if the ext2_subvol is half-deleted. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: misc tests: add 009-subvolume-sync-must-waitDavid Sterba2015-10-21
| | | | | | | Test to verify that subovolume sync waits until the subvolume is cleaned. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Introduce misc-tests/008-leaf-crossing-stripesZhao Lei2015-10-19
| | | | | | | | | | | | | | | | | | | | | To check is btrfs-convert create bad filesystem with leaf across stripes. It is happened in progs version <=v4.1.2, and fixed by patch titled: btrfs: convert: Avoid allocating metadata extent crossing stripe boundary which was merged in v4.2. Notice thar this testcase can not report error in old version of btrfs-progs, because "btrfs check" can't check this type of error in those version, but we have another testcase in fsck-tests, to check is "btrfs check" support this check. So, the above 2 testcase together can check leaf-crossing-stripes bug in all versions. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> [renamed and other minor changes] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Use mount_test_dev for misc-tests/007-subvolume-syncZhao Lei2015-09-01
| | | | | | | So this test can support both block device and loop device simply. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Introduce init_env to initialize common env variantZhao Lei2015-09-01
| | | | | | | | | | | | | | | | | | | | | | | For example, $TEST_DIR is common used in severial tests, and have duplicated code for initialize. These duplicated code not only benifits harddisk vendor, but have inconsistent details, as: convert-tests.sh: lack of mkdir fsck-tests/012-leaf-corruption/test.sh: unnecessary mkdir fsck-tests/013-extent-tree-rebuild/test.sh: unnecessary init misc-tests/XXX ... And severial error message: _fail "unable to create mount point on $TEST_MNT" _fail "failed to create mount point" ... This patch move initizlizaton of $TEST_DIR to common init_env(), to avoid above problem, and init_env() can be used to add more things in future. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Introduce subvolume sync testZhao Lei2015-08-31
| | | | | | | | | | | | Current code have following bug for subvolume sync: 1: If there are more than 1 subvolume to sync, the program will infinitely loop. 2: return !0 in exit This patch add misc-tests/007-subvolume-sync for above case. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests, verify that btrfs-image works on a missing deviceDavid Sterba2015-08-31
| | | | | | | | Create a 2 device raid1 filesystem, fill with some data, delete one device (the device node must not exist) and try to dump a filesystem image. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Introduce a misc test for thread conflict in btrfs-convertZhao Lei2015-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code of btrfs-convert have a bug of thread conflict, which caused invalid memory accessing between threads, and make program panic. This patch add a test item for above bug, as: # ./misc-tests.sh [TEST] 001-btrfstune-features [TEST] 002-uuid-rewrite [TEST] 003-zero-log [TEST] 004-convert-thread-conflict failed: btrfs-convert /root/btrfsprogs/tests/test.img test failed for case 004-convert-thread-conflict # # cat misc-tests-results.txt ... ############### btrfs-convert /root/btrfsprogs/tests/test.img trans 7 running 5 ctree.c:363: btrfs_cow_block: Assertion `1` failed. btrfs-convert(btrfs_cow_block+0x92)[0x40acaf] btrfs-convert(btrfs_search_slot+0x1cb)[0x40c50f] btrfs-convert(btrfs_csum_file_block+0x20f)[0x41d83a] btrfs-convert[0x43422d] btrfs-convert[0x4342cd] btrfs-convert[0x4345ca] btrfs-convert[0x434767] btrfs-convert[0x435770] btrfs-convert[0x439748] btrfs-convert(main+0x13f8)[0x43b09d] /lib64/libc.so.6(__libc_start_main+0xfd)[0x335e01ecdd] btrfs-convert[0x407649] create btrfs filesystem: blocksize: 4096 nodesize: 16384 features: extref, skinny-metadata (default) creating btrfs metadata. creating ext2fs image file. failed: btrfs-convert /root/btrfsprogs/tests/test.img test failed for case 004-convert-thread-conflict # Note that this bug is not happened every time, especilly in slow device as loop(slow cpu with fast block device is likely to trigger). I set loop count to 20 to make bug happened in 90% tests. Suggested-by: David Sterba <dsterba@suse.com> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Move code to create loop device to commonZhao Lei2015-08-31
| | | | | | | | This code block is used several tests, move it to ./common and add a helper. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: inspect: add command min-dev-sizeDavid Sterba2015-08-31
| | | | | | | | | | Previously in 'filesystem resize get_min_size', now 'inspect-internal min-dev-size'. We'd like to avoid cluttering the 'resize' syntax further. The test has been updated to exercise the new option. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs-progs: add feature to get mininum size for resizing a fs/deviceFilipe Manana2015-08-31
| | | | | | | | | | | | | | | | | | | Currently there is not way for a user to know what is the minimum size a device of a btrfs filesystem can be resized to. Sometimes the value of total allocated space (sum of all allocated chunks/device extents), which can be parsed from 'btrfs filesystem show' and 'btrfs filesystem usage', works as the minimum size, but sometimes it does not, namely when device extents have to relocated to holes (unallocated space) within the new size of the device (the total allocated space sum). This change adds the ability to reliably compute such minimum value and extents 'btrfs filesystem resize' with the following syntax to get such value: btrfs filesystem resize [devid:]get_min_size Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>