UltraMonkey-L7 V3(multi-thread implementation)
修訂 | 1088c6365feea8bf7da63a28254549be7ffa275f (tree) |
---|---|
時間 | 2010-10-08 13:21:15 |
作者 | 0809216 <0809216@1ed6...> |
Commiter | 0809216 |
Add l7vsadm signal test
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10353 1ed66053-1c2d-0410-8867-f7571e6e31d3
@@ -0,0 +1,31 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | +. ${SET_DEFAULT_CONF} | |
4 | + | |
5 | +# temp log | |
6 | +tmp_log="/tmp/`uuidgen`.log" | |
7 | + | |
8 | +for sig in SIGHUP SIGINT SIGQUIT SIGUSR1 SIGUSR2 SIGPIPE SIGTERM; do | |
9 | + flock -n -x $L7VSADM $L7VSADM >> $tmp_log 2>&1 & | |
10 | + | |
11 | + # sleep a little | |
12 | + usleep 20000 | |
13 | + | |
14 | + # send signal | |
15 | + kill -$sig `pidof $L7VSADM` | |
16 | + | |
17 | + # wait for l7vsadm termination | |
18 | + while true; do | |
19 | + ps aux | grep $L7VSADM | grep -v grep > /dev/null 2>&1 || break | |
20 | + done | |
21 | +done | |
22 | + | |
23 | +diff_result=`diff $tmp_log ./materials/l7vsadm-12-1-1.log` | |
24 | +if [ $? -ne 0 ]; then | |
25 | + echo "Test failed: l7vsadm signal log was not matched." | |
26 | + echo "$diff_result" | |
27 | + exit 1 | |
28 | +fi | |
29 | + | |
30 | +exit 0 | |
31 | + |
@@ -0,0 +1,7 @@ | ||
1 | +COMMON ERROR: Signal (1) Received. | |
2 | +COMMON ERROR: Signal (2) Received. | |
3 | +COMMON ERROR: Signal (3) Received. | |
4 | +COMMON ERROR: Signal (10) Received. | |
5 | +COMMON ERROR: Signal (12) Received. | |
6 | +COMMON ERROR: Signal (13) Received. | |
7 | +COMMON ERROR: Signal (15) Received. |