diff --git a/perl/NGCP/Rtpengine/AutoTest.pm b/perl/NGCP/Rtpengine/AutoTest.pm index 3bafd2f87..ce3551d63 100644 --- a/perl/NGCP/Rtpengine/AutoTest.pm +++ b/perl/NGCP/Rtpengine/AutoTest.pm @@ -19,7 +19,7 @@ our @EXPORT; BEGIN { require Exporter; @ISA = qw(Exporter); - our @EXPORT = qw(autotest_start new_call offer answer ft tt snd srtp_snd rtp rcv srtp_rcv + our @EXPORT = qw(autotest_start new_call offer answer ft tt snd srtp_snd rtp rcv srtp_rcv rcv_no srtp_dec escape rtpm rtpmre reverse_tags new_ft new_tt crlf sdp_split rtpe_req offer_answer autotest_init subscribe_request subscribe_answer publish use_json); }; @@ -227,6 +227,13 @@ sub rcv { } return @matches; } +sub rcv_no { + my ($sock) = @_; + Time::HiRes::sleep(0.1); + my $p = ''; + my $addr = $sock->recv($p, 65535, &MSG_DONTWAIT); + ok(! defined $addr, "no packet received"); +} sub srtp_rcv { my ($sock, $port, $match, $srtp_ctx) = @_; return rcv($sock, $port, $match, \&srtp_dec, $srtp_ctx); diff --git a/t/auto-daemon-tests-pubsub.pl b/t/auto-daemon-tests-pubsub.pl index ea66e8fcc..90ed487d4 100755 --- a/t/auto-daemon-tests-pubsub.pl +++ b/t/auto-daemon-tests-pubsub.pl @@ -333,9 +333,17 @@ SDP snd($sock_a, $port_b, rtp(0, 4001, 7160, 0x6543, "\x00" x 160)); rcv($sock_b, $port_a, rtpm(0, 4001, 7160, 0x6543, "\x00" x 160)); rcv($sock_c, $port_c, rtpm(8, 4001, 7160, -1, "\x2a" x 160)); +rcv_no($sock_a); +rcv_no($sock_d); snd($sock_b, $port_a, rtp(0, 2001, 4160, 0x3456, "\x00" x 160)); rcv($sock_a, $port_b, rtpm(0, 2001, 4160, 0x3456, "\x00" x 160)); rcv($sock_d, $port_d, rtpm(8, 2001, 4160, -1, "\x2a" x 160)); +rcv_no($sock_b); +rcv_no($sock_c); +snd($sock_c, $port_c, rtp(0, 8001, 9160, 0x9876, "\x00" x 160)); +rcv_no($sock_a); +rcv_no($sock_b); +rcv_no($sock_c);