TT#155900 add tests to make sure no packet was received

Change-Id: Idf9dbd8e12efd3ff22e34de7c875a730c2189c6d
pull/1439/head
Richard Fuchs 4 years ago
parent 2a584261e7
commit ee5d01b0f8

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

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

Loading…
Cancel
Save