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'] }, <