blob: dc4a4db2f020f1e0144a6a25041b5811a427bae5 [file] [log] [blame]
Benny Prijono945aeb22008-12-22 18:54:58 +00001# $Id$
Benny Prijonoe9a82242008-07-07 20:14:41 +00002import inc_sip as sip
3import inc_sdp as sdp
4
5# Authentication failure test with same nonce
6
7
8pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
9 "--realm=python --user=username --password=password"
10
11req1 = sip.RecvfromTransaction("Initial request", 401,
12 include=["REGISTER sip"],
13 exclude=["Authorization"],
14 resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""]
15 )
16
17req2 = sip.RecvfromTransaction("REGISTER retry", 401,
18 include=["REGISTER sip", "Authorization", "nonce=\"1\""],
19 exclude=["Authorization:[\\s\\S]+Authorization:"],
20 resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""],
21 expect="PJSIP_EFAILEDCREDENTIAL"
22 )
23
24
25recvfrom_cfg = sip.RecvfromCfg("Authentication failure with same nonce",
26 pjsua, [req1, req2])