3221f4e91f
Currently, the makedumpfile option '--message-level' is set to 1 when dumping the vmcore, it only displays the progress indicator message, but there are no common message and error message, it is important to report some additional messages, especially for the error message, which is very useful for the debugging. In view of this, let's change the message level to 7 by default. Signed-off-by: Lianbo Jiang <lijiang@redhat.com> Acked-by: Kairui Song <kasong@redhat.com>
41 lines
900 B
Bash
Executable File
41 lines
900 B
Bash
Executable File
# Executed before VM starts
|
|
on_build() {
|
|
img_inst_pkg "sshpass"
|
|
img_add_qemu_cmd "-nic socket,connect=127.0.0.1:8010,mac=52:54:00:12:34:57"
|
|
}
|
|
|
|
on_test() {
|
|
local boot_count=$(get_test_boot_count)
|
|
local ssh_server=192.168.77.1
|
|
|
|
if [ "$boot_count" -eq 1 ]; then
|
|
cat << EOF > /etc/kdump.conf
|
|
ssh root@192.168.77.1
|
|
core_collector makedumpfile -l --message-level 7 -d 31 -F
|
|
EOF
|
|
|
|
ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa <<< y &>/dev/ttyS1
|
|
|
|
while ! ping -c 1 $ssh_server -W 1; do
|
|
sleep 1
|
|
done
|
|
|
|
while [ -z "$(cat /root/.ssh/known_hosts)" ]; do
|
|
ssh-keyscan -H 192.168.77.1 > /root/.ssh/known_hosts
|
|
done
|
|
|
|
sshpass -p fedora ssh-copy-id root@$ssh_server -f &>/dev/ttyS1
|
|
|
|
sshpass -p fedora kdumpctl propagate &>/dev/ttyS1
|
|
|
|
kdumpctl start || test_failed "Failed to start kdump"
|
|
|
|
sync
|
|
|
|
echo 1 > /proc/sys/kernel/sysrq
|
|
echo c > /proc/sysrq-trigger
|
|
else
|
|
shutdown -h 0
|
|
fi
|
|
}
|