From 567a6c881775faff539084ddab9d172cbcf22639 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 19 Jan 2021 17:35:59 +0100 Subject: [PATCH] TT#104401 config: add dummy interface rtp_tag * in order to be able to select a different rtp_interface on some scenario and check our logic Change-Id: I977dd87e6719ed3d2c1f8806cd56a8a285ee94ca --- bin/config_debug.pl | 12 ++++++++++++ set_config.sh | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/config_debug.pl b/bin/config_debug.pl index 73deaea5..e087f066 100755 --- a/bin/config_debug.pl +++ b/bin/config_debug.pl @@ -44,6 +44,7 @@ my $help = 0; my $children = 0; my $profile = "CE"; my $group; + if (exists $ENV{'GROUP'}) { $group = $ENV{'GROUP'}; @@ -120,8 +121,19 @@ else $yaml->{mediator}{interval} = '1'; # Necessary to speedup the creation of the CDRs $yaml->{rtpproxy}{delete_delay} = '2'; # Necessary to speedup the deletetion of the used ports in rtpengine $yaml->{rtpproxy}{log_level} = '7'; + $yaml->{modules}[0]->{enable} = 'yes'; # dummy module should be the first one $net_yaml = LoadFile($file_net_yaml); + + for my $host (keys %{$net_yaml->{hosts}}) { + $net_yaml->{hosts}->{$host}->{dummy0} = { + ip => '172.30.1.2', + netmask => '255.255.255.0', + type => ['rtp_tag'] + }; + push @{$net_yaml->{hosts}->{$host}->{interfaces}}, 'dummy0'; + } + $net_yaml->{hosts_common}->{etc_hosts_global_extra_entries} //= (); my $entries = $net_yaml->{hosts_common}->{etc_hosts_global_extra_entries}; push @{$entries}, "127.0.0.1 $domain"; diff --git a/set_config.sh b/set_config.sh index 49f577bf..a0f91ac1 100755 --- a/set_config.sh +++ b/set_config.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e RUN_DIR="$(dirname "$0")" export BASE_DIR=${BASE_DIR:-$RUN_DIR} # Set up the environment, to use local perl modules @@ -37,7 +38,10 @@ if ! ngcpcfg apply "config debug on via kamailio-config-tests" ; then echo "$(date) - ngcpcfg apply returned $?" error_flag=4 fi -echo "$(date) - Setting config[${GROUP}] debug on. Done[${error_flag}]" +echo "$(date) - start dummy0 interface" +ifup dummy0 + +echo "$(date) - Setting config[${GROUP}] debug on. Done[${error_flag}]" exit ${error_flag}