kexec-tools/tests/scripts
Coiby Xu 294c965ca3 selftest: kill VM reliably by recursively kill children processes
qemu is launched in nested subprocess and can't be killed by simply
killing the job ids,

        PID    Command
    2269634    │  ├─ sshd: root [priv]
    2269637    │  │  └─ sshd: root@pts/0
    2269638    │  │     └─ -bash
    2269744    │  │        └─ make test-run V=1
    2273117    │  │           └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
    2273712    │  │              ├─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
    2273714    │  │              │  └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
    2273737    │  │              │     └─ timeout --foreground 10m /root/kexec-tools-300/tests/scripts/run-qemu -nodefaults -nographic -smp 2 -m 768M -monitor no
    2273738    │  │              │        └─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial stdio
    2273746    │  │              │           ├─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial std
    2273797    │  │              ├─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
    2273798    │  │              │  └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
    2273831    │  │              │     └─ timeout --foreground 10m /root/kexec-tools-300/tests/scripts/run-qemu -nodefaults -nographic -smp 2 -m 768M -monitor no
    2273832    │  │              │        └─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial stdio
    2273840    │  │              │           ├─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial std

This led to the error "qemu-system-x86_64: can't bind ip=0.0.0.0 to
socket: Address already in use".

This patch will kill qemu by killing all the children of the job id.

Signed-off-by: Coiby Xu <coxu@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
2021-10-15 19:20:25 +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: kill VM reliably by recursively kill children processes 2021-10-15 19:20:25 +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