From a513a60d1d276f0c79509b152c62e08f96d716a6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 21 Oct 2025 04:14:47 -0400 Subject: [PATCH] MT#55283 add port usage test Change-Id: I3ee432b05479baae01539e3584d41278ef67a5ed --- t/auto-daemon-tests-pubsub.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/auto-daemon-tests-pubsub.pl b/t/auto-daemon-tests-pubsub.pl index 2d8ff9488..f3cc5ab69 100755 --- a/t/auto-daemon-tests-pubsub.pl +++ b/t/auto-daemon-tests-pubsub.pl @@ -7,10 +7,11 @@ use NGCP::Rtpclient::SRTP; use NGCP::Rtpengine::AutoTest; use Test::More; use POSIX; +use JSON; 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 --log-level-internals=7)) + -n 2223 -f -L 7 -E --log-level-internals=7)) or die; @@ -3673,5 +3674,18 @@ SDP + +$resp = rtpe_req('cli', 'cli', { body => 'list jsonstats' } ); +$resp = decode_json($resp->{response}); + +is($resp->{interfaces}[0]{name}, 'default', 'intf found'); +is($resp->{interfaces}[0]{address}, '203.0.113.1', 'address found'); +is($resp->{interfaces}[0]{ports}{used}, 184, 'port usage'); +is($resp->{interfaces}[1]{name}, 'default', 'intf found'); +is($resp->{interfaces}[1]{address}, '2001:db8:4321::1', 'address found'); +is($resp->{interfaces}[1]{ports}{used}, 2, 'port usage'); + + + done_testing(); #done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit;