Skip to content

Commit

Permalink
apps/dial/preserve_top: simplify SIPP scenarios to fix flakiness
Browse files Browse the repository at this point in the history
The SIPP scenarios contained stream directions with initial answers
containing audio=inactive for example which are known to trigger
re-INVITEs in Asterisk. The timing of those re-INVITEs is hard to
predict which can make the SIPP scenarios and tests flaky.

Resolves: asterisk#60
  • Loading branch information
maximilianfridrich committed Aug 5, 2024
1 parent 700eeb9 commit 8914e24
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 110 deletions.
63 changes: 45 additions & 18 deletions tests/apps/dial/preserve_top/sipp/alice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,19 @@
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 9 0 8
m=audio [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=sendrecv
m=video 6000 RTP/AVP 99 34
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=rtpmap:34 H263/90000
a=sendrecv
]]>
</send>

<recv response="100" optional="true" />
<recv response="180" />

<recv response="183" rtd="true">
</recv>
<recv response="183" optional="true" />

<recv response="200" rtd="true">
<!-- Save the To tag. -->
Expand Down Expand Up @@ -67,23 +62,24 @@
]]>
</send>

<recv request="INVITE" crlf="true" />
<pause milliseconds="100" />

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
[last_Via:]2
From: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
CSeq: [cseq] INVITE
Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
o=- 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
Expand All @@ -92,12 +88,43 @@
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=sendonly
a=recvonly
]]>
</send>

<recv request="ACK" crlf="true" />
<recv response="200">
<action>
<ereg regexp="a=sendrecv"
search_in="body" check_it="true" assign_to="1"/>
<test assign_to="1" variable="1" compare="equal" value=""/>
<ereg regexp="a=inactive"
search_in="body" check_it_inverse="true" assign_to="2"/>
<test assign_to="2" variable="2" compare="equal" value=""/>
<ereg regexp="a=sendonly"
search_in="body" check_it="true" assign_to="3"/>
<test assign_to="3" variable="3" compare="equal" value=""/>
<ereg regexp="a=recvonly"
search_in="body" check_it_inverse="true" assign_to="4"/>
<test assign_to="4" variable="4" compare="equal" value=""/>
</action>
</recv>

<send>
<![CDATA[
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
[last_Via:]
[last_From:]
[last_To:]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 70
Content-Length: 0
]]>
</send>

<pause milliseconds="2000" />

Expand Down
51 changes: 27 additions & 24 deletions tests/apps/dial/preserve_top/sipp/bob.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<send>
<![CDATA[
SIP/2.0 183 Progress
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
Expand All @@ -49,18 +49,36 @@
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=inactive
a=rtpmap:0 PCMU/8000
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
a=sendrecv
]]>
</send>

<pause milliseconds="200" />
<recv request="ACK"
rtd="true"
crlf="true">
<action>
<ereg regexp="(.*)"
header="To:"
search_in="hdr"
check_it="true"
assign_to="to_h"/>
<ereg regexp="(.*)"
header="From:"
search_in="hdr"
check_it="true"
assign_to="from_h"/>
</action>
</recv>

<send>

<recv request="INVITE" crlf="true" />

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
Expand All @@ -79,31 +97,16 @@
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=inactive
a=rtpmap:0 PCMU/8000
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
a=sendonly
]]>
]]>
</send>

<recv request="ACK"
rtd="true"
crlf="true">
<action>
<ereg regexp="(.*)"
header="To:"
search_in="hdr"
check_it="true"
assign_to="to_h"/>
<ereg regexp="(.*)"
header="From:"
search_in="hdr"
check_it="true"
assign_to="from_h"/>
</action>
</recv>
<recv request="ACK" crlf="true" />

<pause milliseconds="500" />

Expand Down
36 changes: 3 additions & 33 deletions tests/apps/dial/preserve_top/sipp/carol.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,7 @@
]]>
</send>

<pause milliseconds="100" />

<send>
<![CDATA[
SIP/2.0 183 Progress
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=inactive
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
]]>
</send>

<pause milliseconds="100" />
<pause milliseconds="200" />

<send retrans="500">
<![CDATA[
Expand All @@ -87,10 +57,10 @@
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=inactive
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
a=sendonly
]]>
</send>
Expand Down
38 changes: 4 additions & 34 deletions tests/apps/dial/preserve_top/sipp/carol2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
search_in="body" check_it_inverse="true" assign_to="2"/>
<test assign_to="2" variable="2" compare="equal" value=""/>
<ereg regexp="a=sendonly"
search_in="body" check_it="true" assign_to="3"/>
search_in="body" check_it_inverse="true" assign_to="3"/>
<test assign_to="3" variable="3" compare="equal" value=""/>
<ereg regexp="a=recvonly"
search_in="body" check_it_inverse="true" assign_to="4"/>
search_in="body" check_it="true" assign_to="4"/>
<test assign_to="4" variable="4" compare="equal" value=""/>
</action>
</recv>
Expand All @@ -37,36 +37,6 @@

<pause milliseconds="200" />

<send>
<![CDATA[
SIP/2.0 183 Progress
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=inactive
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
]]>
</send>

<pause milliseconds="200" />

<send retrans="500">
<![CDATA[
Expand All @@ -87,10 +57,10 @@
t=0 0
m=audio [custom_media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=inactive
a=sendrecv
m=video 6000 RTP/AVP 99
a=rtpmap:99 H264/90000
a=recvonly
a=sendonly
]]>
</send>
Expand Down
2 changes: 1 addition & 1 deletion tests/apps/dial/preserve_top/test-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
testinfo:
summary: |
'Test the Dial option "j" which preserver the initial topology of the caller.'
'Test the Dial option "j" which preserves the initial topology of the caller.'
description: |
'Alice calls Bob whose 200 SDP answer contains an audio stream and a
video stream which is set to recvonly. Bob hangs up and then the Dial
Expand Down

0 comments on commit 8914e24

Please sign in to comment.