summaryrefslogtreecommitdiff
path: root/tests/fsck-tests/012-leaf-corruption
Commit message (Collapse)AuthorAge
* btrfs-progs: tests: add missing prerequisitesDavid Sterba2016-01-12
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: test multiple-linked file corruptionNaohiro Aota2016-01-12
| | | | | | | | | This commit extends the leaf corruption test to try to repair a file linked from multiple directory. It stresses a case that some links to a file is broken but others kept valid. Signed-off-by: Naohiro Aota <naota@elisp.net> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Use --no-same-owner option for tarZhao Lei2015-09-01
| | | | | | | | | | | | | | | | | | | | | | Some test failed in my nfs dir: ... [TEST] 006-bad-root-items tar: test.img: Cannot change ownership to uid 1000, gid 1000: Invalid argument tar: Exiting with failure status due to previous errors failed to extract default_case.tar.xz test failed for case 006-bad-root-items It is because the image file's owner is: # tar tvf default_case.tar.xz -rw-r--r-- fdmanana/fdmanana 2147483648 2014-10-17 17:59 test.img And make tar failed in chown in nfs. It is not a big issue because we don't use nfs commonly, but extract the image file with ownership of current user will be a better choice. 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: Add -o loop to fsck-tests/012-leaf-corruptionZhao Lei2015-08-31
| | | | | | | | | To avoid following mount error in test: mount: /root/btrfs/progs/tests/fsck-tests/012-leaf-corruption/test.img is not a block device (maybe try `-o loop'?) Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use local btrfs-image in leaf corruption testWorMzy Tykashi2015-04-09
| | | | | | | | | | Currently this test uses the system btrfs-image. If there isn't a btrfs-image on $PATH, the test fails. The test should be using the locally compiled btrfs-image, not the system one. Signed-off-by: WorMzy Tykashi <wormzy.tykashi@gmail.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fsck-tests: Remove duplicatesd TEST_MNT setup.Qu Wenruo2015-04-07
| | | | | | | | Since we have already had TEST_MNT fallback setup to $TOP/tests/mnt, just remove duplicated setting in 012-leaf-corruption/test.sh Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: test-frame: Update variant namesQu Wenruo2015-04-07
| | | | | | | | | | | | Use upper case variant name for the following variants: 1) top -> TOP 2) script_dir -> SCRIPT_DIR And change the following variant name: 1) RESULT -> RESULTS Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests, clean up scriptsDavid Sterba2015-03-09
| | | | | | | Rename variables, use caps, call true by full path, add quotation to variables and a few wording fixes. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fsck-test: Add check_sudo to check valid root/sudo privilegeQu Wenruo2015-03-09
| | | | | | | | | | | | | | | | | | | | | | Although fsck-test/012 uses sudo, it uses 'sudo -n', which won't prompt user to input password and will return 1 if no valid credential is found. And this makes test result quite annoying since it fails to mount and still continue, which will always fail. This patch will check 'sudo -v -n' and 'sudo -n true' to determine whether sudo works fine in different version/settings, since in some setting/version, 'sudo -v -n' will fail even the user is set NOPASSWD. Also, remove the 'have_root_helper' variant, since there is a possibility that sudo credential will timeout during the test and 'have_root_helper' won't help to detect such problem. New '_sudo' command will do credential check if needed to avoid such problem. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests, use the root helper in 012David Sterba2015-01-14
| | | | | | We need it to mount/umount, to traverse lost+found and stat the results. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Move leaf-corruption no extent data case and add verification ↵Qu Wenruo2015-01-14
script Move leaf-corruption type no extent data case to its dir, and add verification script in test.sh The verification script is based on manual btrfs-debug-tree check. The image can also be reused to other leaf-corruption type, like corrupted leaf contains regular file extent data case. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>