TT#170350 support disable cfgt config

* disable cfgt per default
* check.sh: don't call kamcmd cfgt on sipp only

Change-Id: Ibe7b23dce0c8cb85ba8c3d0b8672df20b6e05724
mr10.5.1
Victor Seva 3 years ago
parent 80f9ccf7fd
commit 48fca8d462

@ -1,11 +1,31 @@
#!/bin/bash
#
# Copyright: 2013-2022 Sipwise Development Team <support@sipwise.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# On Debian systems, the complete text of the GNU General
# Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
#
SKIP_CONFIG=false
PROFILE="${PROFILE:-}"
GROUP="${GROUP:-scenarios}"
CAPTURE=false
SINGLE_CAPTURE=false
PROV_TYPE=step
CHECK_TYPE=all
CHECK_TYPE=sipp
CFGT=""
usage() {
echo "Usage: bench.sh [-hCkK] [-p PROFILE] [-x GROUP] [-P <none|all|step>] [-S <all|cfgt|sipp>] num_runs"
@ -73,8 +93,14 @@ rm -rf log_* result_*
BASE_DIR=$(pwd)
export BASE_DIR
case "${CHECK_TYPE}" in
all|cfgt) CFGT="-T" ;;
sipp) ;;
*) echo "check type:${CHECK_TYPE} unknown" >&2; exit 2;;
esac
if ! "${SKIP_CONFIG}" ; then
"${BASE_DIR}/set_config.sh" -x "${GROUP}" -p "${PROFILE}"
"${BASE_DIR}/set_config.sh" "${CFGT}" -x "${GROUP}" -p "${PROFILE}"
fi
echo "$(date) - Starting $NUM tests"

@ -23,7 +23,7 @@ CAPTURE=false
SKIP=false
MEMDBG=false
SKIP_DELDOMAIN=false
CHECK_TYPE=all
CHECK_TYPE=sipp
SKIP_RUNSIPP=false
FIX_RETRANS=false
GRAPH=false
@ -603,7 +603,7 @@ usage() {
echo -e "\\t-C: skip creation of domain and subscribers"
echo -e "\\t-R: skip run sipp"
echo -e "\\t-D: skip deletion of domain and subscribers as final step"
echo -e "\\t-T check type. Default: all"
echo -e "\\t-T check type <all|cfgt|sipp>. Default: sipp"
echo -e "\\t-P: skip parse"
echo -e "\\t-G: creation of graphviz image"
echo -e "\\t-g: creation of graphviz image only if test fails"
@ -705,9 +705,11 @@ if ! "$SKIP_RUNSIPP" ; then
mkdir -p "${KAM_DIR}"
chown -R kamailio:kamailio "${KAM_DIR}"
fi
if ngcp-kamcmd proxy cfgt.list | grep -q "uuid: ${test_uuid}" ; then
echo "$(date) - clean cfgt scenario ${test_uuid}"
ngcp-kamcmd proxy cfgt.clean "${test_uuid}"
if [[ ${CHECK_TYPE} != sipp ]] ; then
if ngcp-kamcmd proxy cfgt.list | grep -q "uuid: ${test_uuid}" ; then
echo "$(date) - clean cfgt scenario ${test_uuid}"
ngcp-kamcmd proxy cfgt.clean "${test_uuid}"
fi
fi
echo "$(date) - Running sipp scenarios"
@ -718,7 +720,7 @@ if ! "$SKIP_RUNSIPP" ; then
cp "${SCEN_CHECK_DIR}/scenario_ids.yml" "${LOG_DIR}"
echo "$(date) - Done"
if ! "${SKIP_MOVE_JSON_KAM}" ; then
if [[ ${CHECK_TYPE} != sipp ]] && ! ${SKIP_MOVE_JSON_KAM} ; then
echo "$(date) - Move kamailio json files"
if [ -d "${JSON_DIR}" ] ; then
for i in "${JSON_DIR}"/*.json ; do

@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# Copyright: 2013-2021 Sipwise Development Team <support@sipwise.com>
# Copyright: 2013-2022 Sipwise Development Team <support@sipwise.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -29,11 +29,12 @@ use Hash::Merge qw(merge);
sub usage
{
my $output = "usage: $PROGRAM_NAME [-hgc] kct_config.yml MODE\n";
my $output = "usage: $PROGRAM_NAME [-hgct] kct_config.yml MODE\n";
$output .= "Options:\n";
$output .= "\t-h: this help\n";
$output .= "\t-g: scenarios group\n";
$output .= "\t-c: number of kamailio.proxy.children\n";
$output .= "\t-t: enable cfgt\n";
$output .= "\tkct_config.yml: config file for k-c-t environment\n";
$output .= "\tMODE: on|off\tdefault: off\n";
return $output
@ -42,6 +43,7 @@ sub usage
my $help = 0;
my $children = 0;
my $group;
my $cfgt = 0;
if (exists $ENV{'GROUP'})
{
@ -55,6 +57,7 @@ GetOptions (
"h|help" => \$help,
"g|group=s" => \$group,
"c|children=i" => \$children,
"t" => \$cfgt,
) or die("Error in command line arguments\n".usage());
if($#ARGV>1 || $help)
@ -80,14 +83,18 @@ sub change_config
my $es_test = $kct_conf->{kamailio}->{lb}->{extra_sockets}->{test};
my $es_other = $kct_conf->{kamailio}->{lb}->{extra_sockets}->{other};
$yaml->{kamailio}{lb}{cfgt} = 'yes';
if ($cfgt)
{
print "enable cfgt\n";
$yaml->{kamailio}{lb}{cfgt} = 'yes';
$yaml->{kamailio}{proxy}{cfgt} = 'yes';
$yaml->{sems}{cfgt} = 'yes';
}
$yaml->{kamailio}{lb}{dns}{use_dns_cache} = 'off';
$yaml->{kamailio}{lb}{extra_sockets}->{test} = "$es_test->{transport}:$es_test->{ip}:$es_test->{port}";
$yaml->{kamailio}{lb}{extra_sockets}->{other} = "$es_other->{transport}:$es_other->{ip}:$es_other->{port}";;
$yaml->{kamailio}{proxy}{children} = $children if($children > 0);
$yaml->{kamailio}{proxy}{permissions_reload_delta} = 0;
$yaml->{kamailio}{proxy}{cfgt} = 'yes';
$yaml->{sems}{cfgt} = 'yes';
$yaml->{sems}{debug} = 'yes';
$yaml->{witnessd}{gather}{sip_responsiveness} = 'no';
$yaml->{security}->{ngcp_panel}->{scripts}->{restapi}->{sslverify} = 'no';

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright: 2013-2021 Sipwise Development Team <support@sipwise.com>
# Copyright: 2013-2022 Sipwise Development Team <support@sipwise.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -29,6 +29,7 @@ PROFILE="${PROFILE:-}"
CLEAN=false
TIMEOUT=${TIMEOUT:-300}
SKIP_NET=false
CFGT=false
usage() {
echo "Usage: set_config.sh [-cht] [-x GROUP] [-p PROFILE]"
@ -38,6 +39,7 @@ usage() {
echo -e "\\t-c clean config"
echo -e "\\t-t set timeout in secs for pid_watcher.py [PRO]. Default: 300"
echo -e "\\t-s skip network IP detection, just use values at config.yml"
echo -e "\\t-T enable cfgt"
echo -e "\t-h this help"
echo "BASE_DIR:${BASE_DIR}"
@ -52,6 +54,7 @@ while getopts 'chp:st:x:' opt; do
s) SKIP_NET=true;;
t) TIMEOUT=${OPTARG};;
x) GROUP=${OPTARG};;
T) CFGT=true;;
*) echo "Unknown option ${opt}"; usage; exit 1;;
esac
done
@ -136,6 +139,8 @@ clean() {
}
config() {
local opts
echo "$(date) - Removed apicert.pem"
rm -f "${BASE_DIR}/apicert.pem"
if ${SKIP_NET} ; then
@ -144,8 +149,13 @@ config() {
echo "$(date) - Guess network IPs"
"${BIN_DIR}/detect_network.py" --verbose "${BASE_DIR}/config.yml" /etc/ngcp-config/network.yml
fi
opts="-c 5 -g ${GROUP}"
if ${CFGT} ; then
opts+=" -t"
fi
echo "$(date) - Setting config debug on"
"${BIN_DIR}/config_debug.pl" -c 5 -g "${GROUP}" "${BASE_DIR}/config.yml" on
# shellcheck disable=SC2086
"${BIN_DIR}/config_debug.pl" ${opts} "${BASE_DIR}/config.yml" on
echo "$(date) - Setting network config"
"${BIN_DIR}/network_config.pl" -g "${GROUP}" "${BASE_DIR}/config.yml" on
if [ "${PROFILE}" == "PRO" ]; then

Loading…
Cancel
Save