~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to tools/sippxml/testsuiteuac.sh

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
 
4
 
LOCALPORT=5062
5
 
LOCALIP_lo=127.0.0.1
6
 
LOCALIP_eth0=192.168.50.182
7
 
 
8
 
REMOTEADDR_lo=127.0.0.1:5060
9
 
REMOTEADDR_ast=192.168.50.79
10
 
 
11
 
# SCENARIO 1 Test 1
12
 
function test_ip2ip_send_hangup {
13
 
 
14
 
    # start sflphoned
15
 
    # /usr/lib/sflphone/sflphoned&
16
 
 
17
 
    # start sipp server to receive calls from sflphone
18
 
    sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT}
19
 
 
20
 
    # wait some time to make sure sflphoned is started
21
 
    # sleep 1;
22
 
 
23
 
    # run python client and script to make calls
24
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
25
 
 
26
 
    # kill every one
27
 
    # bashtrap
28
 
}
29
 
 
30
 
# SCENARIO 1 Test 2
31
 
function test_ip2ip_send_peer_hungup {
32
 
 
33
 
    # start sflphoned
34
 
    # /usr/lib/sflphone/sflphoned&
35
 
 
36
 
    # start sipp server to receive calls from sflphone and then hangup
37
 
    sipp -sf ip2ip_uas_recv_hangup.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT}
38
 
 
39
 
    # wait some time to make sure sflphoned is started
40
 
    # sleep 1;
41
 
 
42
 
    # run python client and script to make calls
43
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
44
 
 
45
 
    # kill every one
46
 
    bashtrap
47
 
}
48
 
 
49
 
 
50
 
# SCENARIO 1 Test 3
51
 
function test_ip2ip_recv_hangup {
52
 
 
53
 
    # start sflphoned
54
 
    # /usr/lib/sflphone/sflphoned&
55
 
 
56
 
    # wait some time to make sure sflphoned is started
57
 
    # sleep 1;
58
 
 
59
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
60
 
 
61
 
    # wait some time to make sure client is bound
62
 
    # sleep 1;
63
 
 
64
 
    # start sipp client and send calls
65
 
    sipp -sf ip2ip_uac_send_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10
66
 
 
67
 
    # kill every one
68
 
    # bashtrap
69
 
}
70
 
 
71
 
 
72
 
# SCENARIO 1 Test 4
73
 
function test_ip2ip_recv_peer_hungup {
74
 
 
75
 
    # start sflphoned
76
 
    # /usr/lib/sflphone/sflphoned&
77
 
 
78
 
    # wait some time to make sure sflphoned is started
79
 
    # sleep 1;
80
 
 
81
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
82
 
 
83
 
    # wait some time to make sure client is bound
84
 
    # sleep 1;
85
 
 
86
 
    # start sipp client and send calls
87
 
    sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10
88
 
 
89
 
    # kill every one
90
 
    # bashtrap
91
 
}
92
 
 
93
 
 
94
 
# SCENARIO 2 Test 1
95
 
function test_account_send_hangup {
96
 
 
97
 
    # start sflphoned
98
 
    # /usr/lib/sflphone/sflphoned&
99
 
 
100
 
    # wait some time to make sure sflphoned is started
101
 
    # sleep 1;
102
 
 
103
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
104
 
 
105
 
    # wait some time to make sure client is bound
106
 
    # sleep 1;
107
 
 
108
 
    # process only one registration
109
 
    sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1
110
 
 
111
 
    # start sipp client and send calls
112
 
    sipp -sf account_uas_recv_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1
113
 
 
114
 
    # kill every one
115
 
    # bashtrap
116
 
}
117
 
 
118
 
# SCENARIO 2 Test 2
119
 
function test_account_send_peer_hungup {
120
 
 
121
 
    # start sflphoned
122
 
    # /usr/lib/sflphone/sflphoned&
123
 
 
124
 
    # wait some time to make sure sflphoned is started
125
 
    # sleep 1;
126
 
 
127
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
128
 
 
129
 
    # wait some time to make sure client is bound
130
 
    # sleep 1;
131
 
 
132
 
    # process only one registration
133
 
    sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1
134
 
 
135
 
    # start sipp client and send calls
136
 
    sipp -sf account_uas_recv_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1
137
 
 
138
 
    # kill every one
139
 
    # bashtrap
140
 
}
141
 
 
142
 
# SCENARIO 2 Test 3
143
 
function test_account_recv_hangup {
144
 
 
145
 
    # start sflphoned
146
 
    # /usr/lib/sflphone/sflphoned&
147
 
 
148
 
    # wait some time to make sure sflphoned is started
149
 
    # sleep 1;
150
 
 
151
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
152
 
 
153
 
    # wait some time to make sure client is bound
154
 
    # sleep 1;
155
 
 
156
 
    # process only one registration
157
 
    sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1
158
 
 
159
 
    # start sipp client and send calls
160
 
    sipp -sf account_uac_send_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10
161
 
    # kill every one
162
 
    # bashtrap
163
 
}
164
 
 
165
 
# SCENARIO 2 Test 4
166
 
function test_account_recv_peer_hungup {
167
 
 
168
 
    # start sflphoned
169
 
    # /usr/lib/sflphone/sflphoned&
170
 
 
171
 
    # wait some time to make sure sflphoned is started
172
 
    # sleep 1;
173
 
 
174
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
175
 
 
176
 
    # wait some time to make sure client is bound
177
 
    # sleep 1;
178
 
 
179
 
    # process only one registration
180
 
    sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1
181
 
 
182
 
    # start sipp client and send calls
183
 
    sipp -sf account_uac_send_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10
184
 
 
185
 
    # kill every one
186
 
    # bashtrap
187
 
}
188
 
 
189
 
# SCENARIO 3 Test 1
190
 
function test_ip2ip_send_hold_offhold {
191
 
 
192
 
    # start sflphoned
193
 
    # /usr/lib/sflphone/sflphoned&
194
 
 
195
 
    # wait some time to make sure sflphoned is started
196
 
    # sleep 1;
197
 
 
198
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
199
 
 
200
 
    # wait some time to make sure client is bound
201
 
    # sleep 1;
202
 
 
203
 
    # start sipp client and send calls
204
 
    sipp -sf ip2ip_uas_recv_hold_offhold.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT}
205
 
    # kill every one
206
 
    # bashtrap
207
 
}
208
 
 
209
 
# SCENARIO 4 Test 1
210
 
function test_account_send_transfer {
211
 
 
212
 
    # start sflphoned
213
 
    # /usr/lib/sflphone/sflphoned&
214
 
 
215
 
    # wait some time to make sure sflphoned is started
216
 
    # sleep 1;
217
 
 
218
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
219
 
 
220
 
    # wait some time to make sure client is bound
221
 
    # sleep 1;
222
 
 
223
 
    # process only one registration
224
 
    sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1
225
 
 
226
 
    # start sipp client and send calls
227
 
    sipp -sf account_uas_recv_transfered.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1
228
 
 
229
 
    # kill every one
230
 
    # bashtrap
231
 
}
232
 
 
233
 
 
234
 
# SCENARIO 5 Test 1
235
 
function test_ip2ip_send_refused {
236
 
 
237
 
    # start sflphoned
238
 
    # /usr/lib/sflphone/sflphoned&
239
 
 
240
 
    # start sipp server to receive calls from sflphone and then hangup
241
 
    sipp -sf ip2ip_uac_send_refused.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1
242
 
 
243
 
    # wait some time to make sure sflphoned is started
244
 
    # sleep 1;
245
 
 
246
 
    # run python client and script to make calls
247
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
248
 
 
249
 
    # kill every one
250
 
    bashtrap
251
 
}
252
 
 
253
 
 
254
 
# SCENARIO 6 Test 1
255
 
function test_mult_ip2ip_send_hangup {
256
 
 
257
 
    # start sflphoned
258
 
    # /usr/lib/sflphone/sflphoned&
259
 
 
260
 
    # start sipp server to receive calls from sflphone
261
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5062 -l 1 -m 10
262
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5064 -l 1 -m 10
263
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5066 -l 1 -m 10
264
 
    # sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10
265
 
 
266
 
    # wait some time to make sure sflphoned is started
267
 
    # sleep 1;
268
 
 
269
 
    # run python client and script to make calls
270
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
271
 
 
272
 
    # kill every one
273
 
    # bashtrap
274
 
}
275
 
 
276
 
 
277
 
# SCENARIO 6 Test 2
278
 
function test_mult_ip2ip_recv_peer_hangup {
279
 
 
280
 
    # start sflphoned
281
 
    # /usr/lib/sflphone/sflphoned&
282
 
 
283
 
    # start sipp server to receive calls from sflphone
284
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5062
285
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5064
286
 
    sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5066
287
 
    # sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT}
288
 
 
289
 
    # wait some time to make sure sflphoned is started
290
 
    # sleep 1;
291
 
 
292
 
    # run python client and script to make calls
293
 
    # python ../tools/pysflphone/pysflphone_testdbus.py &
294
 
 
295
 
    # kill every one
296
 
    # bashtrap
297
 
}
298
 
 
299
 
 
300
 
# function called if CTRL-C detected
301
 
bashtrap()
302
 
{
303
 
    killall sipp
304
 
    killall sflphoned
305
 
}
306
 
 
307
 
 
308
 
# ============================ Test Suite ============================
309
 
 
310
 
 
311
 
 
312
 
# SCENARIO 1: (IP2IP) Normal flow calls
313
 
 
314
 
# Test 1: - Send an IP2IP call
315
 
#         - Hangup
316
 
test_ip2ip_send_hangup
317
 
 
318
 
# Test 2: - Send an IP2IP call
319
 
#         - Peer Hangup
320
 
# test_ip2ip_send_peer_hungup
321
 
 
322
 
# Test 3: - Receive an IP2IP call
323
 
#         - Hangup
324
 
# test_ip2ip_recv_hangup
325
 
 
326
 
# Test 4: - Receive an IP2IP call
327
 
#         - Peer Hangup
328
 
# test_ip2ip_recv_peer_hungup
329
 
 
330
 
 
331
 
 
332
 
# SCENARIO 2: (ACCOUNT) Normal flow calls
333
 
 
334
 
# Test 1: - Send an ACCOUNT call
335
 
#         - Hangup
336
 
# test_account_send_hangup
337
 
 
338
 
# Test 2: - Send an ACCOUNT call
339
 
#         - Peer Hangup
340
 
# test_account_send_peer_hungup
341
 
 
342
 
# Test 3: - Receive an ACCOUNT call
343
 
#         - Hangup
344
 
# test_account_recv_hangup
345
 
 
346
 
# Test 4: - Receive an ACCOUNT call
347
 
#         - Peer Hangup
348
 
# test_account_recv_peer_hungup
349
 
 
350
 
 
351
 
 
352
 
# SCENARIO 3: Hold/offHold calls (Account)
353
 
 
354
 
# Test 1: - Send an IP2IP call
355
 
#         - Put this call on HOLD
356
 
#         - Off HOLD this call
357
 
#         - Hangup
358
 
# test_ip2ip_send_hold_offhold
359
 
 
360
 
 
361
 
 
362
 
# SCENARIO 4: Transfer calls (Account)
363
 
 
364
 
# Test 1: - Send an IP2IP call
365
 
#         - Transfer this call to another sipp instance
366
 
#         - Hangup
367
 
# test_account_send_transfer
368
 
 
369
 
 
370
 
#SCENARIO 5: Refuse call (IP2IP)
371
 
 
372
 
# Test 1: - Receive a call
373
 
#         - Refuse (hangup without answer)
374
 
# test_ip2ip_send_refused
375
 
 
376
 
 
377
 
#SCENARIO 6: Multiple simultaneous Call
378
 
 
379
 
# Test 1: -
380
 
# test_mult_ip2ip_send_hangup
381
 
 
382
 
# Test 2: -
383
 
# test_mult_ip2ip_recv_peer_hangup
 
 
b'\\ No newline at end of file'