TT#76664 Check if there are still rtp ports open after tests execution

The command
   rtpengine-ctl -ip "${rtpengine_ctl_ip}" list interfaces
is used to check the number of rtp ports still open on the system

Change-Id: Id0e48aaf1f354cecf153db8102a5b5635e073287
changes/94/38694/3
Marco Capetta 6 years ago
parent 36dc88e1fc
commit 04d6ec70c8

@ -117,7 +117,8 @@ else
$yaml->{sems}{debug} = 'yes';
$yaml->{witnessd}{gather}{sip_responsiveness} = 'no';
$yaml->{security}->{ngcp_panel}->{scripts}->{restapi}->{sslverify} = 'no';
$yaml->{mediator}{interval} = '1';
$yaml->{mediator}{interval} = '1'; # Necessary to speedup the creation of the CDRs
$yaml->{rtpproxy}{delete_delay} = '5'; # Necessary to speedup the deletetion of the used ports in rtpengine
$net_yaml = LoadFile($file_net_yaml);
$net_yaml->{hosts_common}->{etc_hosts_global_extra_entries} //= ();

@ -381,8 +381,26 @@ for t in ${SCENARIOS}; do
fi
done
# Hack to allow tcpdump to capture all the packages and kamailio to write all the json files
sleep 5
# Hack to allow:
# - tcpdump to capture all the packages
# - kamailio to write all the json files
# - rtpengine to close rtp ports
sleep 6
# Check if there are still some rtp port open after tests execution
rtpengine_ctl_ip=$(grep 'listen-cli' /etc/rtpengine/rtpengine.conf |awk '{print $3}')
rtp_ports=$(rtpengine-ctl -ip "${rtpengine_ctl_ip}" list interfaces |grep "Ports used" | awk '{print $3}')
if [ -n "${rtp_ports}" ]; then
while read -r i; do
if [ "${i}" -gt 0 ]; then
echo "$(date) - ================================================================================="
echo "$(date) - There are still some rtp ports open, please check the following output"
rtpengine-ctl -ip "${rtpengine_ctl_ip}" list interfaces
echo "$(date) - ================================================================================="
error_flag=1
fi
done <<< "${rtp_ports}"
fi
if "${CAPTURE}" ; then
stop_capture

Loading…
Cancel
Save