From 44a65dd8e8874c0c3c4edb76d8945dab6f747db2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 17 Aug 2026 10:11:29 -0400 Subject: [PATCH] MT#55283 tests for I0ded946, I49dcd93, I5423928 Change-Id: I6ab0c680740a34bc4828153090acc69167960b7e (cherry picked from commit 6388d49456ae26515a2f4ad31a0269ea49edc733) --- t/auto-daemon-tests-dtls.pl | 1522 ++++++++++++++++++++++++++++++++++- 1 file changed, 1521 insertions(+), 1 deletion(-) diff --git a/t/auto-daemon-tests-dtls.pl b/t/auto-daemon-tests-dtls.pl index cea99d7e4..0158c06ef 100644 --- a/t/auto-daemon-tests-dtls.pl +++ b/t/auto-daemon-tests-dtls.pl @@ -110,7 +110,1527 @@ rtpe_req('delete', 'delete'); -done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit; +($sock_a) = new_call([qw(198.51.100.35 3060)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change B', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change B', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.35 3056)], [qw(198.51.100.35 3058)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A/B', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_b]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A/B', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_b); +@components = ([$sock_b, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a, $sock_b) = new_call([qw(198.51.100.35 3052)], [qw(198.51.100.35 3054)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_b]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive port change A', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_b); +@components = ([$sock_b, $port_b]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + + +($sock_a) = new_call([qw(198.51.100.35 3050)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw force passive', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +offer('re-invite bkw force passive', { + 'rtcp-mux' => 'demux', + DTLS => 'passive', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw passive', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +offer('re-invite bkw passive', { + 'rtcp-mux' => 'demux', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +offer('re-invite bkw', { + 'transport-protocol' => 'RTP/AVP', + SDES => 'off', + 'rtcp-mux' => 'demux', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + +offer('re-invite bkw', { + 'rtcp-mux' => 'demux', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with B port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with B port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +answer('re-invite fwd with B port change', { }, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + +rtpe_req('delete', 'delete'); + + + +($sock_a) = new_call([qw(198.51.100.35 3040)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with role change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with role change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +answer('re-invite fwd with role change', { }, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + + +rtpe_req('delete', 'delete'); + + + +($sock_a) = new_call([qw(198.51.100.35 3038)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd passive', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->accept(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd passive', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a) = offer('re-invite fwd with A port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + + + +($port_b, $port_bx, undef, $tls_id_b) = offer('re-invite fwd with A port change', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', +}, <new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + + +answer('re-invite fwd with A port change', { }, <add($sock_a); +@components = ([$sock_a, $port_b]); +$dtls->connect(); +$mux->loop(); + + + + +rtpe_req('delete', 'delete'); + + + +($sock_a) = new_call([qw(198.51.100.35 3032)]); + +$mux = IO::Multiplex->new(); +$mux->set_callback_object(__PACKAGE__); +$dtls = NGCP::Rtpclient::DTLS::Group->new($mux, $dtls_func, [[$sock_a]]); +$fingerprint = $dtls->[0]->fingerprint(); + +($port_a, $port_ax, undef, $tls_id_a, $ufrag_a, $pwd_a, undef, $port_b) = offer('ICE + DTLS fwd early start', { + 'transport-protocol' => 'RTP/SAVP', + SDES => 'off', + 'rtcp-mux' => 'require', + ICE => 'force', +}, <add($sock_a); +@components = ([$sock_a, $port_a]); +$dtls->connect(); +$mux->loop(); + +rtpe_req('delete', 'delete'); + + + ($sock_a) = new_call([qw(198.51.100.35 3028)]);