TT#71552 use new cfgt RPC command to clean scenario

* This allows to run the same scenario without having to restart
  kamailio-proxy every time
* set JSON_KAM as default

Change-Id: I0948095e318fa0220c16adfc52e124a9e6c35c67
changes/07/35907/4
Victor Seva 6 years ago
parent f3e64b0912
commit 8618aa81de

@ -29,7 +29,7 @@ SKIP_RUNSIPP=false
FIX_RETRANS=false
GRAPH=false
GRAPH_FAIL=false
JSON_KAM=false
JSON_KAM=true
CDR=false
@ -708,6 +708,7 @@ SCEN_CHECK_DIR="${SCEN_DIR}/${NAME_CHECK}"
DOMAIN=${DOMAIN:-"spce.test"}
PROFILE="${PROFILE:-CE}"
MLOG_DIR="${BASE_DIR}/mem"
test_uuid=$(grep test_uuid "${SCEN_CHECK_DIR}/scenario.yml" | awk '{print $2}')
if [ "${PROFILE}" != "CE" ] && [ "${PROFILE}" != "PRO" ]; then
echo "PROFILE ${PROFILE} unknown"
@ -747,9 +748,10 @@ if ! "$SKIP_RUNSIPP" ; then
echo "$(date) - dir and perms for ${KAM_DIR}"
mkdir -p "${KAM_DIR}"
chown -R kamailio:kamailio "${KAM_DIR}"
else
echo "$(date) - remove ${JSON_DIR}"
rm -rf "${JSON_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}"
fi
fi
echo "$(date) - Cleaning csv/reg.xml files"
@ -784,7 +786,8 @@ if ! "$SKIP_RUNSIPP" ; then
echo "$(date) - Moved file ${i} with size before: ${json_size_before} and after: ${json_size_after}"
rm "${i}"
done
rm -rf "${JSON_DIR}"
echo "$(date) - clean cfgt scenario ${test_uuid}"
ngcp-kamcmd proxy cfgt.clean "${test_uuid}"
echo "$(date) - Done"
else
echo "$(date) - No json files found"

@ -411,6 +411,8 @@ if [[ ${MEMDBG} = 1 ]] ; then
fi
if [ -d "${KAM_DIR}" ]; then
echo "$(date) - clean cfgt scenarios"
ngcp-kamcmd proxy cfgt.clean all
echo "$(date) - Removing temporary json dir"
rm -rf "${KAM_DIR}"
fi

Loading…
Cancel
Save