From 562877edb6167ba7e667ab5a693c0f4b69883872 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 9e4f11b3b1c48f1cd0e52dd13f571d15506c3677) --- 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 7f8c9d042..5148aff3c 100644 --- a/t/Makefile +++ b/t/Makefile @@ -105,7 +105,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-t38 daemon-tests-evs-dtx \ - daemon-tests-measure-rtp + daemon-tests-measure-rtp daemon-tests-heuristic TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash ifeq ($(with_transcoding),yes) @@ -143,7 +143,7 @@ daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests daemon-tests-evs daemon-tests-async-tc \ 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-measure-rtp + daemon-tests-rtpp-flags daemon-tests-measure-rtp daemon-tests-heuristic daemon-test-deps: tests-preload.so $(MAKE) -C ../daemon @@ -154,6 +154,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'] }, <