Add test for linkage error of lookup_path_rootid. The built binary has
to be run to catch also run-time errors.
Signed-off-by: David Sterba <dsterba@suse.com>
The refactoring in commit 1c85c3de5a has
broken use of libbtrfs that does not exhibit during build but at the run
time.
Fixes: 1c85c3de5a
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=600078
Reported-by: Mike Gilbert <floppymaster@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
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>
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>
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>
Also, the other progress messages go to stderr, so "checking extents"
probably should, as well.
Fixes: c7a1f66a20 ("btrfs-progs: check: switch some messages to common helpers")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Option -f, -F and --sort don't work because a conditional expression
of ASSERT is wrong.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
If this flag is passed to open_ctree(), we'll clear the
FREE_SPACE_TREE_VALID compat_ro bit. The kernel will then reconstruct
the free space tree the next time the filesystem is mounted.
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Run more tests in the travis build environment. The mkfs tests are still
left out due to missing capabilities of losetup.
Other minor travis adjustments.
Signed-off-by: David Sterba <dsterba@suse.com>
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>
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>
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>
The read_buf does not verify that we've read the expected number of
bytes. A corrupted of malformated stream will not be detdcted.
Signed-off-by: David Sterba <dsterba@suse.com>
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>
Definition of NULL is missing if ioctl.h is included standalone or when
no other include pulls the definition.
Reported-by: Sergei Trofimovich <slyich@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
The find_most_right_entry() tends to miss on the best entry if it is the
first one on the list and there are only two entries in the list. So,
we assign both prev and best to entry.
To do this, the selection process (rather the rejection) has to be
performed earlier to skip on broken==count.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
In get_running_kernel_version() function, we directly pass return
pointer from strtok_r() to string_is_numerical().
Return pointer from strok_r() can be NULL, but string_is_numerical()
can't handle it and will cause NULL pointer derefernces.
Fix it by check if it's a NULL pointer first.
Resolves-Coverity-CID: 1374097
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>