kexec-tools/tests/scripts
Tao Liu f4ab396574 selftest: run-test.sh: wait for subprocess instead of kill it
When run tests with 2 VMs, for example nfs/ssh kdump tests, client VM will do the
crash and dump, server VM will do vmcore saving and if-vmcore-exists
check.

Previously, when client VM finishes running, run-test.sh will kill the lead background
process, and then check if server VM has outputted "TEST PASSED" or "TEST FAILED" string.
However it didn't wait for server VM to finish. As a result, the server VM's final
outputs are not collected and checked, leaving the test result as "TEST RESULT NOT FOUND"
sometimes.

For example, the following is the pstree status of $(jobs -p) before it
gets killed. We can see the server VM is still running:

run-test.sh,172455 /root/kexec-tools/tests/scripts/run-test.sh --console nfs-early-kdump
  └─run-test.sh,172457 /root/kexec-tools/tests/scripts/run-test.sh --console...
      └─timeout,172480 --foreground 10m /root/kexec-tools/tests/scripts/run-qemu...
          └─qemu-system-x86,172481 -enable-kvm -cpu host -nodefaults...
              ├─{qemu-system-x86},172489
              ├─{qemu-system-x86},172492
              ├─{qemu-system-x86},172493
              ├─{qemu-system-x86},172628
              └─{qemu-system-x86},172629

In this patch, we will wait for $(jobs -p) to finish, in order to get
the complete output of test results.

Signed-off-by: Tao Liu <ltao@redhat.com>
Acked-by: Coiby Xu <coxu@redhat.com>
2022-01-24 11:17:52 +08:00
..
build-scripts selftest: Fix bug of collecting test RPMs from argument 2021-03-24 15:50:41 +08:00
kexec-kdump-test selftest: ignore all spaces when compare the dmesg files 2021-06-08 22:21:47 +08:00
testcases selftest: fix the error of misplacing double quotes 2021-06-08 22:21:47 +08:00
build-image.sh selftest: Add basic infrastructure to build test image 2020-09-17 10:42:34 +08:00
copy-from-image.sh selftest: Show the path of dumped vmcore on test end 2020-09-17 10:43:02 +08:00
image-init-lib.sh selftest: Fix qcow2 image format detect 2020-11-18 01:53:01 +08:00
run-qemu selftest: replace qemu-kvm with one based on dracut's run-qemu 2021-03-24 15:51:02 +08:00
run-test.sh selftest: run-test.sh: wait for subprocess instead of kill it 2022-01-24 11:17:52 +08:00
spawn-image-shell.sh selftest: Add basic test framework 2020-09-17 10:42:54 +08:00
test-lib.sh selftest: kill VM reliably by recursively kill children processes 2021-10-15 19:20:25 +08:00