summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* 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>
* btrfs-progs: tests: fix _is_file_or_command detectionDavid Sterba2017-08-25
| | | | | | | | type -p returns an empty string for nonexistent commands, but the -f test on an empty string does not behave the same on all shells. To be safe, use the quoted value. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: catch bad usage of run_mustfailDavid Sterba2017-08-24
| | | | | | | This function has an extra argument and can get forgotten, add a sanity check so the bad usage can be caught during development. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: scan results for commands not foundDavid Sterba2017-08-24
| | | | | | | In case of typos or messed up command execution, we'd like to be able to catch that. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-test: case for corrupted dir item nameSu Yue2017-08-24
| | | | | | | | | | In this test case, all name in dir_item, dir_index, inode_ref are corrupted to another one. btrfs check should report errors about the corrupted dir_item but btrfs can't repair the case now. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix typo in convert-tests/008-readonly-imageJeff Mahoney2017-08-24
| | | | | | | | The dd in convert-tests/008-readonly-image is expected to fail, so there being a typo in the file name has gone unnoticed. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Use '-t btrfs' mount option in testsAdam Buchbinder2017-07-20
| | | | | | | | Without it, mount (at least from util-linux 2.20.1) tries (and fails) to mount some filesystems as NTFS. Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: use separate helper for mounting convert filesystemsDavid Sterba2017-07-20
| | | | | | | | We'll enforce the btrfs type for mount everwhere so we must provide a way to mount converted filesystems. Add a new helper that will try to mount the given type. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: enhance API to request type of the converted filesystemDavid Sterba2017-07-20
| | | | | | | We'll use mount -t $fstype later on, extend the API so we don't have to parse the type from other parameters. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Fix missing internal deps in check and misc testsAdam Buchbinder2017-07-20
| | | | | | | | | Doing a straight 'make test' would fail because some misc and fsck tests require particular tools to already be built. Add dependencies at the Makefile and shell-script level. Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case to check file hole extents with NO_HOLES flagQu Wenruo2017-06-26
| | | | | | | | | | | | Add test case which we have NO_HOLES incompat flag while still have hole file extent. This can be created by enabling NO_HOLES feature on an existing filesystem, which lowmem mode would cause false alert for it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor adjustments ] 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: remove variable quotation from convert-testsTsutomu Itoh2017-06-26
| | | | | | | | | | | | | | | | | | | | | | In btrfs-progs-v4.11-rc1, the following convert-tests failed. [TEST/conv] 008-readonly-image [TEST/conv] readonly image test, btrfs defaults failed: mke2fs -t ext4 -b 4096 -F /Build/btrfs-progs-v4.11-rc1/tests/test.img test failed for case 008-readonly-image Makefile:271: recipe for target 'test-convert' failed make: *** [test-convert] Error 1 [TEST/conv] 009-common-inode-flags [TEST/conv] common inode flags test, btrfs defaults failed: mke2fs -t ext4 -b 4096 -F /Build/btrfs-progs-v4.11-rc1/tests/test.img test failed for case 009-common-inode-flags Makefile:271: recipe for target 'test-convert' failed make: *** [test-convert] Error 1 So, remove quotes from $default_mke2fs. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> 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: tests: add variable quotation to convert-testsLakshmipathi.G2017-05-15
| | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fssum: fix warning, include correct header for major()David Sterba2017-05-02
| | | | | | | | | | | | tests/fssum.c:599:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. sum_add_u64(&cs, major(st.st_rdev)); Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, fix memory leakLu Fengqi2017-05-02
| | | | | | | Free the alloced memory and close dir before exit. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add variable quotation to fsck-testsLakshmipathi.G2017-05-02
| | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> 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: Add SHARED_DATA_REF test image for check lowmem modeQu Wenruo2017-03-31
| | | | | | | | | | | | | | Introduce a new image, which contains external SHARED_DATA_REF items to trigger a lowmem mode false alert. The image only contains external SHARED_DATA_REF and no inlined data backref. Before the image, we only have inlined shared data ref, which is not enough to trigger lowmem mode false alert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> 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: fssum, switch from MD5 to SHA256David Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add SHA256David Sterba2017-03-16
| | | | | | | | | | In order to drop dependency on SSL library to compute MD5 in fssum, we'll use the reference implementation from RFC 6234. The checksum is not in a cryptographically sensitive context, but we're going to skip MD5 and SHA-1 anyway. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, update includesDavid Sterba2017-03-16
| | | | | | Remove unneeded and add headers that define time_te and int types. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop *_SOURCE defines, already provided via config.hDavid Sterba2017-03-16
| | | | | | | | | | | | | In file included from /usr/include/stdio.h:27:0, from kerncompat.h:22, from tests/fssum.c:25: /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^~~~~~~ We've solved that long time ago and config.h now provides the macros. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, use our endianity helperDavid Sterba2017-03-16
| | | | | | | | The function htonll is not provided by the standard library and we can replace it by our cpu-to-XX helpers. This switches the endianity of the checksummed value to LE, but this is not a problem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop unnecessray build definesDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fssum utilityDavid Sterba2017-03-16
| | | | | | | | | | Copy from fstests, originally from git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git Needs libcrypto to link but this check is now missing in configure. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> 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: mkfs/002 and 003: use TEST_DEV instead of IMAGEDavid Sterba2017-03-16
| | | | | | As we don't know what's the TEST_DEV like, use the explicit mkfs limit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: use TEST_DEV in cli-testsDavid Sterba2017-03-16
| | | | | | IMAGE points to the fallback image, tests should use TEST_DEV. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: add preliminary do's & dont's for testsDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: do test build of library-test.staticDavid Sterba2017-03-16
| | | | 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: use dd in 025-file-extents for creating filesDavid Sterba2017-03-08
| | | | | | | Drop the dependency on xfs_io as it's not a standard tool, though it provides convenience. We use a simple write here so dd can manage. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix permissions of temporary files in 025-file-extentsDavid Sterba2017-03-08
| | | | | | | | If the tests are started from non-root user, the fallocate and xfs_io fail. Use the root helper as a workaround, we'd should fix the perms instead. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: Fix lowmem mode override to allow it skip repair workLu Fengqi2017-03-08
| | | | | | | | | | | | | | | | | | | | Current common.local doesn't handle lowmem mode well. It passes "--mode=lowmem" alone with "--repair", making it unable to check lowmem mode. It's caused by the following bugs: 1) Wrong variable in test/common.local We should check TEST_ARGS_CHECK, not TEST_CHECK, which is not defined so we never return 1. 2) Wrong parameter passed to _cmd_spec() in test/common This prevents us from grepping the correct parameters. Fix it. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add new test case for file extent false alertsQu Wenruo2017-03-08
| | | | | | | | | | | | | | | | | | Lowmem mode exposed several false alerts, all related to file extents check. 1) Partly written prealloc extent Cause lowmem mode to report missing csum or prealloc extent should not have csum 2) Compressed inline extent Cause lowmem mode to find mismatch on inline len and item len. While no error message is output but exit silently. Reported-by: Chris Murphy <chris@colorremedies.com> Reported-by: Christoph Anton Mitterer <calestyo@scientia.net> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Make fsck-test/013 compatible with lowmem modeQu Wenruo2017-03-08
| | | | | | | | | | | | | fsck-tests/013-extent-tree-rebuild uses "--init-extent-tree", which implies "--repair". But the test script doesn't specify "--repair" for lowmem mode test to detect it. Add it so lowmem mode test can be happy with it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test image for lowmem mode block group false alertQu Wenruo2017-03-08
| | | | | | | | | Add a minimal image which can reproduce the block group used space false alert for lowmem mode fsck. Reported-by: Christoph Anton Mitterer <calestyo@scientia.net> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Move fsck-tests/015 to fuzz testsQu Wenruo2017-03-08
| | | | | | | | | | | The test case fsck-tests/015-check-bad-memory-access can't be repair by btrfs check, and it's a fortunate bug makes original mode to forget the error code from extent tree, making original mode pass it. So fuzz-tests is more suitable for it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: use built binaries for 004-send-parent-multi-subvolDavid Sterba2017-01-27
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add variable quotation to cli-testsDavid Sterba2017-01-27
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add test for --sync option of qgroup showTsutomu Itoh2017-01-27
| | | | | | | | | 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>
* btrfs-progs: tests: 005-qgroup-showDavid Sterba2017-01-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert-test: trigger chunk allocation after convertQu Wenruo2016-12-21
| | | | | | | | | 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>
* btrfs-progs: tests: check for partscan support in misc/006-partitioned-loopdevDavid Sterba2016-12-14
| | | | | | | 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>
* btrfs-progs: tests: add more gobal option to test 001-btrfsDavid Sterba2016-12-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>