Browse Source

MT#61352 add config file test

Change-Id: I42df2103693d97e1d4ec639d74e934fb82e1c6df
pull/1876/head
Richard Fuchs 1 year ago
parent
commit
53a450ed48
3 changed files with 86 additions and 2 deletions
  1. +5
    -2
      t/Makefile
  2. +74
    -0
      t/auto-daemon-tests-config-file.pl
  3. +7
    -0
      t/test.conf

+ 5
- 2
t/Makefile View File

@ -101,7 +101,7 @@ include ../lib/common.Makefile
daemon-tests-main daemon-tests-jb daemon-tests-dtx daemon-tests-dtx-cn daemon-tests-pubsub \
daemon-tests-intfs daemon-tests-stats daemon-tests-delay-buffer daemon-tests-delay-timing \
daemon-tests-evs daemon-tests-player-cache daemon-tests-redis daemon-tests-redis-json \
daemon-tests-measure-rtp daemon-tests-mos-legacy daemon-tests-mos-fullband
daemon-tests-measure-rtp daemon-tests-mos-legacy daemon-tests-mos-fullband daemon-tests-config-file
TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash
ifeq ($(with_transcoding),yes)
@ -140,7 +140,7 @@ daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests
daemon-tests-audio-player daemon-tests-audio-player-play-media \
daemon-tests-intfs daemon-tests-stats daemon-tests-player-cache daemon-tests-redis \
daemon-tests-rtpp-flags daemon-tests-redis-json daemon-tests-measure-rtp daemon-tests-mos-legacy \
daemon-tests-mos-fullband
daemon-tests-mos-fullband daemon-tests-config-file
daemon-test-deps: tests-preload.so
$(MAKE) -C ../daemon
@ -208,6 +208,9 @@ daemon-tests-mos-legacy: daemon-test-deps
daemon-tests-mos-fullband: daemon-test-deps
./auto-test-helper "$@" perl -I../perl auto-daemon-tests-mos-fullband.pl
daemon-tests-config-file: daemon-test-deps
./auto-test-helper "$@" perl -I../perl auto-daemon-tests-config-file.pl
test-bitstr: test-bitstr.o
test-mix-buffer: test-mix-buffer.o $(COMMONOBJS) mix_buffer.o ssrc.o rtp.o crypto.o helpers.o \


+ 74
- 0
t/auto-daemon-tests-config-file.pl View File

@ -0,0 +1,74 @@
#!/usr/bin/perl
use strict;
use warnings;
use NGCP::Rtpengine::Test;
use NGCP::Rtpclient::SRTP;
use NGCP::Rtpengine::AutoTest;
use Test::More;
use Test2::Tools::Compare qw();
use NGCP::Rtpclient::ICE;
use POSIX;
autotest_start(qw(--config-file=test.conf)) 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, $has_recv);
new_call;
offer('basic call', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
c=IN IP4 198.51.100.19
t=0 0
m=audio 6000 RTP/AVP 0 8
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
m=audio PORT RTP/AVP 0 8
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('interface', { 'out-interface' => 'foobar' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
c=IN IP4 198.51.100.19
t=0 0
m=audio 6000 RTP/AVP 0 8
----------------------------------
v=0
o=- 1545997027 1 IN IP4 172.17.0.2
s=tester
t=0 0
m=audio PORT RTP/AVP 0 8
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP
#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit;
done_testing();

+ 7
- 0
t/test.conf View File

@ -0,0 +1,7 @@
[rtpengine]
table = -1
interface = 203.0.113.1 ; 2001:db8:4321::1 ; 203.0.113.2 ; 2001:db8:4321::2 ; foobar/203.0.113.3 ; quux/203.0.113.4
listen-ng = 2223
foreground = true
log-level = 7
log-stderr = true

Loading…
Cancel
Save