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