~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: 230_reg_bad_fail_stale_true.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 always sends
 
6
# stale=true with all 401 responses. We should expect pjsip to
 
7
# retry the authentication until PJSIP_MAX_STALE_COUNT is
 
8
# exceeded. When pjsip retries the authentication, it should
 
9
# use the new nonce from server
 
10
 
 
11
 
 
12
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
 
13
        "--realm=python --user=username --password=password"
 
14
 
 
15
req1 = sip.RecvfromTransaction("Initial request", 401,
 
16
                                include=["REGISTER sip"], 
 
17
                                exclude=["Authorization"],
 
18
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""]
 
19
                                )
 
20
 
 
21
req2 = sip.RecvfromTransaction("First retry", 401,
 
22
                                include=["REGISTER sip", "Authorization", "nonce=\"1\""], 
 
23
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
 
24
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"2\", stale=true"]
 
25
                                )
 
26
 
 
27
req3 = sip.RecvfromTransaction("Second retry retry", 401,
 
28
                                include=["REGISTER sip", "Authorization", "nonce=\"2\""], 
 
29
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
 
30
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"3\", stale=true"]
 
31
                                )
 
32
 
 
33
req4 = sip.RecvfromTransaction("Third retry", 401,
 
34
                                include=["REGISTER sip", "Authorization", "nonce=\"3\""], 
 
35
                                exclude=["Authorization:[\\s\\S]+Authorization:"],
 
36
                                resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"4\", stale=true"],
 
37
                                expect="PJSIP_EAUTHSTALECOUNT"
 
38
                                )
 
39
 
 
40
recvfrom_cfg = sip.RecvfromCfg("Failed registration retry (server rejects with stale=true) ",
 
41
                               pjsua, [req1, req2, req3, req4])