From fd7a6b35b77474c5ffd527e2afb7ba87ed478091 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 11 Feb 2022 12:07:56 -0500 Subject: [PATCH] TT#14008 add test for ROC reset Change-Id: I172b4a6ef3a255afcfc48041ce2bc90601688b97 --- t/auto-daemon-tests.pl | 119 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index c131a87c9..2f89bebaf 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -40,6 +40,125 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, +($sock_a, $sock_b) = new_call([qw(198.51.100.1 4370)], [qw(198.51.100.3 4372)]); + +($port_a) = offer('ROC reset after re-invite', + { 'transport-protocol' => 'RTP/AVP' }, < 'off' }, < $NGCP::Rtpclient::SRTP::crypto_suites{AES_CM_128_HMAC_SHA1_80}, + key => $srtp_key_a, +}; + +# consume DTLS +rcv($sock_a, -1, qr/^\x16\xfe\xff\x00\x00\x00\x00\x00\x00\x00/); + +snd($sock_b, $port_a, rtp(0, 65534, 4000, 0x6543, "\x00" x 160)); +srtp_rcv($sock_a, $port_b, rtpm(0, 65534, 4000, -1, "\x00" x 160), $srtp_ctx_a); +is($srtp_ctx_a->{roc}, 0, "initial zero ROC"); +snd($sock_b, $port_a, rtp(0, 65535, 4160, 0x6543, "\x00" x 160)); +srtp_rcv($sock_a, $port_b, rtpm(0, 65535, 4160, -1, "\x00" x 160), $srtp_ctx_a); +is($srtp_ctx_a->{roc}, 0, "initial zero ROC"); +snd($sock_b, $port_a, rtp(0, 0, 4320, 0x6543, "\x00" x 160)); +srtp_rcv($sock_a, $port_b, rtpm(0, 0, 4320, -1, "\x00" x 160), $srtp_ctx_a); +is($srtp_ctx_a->{roc}, 1, "ROC increase"); + +($port_ax) = offer('ROC reset after re-invite', + { 'transport-protocol' => 'RTP/AVP' }, < 'off' }, <{roc}, 1, "ROC unchanged"); + + + new_call; offer('ICE restart',