]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: add helper to kill background process running _btrfs_stress_replace
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Mar 2024 17:11:41 +0000 (17:11 +0000)
committerAnand Jain <anand.jain@oracle.com>
Wed, 3 Apr 2024 07:08:37 +0000 (15:08 +0800)
commit1305165c278eb1cd86e3677ee32603cd7801531f
tree452614d5b69aac1150a6f2de0e1d6413a7ea5896
parent058e46de642cee991d01de776639bb094ffcdcc3
btrfs: add helper to kill background process running _btrfs_stress_replace

Killing a background process running _btrfs_stress_replace() 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 "replace start" | 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>
common/btrfs
tests/btrfs/064
tests/btrfs/065
tests/btrfs/069
tests/btrfs/070
tests/btrfs/071