diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-04-29 00:23:43 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-04-29 00:23:43 +0000 |
commit | d9303b2308e9032082fc1126c9b0255bb9fcf4b2 (patch) | |
tree | 252bba5b25eb9e8d19b54428ba58aff36d127f4d /tests | |
parent | 85aeddc9c04b1c822b61e01527d4dea6f7fdf0c9 (diff) |
Refs #1061: added unit test to test handling of empty realm in 401/407 challenge
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3150 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py b/tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py new file mode 100644 index 00000000..edfd40f3 --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py @@ -0,0 +1,31 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ + "--realm=* --user=username --password=password " + \ + "--auto-update-nat=0" + +# 401 Response, missing realm value +req1 = sip.RecvfromTransaction("Initial request", 401, + include=["REGISTER sip"], + exclude=[], + resp_hdr=['WWW-Authenticate: Digest'] + ) + +# Client should retry, we giving it another 401 with empty realm +req2 = sip.RecvfromTransaction("REGISTER retry #1 of 2", 407, + include=["REGISTER sip"], + exclude=[], + resp_hdr=['Proxy-Authenticate: Digest realm=""'] + ) + +# Client should retry +req3 = sip.RecvfromTransaction("REGISTER retry #2 of 2", 200, + include=[], + exclude=[], + expect="registration success" + ) + +recvfrom_cfg = sip.RecvfromCfg("Registration with empty realm", + pjsua, [req1, req2, req3]) |