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)]);