File: check_httpsmsc_kannel.sh

package info (click to toggle)
kannel 1.4.5-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,284 kB
  • sloc: ansic: 105,659; sh: 32,211; xml: 20,360; php: 1,103; perl: 711; makefile: 583; yacc: 548; awk: 133; python: 122; javascript: 27; pascal: 3
file content (49 lines) | stat: -rwxr-xr-x 1,076 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# Use `test/fakesmsc' to test the bearerbox and the smsbox.

set -e
#set -x

times=10
interval=0
loglevel=0
host=127.0.0.1

gw/bearerbox -v $loglevel gw/smskannel.conf > check_httpsmsc_kannel_sbb.log 2>&1 &
sbbpid=$!
sleep 1

gw/bearerbox -v $loglevel gw/other_smskannel.conf > check_httpsmsc_kannel_cbb.log 2>&1 &
cbbpid=$!
sleep 2

test/fakesmsc -H $host -i $interval -m $times '123 234 text relay nop' \
    > check_httpsmsc_kannel_fake.log 2>&1 &
sleep 1

gw/smsbox -v $loglevel gw/smskannel.conf > check_httpsmsc_kannel_ssb.log 2>&1 &
gw/smsbox -v $loglevel gw/other_smskannel.conf > check_httpsmsc_kannel_csb.log 2>&1 &

running="yes"
while [ $running = "yes" ]
do
    sleep 1
    if grep -v "fakesmsc: terminating" check_httpsmsc_kannel_fake.log >/dev/null
    then
    	running="no"
    fi
done

kill -INT $sbbpid
kill -INT $cbbpid
wait

if grep 'WARNING:|ERROR:|PANIC:' check_httpsmsc_kannel_*.log >/dev/null
then
	echo check_httpsmsc_kannel.sh failed 1>&2
	echo See check_httpsmsc_kannel_*.log for info 1>&2
	exit 1
fi

rm -f check_httpsmsc_kannel_*.log