From 13ded6b50a896e47a03adbb8e358bf63437fd077 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 29 May 2025 08:03:28 -0400 Subject: [PATCH] MT#55283 add RTCP tests Change-Id: If686285e3424490620f48a89ada29a5dd4cc9398 (cherry picked from commit 849e16de467d1ff6bed35e9eaf0b314def2b1152) --- t/Makefile | 7 ++- t/auto-daemon-tests-rtcp.pl | 108 ++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 t/auto-daemon-tests-rtcp.pl diff --git a/t/Makefile b/t/Makefile index 67d05af49..d9df009dc 100644 --- a/t/Makefile +++ b/t/Makefile @@ -107,7 +107,7 @@ include ../lib/common.Makefile 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-config-file \ daemon-tests-templ-def daemon-tests-templ-def-offer daemon-tests-t38 daemon-tests-evs-dtx \ - daemon-tests-transform daemon-tests-dtx-no-shift daemon-tests-heuristic + daemon-tests-transform daemon-tests-dtx-no-shift daemon-tests-heuristic daemon-tests-rtcp TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash ifeq ($(with_transcoding),yes) @@ -150,7 +150,7 @@ daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests daemon-tests-templ-def daemon-tests-templ-def-offer \ daemon-tests-sdp-manipulations daemon-tests-sdes-manipulations \ daemon-tests-sdp-orig-replacements daemon-tests-moh daemon-tests-evs-dtx daemon-tests-transform \ - daemon-tests-transcode-config daemon-tests-heuristic + daemon-tests-transcode-config daemon-tests-heuristic daemon-tests-rtcp daemon-test-deps: tests-preload.so $(MAKE) -C ../daemon @@ -258,6 +258,9 @@ daemon-tests-t38: daemon-test-deps spandsp_recv_fax_pcm spandsp_recv_fax_t38 \ daemon-tests-evs-dtx: daemon-test-deps ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-evs-dtx.pl +daemon-tests-rtcp: daemon-test-deps + ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-rtcp.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 \ diff --git a/t/auto-daemon-tests-rtcp.pl b/t/auto-daemon-tests-rtcp.pl new file mode 100644 index 000000000..f4023eb6f --- /dev/null +++ b/t/auto-daemon-tests-rtcp.pl @@ -0,0 +1,108 @@ +#!/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; +use Data::Dumper; + + +autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 -i 2001:db8:4321::1 + --measure-rtp --mos=LQ -n 2223 -f -L 7 -E --log-level-internals=7)) + or die; + + +my ($sock_a, $sock_b, $sock_ax, $sock_bx, + $port_a, $port_ax, $port_b, $port_bx, + $resp); + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( + [qw(198.51.100.1 7124)], + [qw(198.51.100.1 7125)], + [qw(198.51.100.3 7126)], + [qw(198.51.100.3 7127)], +); + +($port_a, $port_ax) = offer('RTCP generation', { flags => ['generate RTCP'] }, < ['generate RTCP'] }, <{SSRC}{4660}{'average MOS'}{MOS}, 43, 'MOS'); +is($resp->{SSRC}{4660}{'average MOS'}{'packet loss'}, 0, 'packet loss'); +is($resp->{SSRC}{26505}{'average MOS'}{MOS}, 43, 'MOS'); +is($resp->{SSRC}{26505}{'average MOS'}{'packet loss'}, 0, 'packet loss'); + + +#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit; +done_testing();