Browse Source

TT#14008 add test for multi-intf handling

Change-Id: I9c1392ca521640d8e39eb6f67d146e70d44ee7d0
pull/1373/head
Richard Fuchs 4 years ago
parent
commit
77317a1723
2 changed files with 85 additions and 2 deletions
  1. +13
    -2
      t/Makefile
  2. +72
    -0
      t/auto-daemon-tests-intfs.pl

+ 13
- 2
t/Makefile View File

@ -87,7 +87,8 @@ COMMONOBJS= str.o auxlib.o rtplib.o loglib.o ssllib.o
include ../lib/common.Makefile
.PHONY: all-tests unit-tests daemon-tests daemon-tests \
daemon-tests-main daemon-tests-jb daemon-tests-dtx daemon-tests-dtx-cn daemon-tests-pubsub
daemon-tests-main daemon-tests-jb daemon-tests-dtx daemon-tests-dtx-cn daemon-tests-pubsub \
daemon-tests-intfs
TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash
ifeq ($(with_transcoding),yes)
@ -109,7 +110,8 @@ endif
unit-tests: $(TESTS)
for x in $(TESTS); do echo testing: $$x; G_DEBUG=fatal-warnings ./$$x || exit 1; done
daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests-websocket
daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests-websocket \
daemon-tests-intfs
daemon-test-deps: tests-preload.so
$(MAKE) -C ../daemon
@ -162,6 +164,15 @@ daemon-tests-websocket: daemon-test-deps
test "$$(ls fake-$@-sockets)" = ""
rmdir fake-$@-sockets
daemon-tests-intfs: tests-preload.so
$(MAKE) -C ../daemon
rm -rf fake-$@-sockets
mkdir fake-$@-sockets
LD_PRELOAD=../t/tests-preload.so RTPE_BIN=../daemon/rtpengine TEST_SOCKET_PATH=./fake-$@-sockets \
perl -I../perl auto-daemon-tests-intfs.pl
test "$$(ls fake-$@-sockets)" = ""
rmdir fake-$@-sockets
test-bitstr: test-bitstr.o
spandsp_send_fax_pcm: spandsp_send_fax_pcm.o


+ 72
- 0
t/auto-daemon-tests-intfs.pl View File

@ -0,0 +1,72 @@
#!/usr/bin/perl
use strict;
use warnings;
use NGCP::Rtpengine::Test;
use NGCP::Rtpclient::SRTP;
use NGCP::Rtpengine::AutoTest;
use Test::More;
use NGCP::Rtpclient::ICE;
use POSIX;
autotest_start(qw(--config-file=none -t -1 -i foo/203.0.113.1 -i foo/2001:db8:4321::1
-i bar/203.0.113.2 -i bar/2001:db8:4321::2
-n 2223 -c 12345 -f -L 7 -E -u 2222 --silence-detect=1))
or die;
my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $ssrc_b, $resp,
$sock_ax, $sock_bx, $port_ax, $port_bx,
$srtp_ctx_a, $srtp_ctx_b, $srtp_ctx_a_rev, $srtp_ctx_b_rev, $ufrag_a, $ufrag_b,
@ret1, @ret2, @ret3, @ret4, $srtp_key_a, $srtp_key_b, $ts, $seq);
new_call;
offer('intfs selection', { direction => [qw(foo bar)] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/AVP 0
c=IN IP4 198.51.100.1
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.2
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
SDP
answer('intfs selection', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.2
s=tester
t=0 0
m=audio 3000 RTP/AVP 0
c=IN IP4 198.51.100.2
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.2
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
SDP
done_testing();

Loading…
Cancel
Save