Skip to content

Commit

Permalink
virsh_crash: Test to check environment behavior after test
Browse files Browse the repository at this point in the history
The test crashes virsh. It can be used to check if the core file
will be recorded and if the coredump will be reported.

Signed-off-by: Sebastian Mitterle <[email protected]>
  • Loading branch information
smitterl committed Jan 9, 2024
1 parent 500ae26 commit bcce29a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libvirt/tests/cfg/virsh_crash.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- virsh.crash:
type = virsh_crash
variants:
- in_ci:
18 changes: 18 additions & 0 deletions libvirt/tests/src/virsh_crash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from time import sleep
import logging as log

from virttest import utils_misc


# Using as lower capital is not the best way to do, but this is just a
# workaround to avoid changing the entire file.
logging = log.getLogger('avocado.' + __name__)


def run(test, params, env):
utils_misc.cmd_status_output("virsh event --all --loop > /dev/null 2>&1 &",
shell=True)
sleep(5)
_, pid = utils_misc.cmd_status_output("pidof virsh", shell=True)
utils_misc.cmd_status_output("kill -s SIGSEGV %s" % pid, shell=True)

0 comments on commit bcce29a

Please sign in to comment.