diff --git a/t/Makefile b/t/Makefile index 45f6c989b..25c31aab4 100644 --- a/t/Makefile +++ b/t/Makefile @@ -88,7 +88,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-intfs daemon-tests-stats TESTS= test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash ifeq ($(with_transcoding),yes) @@ -111,7 +111,7 @@ unit-tests: $(TESTS) for x in $(TESTS); do echo testing: $$x; G_DEBUG=fatal-warnings ./$$x || exit 1; done daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests-websocket \ - daemon-tests-intfs + daemon-tests-intfs daemon-tests-stats daemon-test-deps: tests-preload.so $(MAKE) -C ../daemon @@ -156,6 +156,14 @@ daemon-tests-pubsub: daemon-test-deps test "$$(ls fake-$@-sockets)" = "" rmdir fake-$@-sockets +daemon-tests-stats: daemon-test-deps + rm -rf fake-$@-sockets + mkdir fake-$@-sockets + LD_PRELOAD=../t/tests-preload.so RTPE_BIN=../daemon/rtpengine TEST_SOCKET_PATH=./fake-$@-sockets \ + perl -I../perl auto-daemon-tests-stats.pl + test "$$(ls fake-$@-sockets)" = "" + rmdir fake-$@-sockets + daemon-tests-websocket: daemon-test-deps rm -rf fake-$@-sockets mkdir fake-$@-sockets diff --git a/t/auto-daemon-tests-stats.pl b/t/auto-daemon-tests-stats.pl new file mode 100755 index 000000000..6bdd5530b --- /dev/null +++ b/t/auto-daemon-tests-stats.pl @@ -0,0 +1,536 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use NGCP::Rtpengine::Test; +use NGCP::Rtpclient::SRTP; +use NGCP::Rtpengine::AutoTest; +use Test::More; +use POSIX; + + +(POSIX::uname())[1] eq 'moose' or exit(); # long duration tests + + +autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 -i 2001:db8:4321::1 + -n 2223 -c 12345 -f -L 7 -E -u 2222)) + or die; + + +my ($sock_a, $sock_b, $sock_ax, $sock_bx, + $port_a, $port_ax, $port_b, $port_bx, + $ssrc, $resp, $srtp_ctx_a, $srtp_ctx_b, @ret1, @ret2); + + + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( + [qw(198.51.100.1 2010)], + [qw(198.51.100.1 2011)], + [qw(198.51.100.3 2012)], + [qw(198.51.100.3 2013)], +); + +($port_a, $port_ax) = offer('packet loss control', { ICE => 'remove', replace => ['origin'], + flags => ['generate RTCP'] }, < 'remove', replace => ['origin'] }, < ft() }); + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call( + [qw(198.51.100.1 2014)], + [qw(198.51.100.1 2015)], + [qw(198.51.100.3 2016)], + [qw(198.51.100.3 2017)], +); + +($port_a, $port_ax) = offer('packet loss control', { ICE => 'remove', replace => ['origin'], + flags => ['generate RTCP'] }, < 'remove', replace => ['origin'] }, < ft() }); + + +done_testing(); +#NGCP::Rtpengine::AutoTest::terminate('foo');