From 0c07eed657dc443ae145f66888be784ed5b6ac7e 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 bedaee0cc7701bf7e82c6ed33bc29e6b2705fd4d) --- t/Makefile | 8 +- t/auto-daemon-tests-heuristic.pl | 584 +++++++++++++++++++++++++++++++ 2 files changed, 590 insertions(+), 2 deletions(-) create mode 100755 t/auto-daemon-tests-heuristic.pl diff --git a/t/Makefile b/t/Makefile index 545b8fa16..da231d66b 100644 --- a/t/Makefile +++ b/t/Makefile @@ -95,7 +95,7 @@ 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-intfs daemon-tests-stats daemon-tests-delay-buffer daemon-tests-delay-timing \ - daemon-tests-evs daemon-tests-player-cache daemon-tests-redis + daemon-tests-evs daemon-tests-player-cache daemon-tests-redis daemon-tests-heuristic TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash ifeq ($(with_transcoding),yes) @@ -132,7 +132,8 @@ unit-tests: $(TESTS) daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests-websocket \ daemon-tests-evs \ 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-intfs daemon-tests-stats daemon-tests-player-cache daemon-tests-redis \ + daemon-tests-heuristic daemon-test-deps: tests-preload.so $(MAKE) -C ../daemon @@ -143,6 +144,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'] }, <