From 5d923edacd8dc25cf128abd7a6575c21baba492b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 22 Mar 2022 15:22:15 -0400 Subject: [PATCH] TT#14008 tests for 89f5a988 Change-Id: I8313b0b824fd95e3288f05a75239e4710bc377a4 --- t/auto-daemon-tests.pl | 200 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index ea498eef4..59de39238 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -40,6 +40,30 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp, +sub stun_req { + my ($controlling, $pref, $comp, $my_ufrag, $other_ufrag, $other_pwd) = @_; + + my $tid = NGCP::Rtpclient::ICE::random_string(12); + + my @attrs; + unshift(@attrs, NGCP::Rtpclient::ICE::attr(0x8022, 'perltester')); + + unshift(@attrs, NGCP::Rtpclient::ICE::attr($controlling ? 0x802a : 0x8029, NGCP::Rtpclient::ICE::random_string(8))); + + unshift(@attrs, NGCP::Rtpclient::ICE::attr(0x0024, pack('N', NGCP::Rtpclient::ICE::calc_priority('prflx', + $pref, $comp)))); + unshift(@attrs, NGCP::Rtpclient::ICE::attr(0x0006, "$other_ufrag:$my_ufrag")); + # nominate + + NGCP::Rtpclient::ICE::integrity(\@attrs, 1, $tid, $other_pwd); + NGCP::Rtpclient::ICE::fingerprint(\@attrs, 1, $tid); + + my $packet = join('', @attrs); + $packet = pack('nnNa12', 1, length($packet), 0x2112A442, $tid) . $packet; + + return ($packet, $tid); +} + sub stun_succ { my ($port, $tid, $my_pwd) = @_; my $sw = NGCP::Rtpclient::ICE::attr(0x8022, 'perltester'); @@ -54,6 +78,182 @@ sub stun_succ { }; +($sock_a, $sock_b, $sock_c, $sock_d) = new_call([qw(198.51.100.4 2412)], [qw(198.51.100.4 2413)], [qw(198.51.100.8 3412)], [qw(198.51.100.8 3413)]); + +offer('ICE with just peer reflexive', + { ICE => 'remove' }, < 'force' }, <