From e7020a21c7cc984aa498805cf0889e7dd7461027 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 2 May 2025 07:23:40 -0400 Subject: [PATCH] MT#62735 add tests for heuristic learning mode Change-Id: I0c3d67f4ee3f3350fcf0b350c39e475db948c6c8 (cherry picked from commit ee32e5ba5fade0cb9e3620f8abc05fcc9054387b) (cherry picked from commit f05f8097296a60e496d4c128cf59037262c57511) --- t/Makefile | 7 +- t/auto-daemon-tests-heuristic.pl | 584 +++++++++++++++++++++++++++++++ 2 files changed, 589 insertions(+), 2 deletions(-) create mode 100755 t/auto-daemon-tests-heuristic.pl diff --git a/t/Makefile b/t/Makefile index 61b5677aa..67d05af49 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-transform daemon-tests-dtx-no-shift daemon-tests-heuristic 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-transcode-config daemon-tests-heuristic daemon-test-deps: tests-preload.so $(MAKE) -C ../daemon @@ -161,6 +161,9 @@ daemon-tests-main: daemon-test-deps daemon-tests-jb: daemon-test-deps ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-jb.pl +daemon-tests-heuristic: daemon-test-deps + ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-heuristic.pl + daemon-tests-dtx: daemon-test-deps ./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx.pl diff --git a/t/auto-daemon-tests-heuristic.pl b/t/auto-daemon-tests-heuristic.pl new file mode 100755 index 000000000..facb612b6 --- /dev/null +++ b/t/auto-daemon-tests-heuristic.pl @@ -0,0 +1,584 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use NGCP::Rtpengine::Test; +use NGCP::Rtpclient::SRTP; +use NGCP::Rtpengine::AutoTest; +use Test::More; + + +autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 + -n 2223 -f -L 7 -E --endpoint-learning=heuristic)) + or die; + + +my ($sock_a, $sock_b, $sock_c, $sock_d, $sock_e, $port_a, $port_b); + + + + +($sock_a, $sock_b, $sock_c, $sock_d, $sock_e) = new_call( + [qw(198.51.100.1 2010)], # caller + [qw(198.51.100.3 2012)], # callee - from SDP + [qw(198.51.100.3 2032)], # callee - different port + [qw(198.51.100.6 2012)], # callee - different address + [qw(198.51.100.6 2032)], # callee - all different +); + +($port_a) = offer('basic, forward', { }, < ['strict source'] }, < ['strict source'] }, < ['strict source'] }, < ['strict source'] }, <