~louis/crashdc/trunk

« back to all changes in this revision

Viewing changes to run_test_sles11_i386

  • Committer: louis_bouchard
  • Date: 2011-01-17 14:54:55 UTC
  • Revision ID: svn-v4:43a7f545-b209-0410-ba44-c04536a9f2ae:trunk:202
run tests for this version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
typeset -i error=0
 
4
typeset host=crashdcSLES11
 
5
 
 
6
wait_for_server()
 
7
{
 
8
host=$1
 
9
 
 
10
typeset -i nologin=1
 
11
typeset -i nonetwork=1
 
12
 
 
13
        echo -n "### $(date) Waiting for $host VM to settle"
 
14
while (( nologin )) || (( nonetwork ));do
 
15
        echo -n "."
 
16
 
 
17
        ping -q -c 1 -t 5 ${host} > /dev/null
 
18
 
 
19
        error=$?
 
20
 
 
21
        if (( error ));then
 
22
                nonetwork=1
 
23
                nologin=1
 
24
        else
 
25
                if (( nonetwork ));then
 
26
                        echo
 
27
                        echo -n "### $(date) $host VM is there and network is started"
 
28
                fi
 
29
                nonetwork=0
 
30
                ssh -o ConnectTimeout=5 root@${host} uname -a > /dev/null 2>&1
 
31
                error=$?
 
32
                if ! (( error ));then
 
33
                        nologin=0
 
34
                        echo 
 
35
                        echo "### $(date) $host VM is there and login is enabled"
 
36
                else
 
37
                        sleep 5
 
38
                fi
 
39
        fi
 
40
done
 
41
}
 
42
 
 
43
cleanup_last_vmcore()
 
44
{
 
45
        ssh root@${host} "rm -f \'ls -rtd /var/crash/*/vmcore | head -1\'"
 
46
}
 
47
 
 
48
test_service()
 
49
{
 
50
        echo "### $(date) Testing crashdc init script"
 
51
        ssh root@${host} "service crashdc status"
 
52
        ssh root@${host} "service crashdc generate"
 
53
        sleep 45
 
54
        ssh root@${host} "service crashdc generate advanced"
 
55
        sleep 45
 
56
        ssh root@${host} "service crashdc generate custom /tmp/toto"
 
57
}
 
58
echo "### $(date) Starting SLES11 VM"
 
59
 
 
60
vmrun -T ws start /work/VM/${host}/${host}.vmx
 
61
 
 
62
wait_for_server ${host}
 
63
 
 
64
echo "### $(date) Preparing VM for tests"
 
65
scp prepare_test_sles11 root@${host}:
 
66
ssh root@${host} /root/prepare_test_sles11
 
67
ssh root@${host} sync
 
68
sleep 5
 
69
ssh root@${host} sync
 
70
 
 
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
 
74
#
 
75
#wait_for_server ${host}
 
76
#
 
77
#test_service
 
78
#
 
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
 
83
#
 
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
 
88
 
 
89
#wait_for_server ${host}
 
90
 
 
91
#test_service
 
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
 
96
 
 
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
 
101
 
 
102
#wait_for_server ${host}
 
103
 
 
104
#test_service
 
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
 
109
 
 
110
wait_for_server ${host}
 
111
 
 
112
#cleanup_last_vmcore
 
113
 
 
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
 
117
 
 
118
wait_for_server ${host}
 
119
 
 
120
test_service
 
121
echo "### $(date) Finished running all tests"
 
122
echo 
 
123
echo "### $(date) Tests Results are :"
 
124
ssh root@${host} "grep -e KERNEL: -e DUMPFILE -e \"mode in use\" /var/crash/2*/*txt"
 
125
exit 0