kexec-tools/tests/scripts/testcases/local-kdump/0-local.sh
Petr Šabata f5bf4978d8 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/kexec-tools#041ba89902961b5490a7143d9596dc00d732cba0
2020-10-15 14:45:57 +02:00

33 lines
525 B
Bash
Executable File

on_build() {
:
}
on_test() {
local boot_count=$(get_test_boot_count)
if [ $boot_count -eq 1 ]; then
cat << EOF > /etc/kdump.conf
path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31
EOF
kdumpctl start || test_failed "Failed to start kdump"
sync
echo 1 > /proc/sys/kernel/sysrq
echo c > /proc/sysrq-trigger
elif [ $boot_count -eq 2 ]; then
if has_valid_vmcore_dir /var/crash; then
test_passed
else
test_failed
fi
shutdown -h 0
else
test_failed "Unexpected reboot"
fi
}