TT#116100 move creation of scenario.csv to provide_scenario

* this is related to provisioning and as first step lets move it to the
  proper script

Change-Id: I3f7d426961c19c7b99fac074661b3c61d0b9d812
mr9.5.1
Victor Seva 5 years ago
parent ea79ff0766
commit 936063978c

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright: 2013-2020 Sipwise Development Team <support@sipwise.com>
# Copyright: 2013-2021 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
@ -757,18 +757,6 @@ if ! "$SKIP_RUNSIPP" ; then
ngcp-kamcmd proxy cfgt.clean "${test_uuid}"
fi
fi
echo "$(date) - Cleaning csv/reg.xml files"
find "${SCEN_CHECK_DIR}" -name 'sipp_scenario_responder*_reg.xml' -exec rm {} \;
find "${SCEN_CHECK_DIR}" -name '*.csv' -exec rm {} \;
echo "$(date) - Generating csv/reg.xml files"
if ! "${BIN_DIR}/scenario.pl" "${SCEN_CHECK_DIR}/scenario.yml" ; then
error_helper "Error creating csv files" 4
fi
if [ -f "${SCEN_CHECK_DIR}/hosts" ]; then
echo "$(date) - Setting foreign domains"
cat "${SCEN_CHECK_DIR}/hosts" >> /etc/hosts
fi
echo "$(date) - Running sipp scenarios"
run_sipp

@ -175,6 +175,23 @@ delete_voip() {
fi
}
scenario_csv() {
local DOMAIN=$1
echo "$(date) - Cleaning csv/reg.xml files"
find "${SCEN_CHECK_DIR}" -name 'sipp_scenario_responder*_reg.xml' -exec rm {} \;
find "${SCEN_CHECK_DIR}" -name '*.csv' -exec rm {} \;
echo "$(date) - Generating csv/reg.xml files"
if ! "${BIN_DIR}/scenario.pl" "${SCEN_CHECK_DIR}/scenario.yml" ; then
echo "Error creating csv files"
exit 2
fi
if [ -f "${SCEN_CHECK_DIR}/hosts" ]; then
echo "$(date) - Setting foreign domains"
cat "${SCEN_CHECK_DIR}/hosts" >> /etc/hosts
fi
}
create() {
local DOMAIN=$1
delete "${DOMAIN}" # just to be sure nothing is there
@ -182,6 +199,7 @@ create() {
create_voip "${DOMAIN}"
echo "$(date) - Adding prefs"
create_voip_prefs
scenario_csv "${DOMAIN}"
}
usage() {

Loading…
Cancel
Save