~ubuntu-branches/debian/sid/sflphone/sid

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-02 18:04:11 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130602180411-3rcpy8c1zdlo8y0s
Tags: 1.2.2-1
* New upstream release
* changeset_rb68857a4b485b7d43f92714cd5792595ff895f82.diff - fix QTest
* pjproject ./configure --disable-sound --disable-video

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: 234_reg_bad_stale_ok.py 2392 2008-12-22 18:54:58Z bennylp $
2
 
import inc_sip as sip
3
 
import inc_sdp as sdp
4
 
 
5
 
# In this test we simulate broken server, where it wants to
6
 
# change the nonce, but it fails to set stale to true. In this
7
 
# case, we should expect pjsip to retry the authentication until
8
 
# PJSIP_MAX_STALE_COUNT is exceeded as it should have detected
9
 
# that that nonce has changed
10
 
 
11
 
 
12
 
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
13
 
        "--realm=python --user=username --password=password " + \
14
 
        "--auto-update-nat=0"
15
 
 
16
 
req1 = sip.RecvfromTransaction("Initial request", 401,
17
 
                                include=["REGISTER sip"], 
18
 
                                exclude=["Authorization"],
19
 
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""]
20
 
                                )
21
 
 
22
 
req2 = sip.RecvfromTransaction("First retry", 401,
23
 
                                include=["REGISTER sip", "Authorization", "nonce=\"1\""], 
24
 
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
25
 
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"2\""]
26
 
                                )
27
 
 
28
 
req3 = sip.RecvfromTransaction("Second retry retry", 401,
29
 
                                include=["REGISTER sip", "Authorization", "nonce=\"2\""], 
30
 
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
31
 
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"3\""]
32
 
                                )
33
 
 
34
 
req4 = sip.RecvfromTransaction("Third retry", 200,
35
 
                                include=["REGISTER sip", "Authorization", "nonce=\"3\""], 
36
 
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
37
 
                                expect="registration success"
38
 
                                )
39
 
 
40
 
recvfrom_cfg = sip.RecvfromCfg("Successful auth server changes nonce but with stale=false",
41
 
                               pjsua, [req1, req2, req3, req4])