Commit Graph

215 Commits (886a8565e03bfacddc1383fe61439303226a8802)

Author SHA1 Message Date
David Sterba 78e1787c55 btrfs-progs: tests: use built binaries for 004-send-parent-multi-subvol
Signed-off-by: David Sterba <dsterba@suse.com>
2017-01-27 12:20:43 +01:00
David Sterba 2182142471 btrfs-progs: tests: add variable quotation to cli-tests
Signed-off-by: David Sterba <dsterba@suse.com>
2017-01-27 12:20:43 +01:00
Tsutomu Itoh 55e3a60195 btrfs-progs: tests: add test for --sync option of qgroup show
Simple test script for the following patch.

   btrfs-progs: qgroup: add sync option to 'qgroup show'

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-01-27 12:20:42 +01:00
David Sterba 0e95fff4ff btrfs-progs: tests: 005-qgroup-show
Signed-off-by: David Sterba <dsterba@suse.com>
2017-01-25 09:48:00 +01:00
Qu Wenruo 46b8ea0e99 btrfs-progs: convert-test: trigger chunk allocation after convert
Populate fs after convert so we can trigger data chunk allocation.
This can expose too restrict old rollback condition

Reported-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-21 16:29:06 +01:00
David Sterba 8fe3a7bfd0 btrfs-progs: tests: check for partscan support in misc/006-partitioned-loopdev
The travis CI does not have losetup with --partscan, skip the check in
that case so we can still run the mkfs testsuite.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:35 +01:00
David Sterba 26ad474e16 btrfs-progs: tests: add more gobal option to test 001-btrfs
Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:34 +01:00
David Sterba 9d133083aa btrfs-progs: tests: end of stream conditions
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-30 12:42:24 +01:00
David Sterba 50e742a6b0 btrfs-progs: tests: add support for additional command arguments
Add convenient support for extending command arguments, now implemented
for 'btrfs check' to cover the low-memory mode. If defined, arguments
are inserted to any 'btrfs check' command in tests. Exceptions could be
defined in common.local.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:06 +01:00
David Sterba 55db7bf059 btrfs-progs: tests: more variable quoting in common scripts
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:06 +01:00
David Sterba c1d714f944 btrfs-progs: tests: drop redundant test for rwx number validity
The list of rwx permissions is now hardcoded but used to begenerated and
the invalid numbers filtered out. Not necessary anymore.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:06 +01:00
Tsutomu Itoh b0d8975582 btrfs-progs: test: fix how to make test files in fsck-tests 013
In my test environment, following error was occurred because the size
of /lib/modules/`uname -r`/* is larger than 1GB.

# make test-fsck
    [TEST]   fsck-tests.sh
    [TEST/fsck]   013-extent-tree-rebuild
failed: cp -aR /lib/modules/4.9.0-rc5/ /test/btrfs-progs/tests/mnt
test failed for case 013-extent-tree-rebuild
Makefile:272: recipe for target 'test-fsck' failed
make: *** [test-fsck] Error 1
#

In this test case, 'generate_dataset small' is enough for making the
test files, so I will use 'generate_dataset' instead of 'cp'.

For this, move 'generate_dataset()' from 'common.convert' to 'common'.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:06 +01:00
David Sterba d8f93ce802 btrfs-progs: Update README and other docs
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:05 +01:00
David Sterba d4ce61f7a2 btrfs-progs: tests: add fallback to current directory for check_all_images
Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 11:07:05 +01:00
David Sterba 4884ae2f5e btrfs-progs: tests: enhance TEST_LOG features
Add new keyword to dump the log file after any test fails. Can be useful
for remote analysis of test failures.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 10:51:43 +01:00
David Sterba 7cd40e125b btrfs-progs: tests: check for TEST_LOG values by a regex
The set of possible values will be extended so check for existence of
the keyword.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 10:51:38 +01:00
David Sterba 9da3ce40f5 btrfs-progs: tests: change options to list all loop devices
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>
2016-11-23 10:51:29 +01:00
David Sterba 6572f884ba btrfs-progs: tests: use the root helper for various info retrieval commands
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>
2016-11-23 10:51:21 +01:00
David Sterba 691d1ac8fa btrfs-progs: tests: add basic checks for bad stream on the receive side
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 10:50:29 +01:00
David Sterba 5ee216a86f btrfs-progs: tests: add more fuzzed images from bugzilla
Fixing the problems by one does not scale now. Add more images despite
the fuzz tests will fail. They have been for some time already.

Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-23 10:49:37 +01:00
David Sterba 9d0e6a67f9 btrfs-progs: tests: enhance run_mayfail description comment
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:19 +01:00
David Sterba 7dbb17dbb2 btrfs-progs: tests: add quotation around variables in support scripts
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:19 +01:00
David Sterba 8dc653f003 btrfs-progs: tests: add quotation around variables in common.convert
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:19 +01:00
David Sterba cc0d3d3198 btrfs-progs: tests: add quotes around variables in common
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:19 +01:00
David Sterba 747146e237 btrfs-progs: tests: add path assertions to post-checks
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:19 +01:00
David Sterba 8a44fd062a btrfs-progs: tests: add assertion helper
Helper to extend sanity checks in various functions.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:18 +01:00
David Sterba 66b9b36805 btrfs-progs: tests: refactor post-convert check helpers
Separate checksum test from convert_test_post_check and use it to fix
the broken test 005 as reported.

References: https://bugzilla.kernel.org/show_bug.cgi?id=177141
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:18 +01:00
David Sterba 4ad7a967d1 btrfs-progs: tests: check if kernel has btrfs support
Add some sanity checks, reported among other issues via bugzilla.

References: https://bugzilla.kernel.org/show_bug.cgi?id=177141
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:25:18 +01:00
Tsutomu Itoh f529d6472e btrfs-progs: tests: add checking of send multiple clone source option
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>
2016-11-11 16:23:30 +01:00
David Sterba 45827710e2 btrfs-progs: tests: teach extract_image about packed streams
Packed streams for testing purposes should be packed with 'xz -9' and
use suffix .stream.xz .

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-11 16:23:29 +01:00
David Sterba 0bd0d9c062 btrfs-progs: tests: teach scan-results about more errors
ASAN detects use after free.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:35 +01:00
David Sterba 29a1a78aaa btrfs-progs: tests: add test for multi-subvolume send from parent
Fixed by "btrfs-progs: send: fix handling of multiple snapshots (-p
option)".

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba c8d1c4c792 btrfs-progs: tests: switch to dump- commands from inspect
The dump-super and debug-tree commands are replacements for the
standalone tools.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:13:37 +01:00
Qu Wenruo 40de2f6279 btrfs-progs: fsck-tests: Check if clear space cache works
Add test case to check the basic function of --clear-space-cache.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:12:49 +01:00
Qu Wenruo 112514568f btrfs-progs: test: Add image for quota verify stack overflow
For image with tree reloc tree, if its height is over level 2, the root
node's backref will point to itself.  It's valid for kernel, but quota
verify code can't handle it and cause a infinite call, overflowing the
stack.

Add minimal image to reproduce the bug, as regression test.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ minor cleanups in test.sh ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-24 15:03:12 +02:00
Qu Wenruo 9119319ef9 btrfs-progs: test: Add test image for btrfsck qgroup rescan detection
Fixed by commit 7c646c538e btrfs-progs: qgroup: Fix regression leads
to corrupted qgroup status.

Add minimal test image for that fix.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ minor cleanups in test.sh ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-24 15:03:04 +02:00
Qu Wenruo 8c663f9f36 btrfs-progs: convert-test: Add test case for common inode flags
Add a new test case to check if btrfs-convert copies common inode flags
like append(a), immutable(i).

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ minor fixes ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-24 14:58:15 +02:00
Lakshmipathi.G 0ec02b118d btrfs-progs: Add fast,slow symlinks, fifo types to convert test
Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
[ fix root helper use in fast_symlink ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-24 14:57:51 +02:00
David Sterba ba253d4ea5 btrfs-progs: tests: add script to help build coverage
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-10 09:46:51 +02:00
David Sterba a08ca376f7 btrfs-progs: tests: teach run_mayfail about sigabrt
Mayfail helper should stop when we encoutner an abort.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-05 12:39:01 +02:00
David Sterba b6bf79eb96 btrfs-progs: tests: don't treat segfault as ignorable error
Some fuzzed images cause various tools to crash but the mayfail helper
would not recognize that. We don't mind if the utility failes but it
must not crash.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-05 12:39:01 +02:00
David Sterba a5ac954153 btrfs-progs: tests: split test 004 to separate tests
Makes testing specific tool easier.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-05 12:39:01 +02:00
David Sterba 35d0588b64 btrfs-progs: tests: add fuzzed image with bad parent refs, qgroup-verify
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 15:07:24 +02:00
David Sterba 801f15bdf1 btrfs-progs: tests: add fuzzed images with bad blocksize/lengh of eb
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 15:07:24 +02:00
David Sterba 8d8de7c2e5 btrfs-progs: tests: add script to scan results for some known runtime errors
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 15:07:21 +02:00
David Sterba 5a38a52194 btrfs-progs: tests: iterate over fuzzed images and test various tools
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 15:07:21 +02:00
David Sterba da64ae3a0f btrfs-progs: reorganize extent_buffer and fix alignment of data
Reported by UBSAN, the checksum code tries to access unaligned data that
come from the extent_buffer.

struct extent_buffer {
        struct cache_extent        cache_node;           /*     0    48 */
        u64                        start;                /*    48     8 */
        u64                        dev_bytenr;           /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        u32                        len;                  /*    64     4 */

        /* XXX 4 bytes hole, try to pack */

        struct extent_io_tree *    tree;                 /*    72     8 */
        struct list_head           lru;                  /*    80    16 */
        struct list_head           recow;                /*    96    16 */
        int                        refs;                 /*   112     4 */
        u32                        flags;                /*   116     4 */
        int                        fd;                   /*   120     4 */
        char                       data[0];              /*   124     0 */

        /* size: 128, cachelines: 2, members: 11 */
        /* sum members: 120, holes: 1, sum holes: 4 */
        /* padding: 4 */
};

Add explicit alignment to data.

Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156471
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:05 +02:00
Wang Xiaoguang f9309584bf btrfs-progs: tests: add 021-partially-dropped-snapshot-case
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:01 +02:00
David Sterba 2125a65533 btrfs-progs: tests: add fuzzed images for bad block group offset
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:49:41 +02:00
David Sterba 5150103fcf btrfs-progs: tests: run check with various options on the fuzzed images
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:48:41 +02:00