Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdump-ignition test added to verify kdump works via ignition config #1448

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/kola/kdump/kdump-ignition/config.bu
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variant: fcos
version: 1.4.0
kernel_arguments:
should_exist:
- 'crashkernel=256M'
systemd:
units:
- enabled: true
name: kdump.service

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing new lines at EOF (both files). You should probably configure your editor to add them automatically.

37 changes: 37 additions & 0 deletions tests/kola/kdump/kdump-ignition/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -xeuo pipefail

fatal() {
echo "$@" >&2
exit 1
}

case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
# check kdump service
# TODO
/tmp/autopkgtest-reboot-prepare aftercrash
# trigger kdump
echo "Triggering sysrq"
sync
echo 1 > /proc/sys/kernel/sysrq
# This one will trigger kdump, which will write the kernel core, then reboot.
echo c > /proc/sysrq-trigger
# We shouldn't reach this point
sleep 5
fatal "failed to invoke sysrq"
;;

aftercrash)
kcore=$(find /var/crash -type f -name vmcore)
if test -z "${kcore}"; then
fatal "No kcore found in /var/crash"
fi
info=$(file "${kcore}")
if ! [[ "${info}" =~ 'vmcore: Kdump'.*'system Linux' ]]; then
fatal "vmcore does not appear to be a Kdump?"
fi
;;
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";;
esac