summaryrefslogtreecommitdiff
path: root/tests/btrfs/067
AgeCommit message (Collapse)Author
2024-04-28btrfs: remove useless commentsDavid Sterba
Remove comments from the new test template that are not relevant once the test case is written: - commented out common.filters (no filters used) - Import common functions. - real QA test starts here - Modify as appropriate. - get standard environment, filters and checks Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
2024-04-03btrfs/06[0-9]..07[0-4]: kill all background tasks when test is ↵Filipe Manana
killed/interrupted Test cases btrfs/06[0-9] and btrfs/07[0-4] exercise multiple concurrent operations while fsstress is running in parallel, and all these are left as child processes running in the background, which are correctly stopped if the tests are not interrupted/killed. However if any of these tests is interrupted/killed, it often leaves child processes still running in the background, which prevent further running fstests again. For example: $ /check -g auto (...) btrfs/060 394s ... 264s btrfs/061 83s ... 69s btrfs/062 109s ... 105s btrfs/063 52s ... 67s btrfs/064 53s ... 51s btrfs/065 88s ... 271s btrfs/066 127s ... 241s btrfs/067 435s ... 248s btrfs/068 161s ... ^C^C ^C $ ./check btrfs/068 FSTYP -- btrfs PLATFORM -- Linux/x86_64 debian0 6.8.0-rc7-btrfs-next-153+ #1 SMP PREEMPT_DYNAMIC Mon Mar 4 17:19:19 WET 2024 MKFS_OPTIONS -- /dev/sdb MOUNT_OPTIONS -- /dev/sdb /home/fdmanana/btrfs-tests/scratch_1 our local _scratch_mkfs routine ... btrfs-progs v6.6.2 See https://btrfs.readthedocs.io for more information. ERROR: unable to open /dev/sdb: Device or resource busy check: failed to mkfs $SCRATCH_DEV using specified options Interrupted! Passed all 0 tests In this case there was still a process running _btrfs_stress_subvolume() from common/btrfs. This is a bit annoying because it requires manually finding out which process is preventing unmounting the scratch device and then properly stop/kill it. So fix this by adding a _cleanup() function to all these tests and then making sure it stops all the child processes it spawned and are running in the background. All these tests have the same structure as they were part of the same patchset and from the same author. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
2024-04-03btrfs: remove stop file early at _btrfs_stress_subvolumeFilipe Manana
Instead of having every test case that uses _btrfs_stress_subvolume() removing the stop file before calling that function, do the file remove at _btrfs_stress_subvolume(). There's no point in doing it in every single test case. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
2024-04-03btrfs: add helper to stop background process running _btrfs_stress_subvolumeFilipe Manana
We have this logic to stop a process running _btrfs_stress_subvolume() spread in several test cases: touch $stop_file wait $subvol_pid Add a helper to encapsulate that logic and also remove the stop file after the process terminated as there's no point having it around anymore. This will help to avoid repeating the same code again several times in upcoming changes. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
2024-04-03btrfs: add helper to kill background process running _btrfs_stress_defragFilipe Manana
Killing a background process running _btrfs_stress_defrag() is not as simple as sending a signal to the process and waiting for it to die. Therefore we have the following logic to terminate such process: kill $pid wait $pid while ps aux | grep "btrfs filesystem defrag" | grep -qv grep; do sleep 1 done Since this is repeated in several test cases, move this logic to a common helper and use it in all affected test cases. This will help to avoid repeating the same code again several times in upcoming changes. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
2023-10-05fstests: redirect fsstress' stdout to $seqres.full instead of /dev/nullFilipe Manana
Several tests are redirecting the output of fsstress to /dev/null and this makes it harder to debug a test failure because we have no way of knowing what was the seed used by fsstress, as fsstress outputs the seed it uses to stdout. Very often when such a test fails, I have to go modify to redirect stdout to the $seqres.full file and then run it in a loop until I find a seed that causes a failure. So modify all tests that redirect fsstress' output to /dev/null to instead redirect it to the $seqres.full file. Note that for some tests I've added the style ">> $seqres.full" (with a space after >>) while for others I did ">>$seqres.full" (no space) - the reason for this was to keep style consistency within each test case. Signed-off-by: Filipe Manana <fdmanana@suse.com> Acked-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2023-09-20fstests: btrfs add more tests into the scrub groupAnand Jain
I wanted to verify tests using the command "btrfs scrub start" and found that there are many more test cases using "btrfs scrub start" than what is listed in the group.list file. So, get them to the scrub group. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
2021-06-27fstests: move test group info to test filesDarrick J. Wong
Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-09-21common: kill _supported_osDarrick J. Wong
fstests only supports Linux, so get rid of this unnecessary predicate. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-06-09btrfs: convert tests to SPDX license tagsDave Chinner
Fully scripted conversion, see script in initial SPDX license commit message. Signed-off-by: Dave Chinner <dchinner@redhat.com>
2016-03-23btrfs: 'subvolume stress' tasks need to exit gracefullyChandan Rajendra
The following scenario can occur when running btrfs/066, Task A Task B Task C run_test() - Execute _btrfs_stress_subvolume() in a background shell. _btrfs_stress_subvolme() ... - fork & exec "mount" Mount subvolume on directory in $TEST_DIR - Wait for fsstress to finish do_mount() - kill shell process executing - btrfs_mount() _btrfs_stress_subvolume() i.e. Task B. - Init process becomes the parent of "subvolume mount" task i.e. Task C. - In case subvolume is mounted (which is not the case), unmount it. - Complete mounting subvolume Hence on the completion of one iteration of run_test(), the subvolume created inside the filesystem on $SCRATCH_DEV continues to be mounted on $TEST_DIR/$seq.mnt. Subsequent invocations of run_test() (called for remaining Btrfs profile configs) fail during _scratch_pool_mkfs. Instead of killing the 'subvolume stress' task this commit makes _btrfs_stress_subvolume() to break out of the loop when a file exists on the filesystem. The commit also makes relevant changes to other users of _btrfs_stress_subvolume() i.e. btrfs/060, btrfs/065, btrfs/067 & btrfs/068. Suggested-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-10-14btrfs: new case to run btrfs subvolume create/delete and defrag operations ↵Eryu Guan
simultaneously Run btrfs subvolume create/mount/umount/delete and btrfs defrag operations simultaneously, with fsstress running in backgound. Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>