4
typeset host=crashdcSLES11
11
typeset -i nonetwork=1
13
echo -n "### $(date) Waiting for $host VM to settle"
14
while (( nologin )) || (( nonetwork ));do
17
ping -q -c 1 -t 5 ${host} > /dev/null
25
if (( nonetwork ));then
27
echo -n "### $(date) $host VM is there and network is started"
30
ssh -o ConnectTimeout=5 root@${host} uname -a > /dev/null 2>&1
35
echo "### $(date) $host VM is there and login is enabled"
45
ssh root@${host} "rm -f \'ls -rtd /var/crash/*/vmcore | head -1\'"
50
echo "### $(date) Testing crashdc init script"
51
ssh root@${host} "service crashdc status"
52
ssh root@${host} "service crashdc generate"
54
ssh root@${host} "service crashdc generate advanced"
56
ssh root@${host} "service crashdc generate custom /tmp/toto"
58
echo "### $(date) Starting SLES11 VM"
60
vmrun -T ws start /work/VM/${host}/${host}.vmx
62
wait_for_server ${host}
64
echo "### $(date) Preparing VM for tests"
65
scp prepare_test_sles11 root@${host}:
66
ssh root@${host} /root/prepare_test_sles11
71
#echo "### $(date) Run ${host} test #1 : XEN kernel"
72
#nohup ssh root@${host} "echo c > /proc/sysrq-trigger" > /dev/null 2>&1 &
73
#sleep 10 #Otherwise the other end is still alive
75
#wait_for_server ${host}
79
#echo "### $(date) Preparing to reboot to VMI kernel"
80
#ssh root@${host} "mv /boot/grub/menu.lst /boot/grub/menu.lst.vmi;sed 's/^default 3/default 2/' /boot/grub/menu.lst.vmi > /boot/grub/menu.lst"
81
#ssh root@${host} "reboot"
82
#sleep 10 #Otherwise the other end is still alive
84
#wait_for_server ${host}
85
#echo "### $(date) Run ${host} test #2 : VMI kernel"
86
#nohup ssh root@${host} "echo c > /proc/sysrq-trigger" > /dev/null 2>&1 &
87
#sleep 10 #Otherwise the other end is still alive
89
#wait_for_server ${host}
92
echo "### $(date) Preparing to reboot to PAE kernel"
93
ssh root@${host} "mv /boot/grub/menu.lst /boot/grub/menu.lst.pae;sed 's/^default 2/default 1/' /boot/grub/menu.lst.pae > /boot/grub/menu.lst"
94
#ssh root@${host} "reboot"
95
#sleep 10 #Otherwise the other end is still alive
97
#wait_for_server ${host}
98
#echo "### $(date) Run ${host} test #3 : PAE kernel"
99
#nohup ssh root@${host} "echo c > /proc/sysrq-trigger" > /dev/null 2>&1 &
100
#sleep 10 #Otherwise the other end is still alive
102
#wait_for_server ${host}
105
echo "### $(date) Preparing to reboot to DEFAULT kernel"
106
ssh root@${host} "mv /boot/grub/menu.lst /boot/grub/menu.lst.default;sed 's/^default 1/default 0/' /boot/grub/menu.lst.default > /boot/grub/menu.lst"
107
ssh root@${host} "reboot"
108
sleep 10 #Otherwise the other end is still alive
110
wait_for_server ${host}
114
echo "### $(date) Run ${host} test #4 : DEFAULT kernel"
115
nohup ssh root@${host} "echo c > /proc/sysrq-trigger" > /dev/null 2>&1 &
116
sleep 10 #Otherwise the other end is still alive
118
wait_for_server ${host}
121
echo "### $(date) Finished running all tests"
123
echo "### $(date) Tests Results are :"
124
ssh root@${host} "grep -e KERNEL: -e DUMPFILE -e \"mode in use\" /var/crash/2*/*txt"