ci: integration: Collect stack traces with coredumpctl

Some Red Hat-like distros have cores limited with a soft limit of 0
which means that neither a stack trace nor a core file will be
available. Since we want the stack trace we need to set the core limit
with systemd globally to unlimited/infinity.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Erik Skultety 2022-03-21 18:05:16 +01:00
parent e23353756e
commit 908cb26b5d

View File

@ -2,6 +2,8 @@
stage: integration_tests stage: integration_tests
before_script: before_script:
- mkdir "$SCRATCH_DIR" - mkdir "$SCRATCH_DIR"
- sudo sh -c "echo DefaultLimitCORE=infinity >> /etc/systemd/system.conf" # Explicitly allow storing cores globally
- sudo systemctl daemon-reexec # need to reexec systemd after changing config
- sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* - sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/*
- sudo pip3 install --prefix=/usr avocado-framework - sudo pip3 install --prefix=/usr avocado-framework
- source /etc/os-release # in order to query the vendor-provided variables - source /etc/os-release # in order to query the vendor-provided variables
@ -31,6 +33,7 @@
after_script: after_script:
- test "$CI_JOB_STATUS" = "success" && exit 0; - test "$CI_JOB_STATUS" = "success" && exit 0;
- test -e "$SCRATCH_DIR"/avocado && sudo mv "$SCRATCH_DIR"/avocado/latest/test-results logs/avocado; - test -e "$SCRATCH_DIR"/avocado && sudo mv "$SCRATCH_DIR"/avocado/latest/test-results logs/avocado;
- sudo coredumpctl info --no-pager > logs/coredumpctl.txt
- sudo mv /var/log/libvirt logs/libvirt - sudo mv /var/log/libvirt logs/libvirt
- sudo chown -R $(whoami):$(whoami) logs - sudo chown -R $(whoami):$(whoami) logs
variables: variables: