aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/netconf-pnp-simulator/engine/configure-modules.sh
diff options
context:
space:
mode:
authorebo <eliezio.oliveira@est.tech>2020-04-11 01:34:47 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-15 10:46:07 +0000
commit398c9b251dc910c4cffc4fc5a3c2b8b221980c91 (patch)
treefa7df466e1a0f4a028445f58992686005e5c80f9 /test/mocks/netconf-pnp-simulator/engine/configure-modules.sh
parent09e87eeadf879bbaa5237a34db1583861097925c (diff)
netconf-pnp-simulator: enable NETCONF send/recv message logging
to aid troubleshooting integration with OpenDaylight - Add more integration tests - Defaults to generic subscriber Issue-ID: INT-1516 Change-Id: Ib5bbf4cdbba6cdfee901f6c07dfa195a21cd8bbb Signed-off-by: ebo <eliezio.oliveira@est.tech>
Diffstat (limited to 'test/mocks/netconf-pnp-simulator/engine/configure-modules.sh')
-rwxr-xr-xtest/mocks/netconf-pnp-simulator/engine/configure-modules.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/mocks/netconf-pnp-simulator/engine/configure-modules.sh b/test/mocks/netconf-pnp-simulator/engine/configure-modules.sh
index 2010b504f..d40918f31 100755
--- a/test/mocks/netconf-pnp-simulator/engine/configure-modules.sh
+++ b/test/mocks/netconf-pnp-simulator/engine/configure-modules.sh
@@ -26,6 +26,7 @@ source $HERE/common.sh
MODELS_CONFIG=$CONFIG/modules
BASE_VIRTUALENVS=$HOME/.local/share/virtualenvs
+GENERIC_SUBSCRIBER=/opt/bin/generic_subscriber.py
install_and_configure_yang_model()
{
@@ -54,6 +55,8 @@ configure_subscriber_execution()
APP_PATH=$env_dir/bin:$APP_PATH
fi
log INFO Preparing launching of module \"$model\" application
+ # shellcheck disable=SC2153
+ loguru_format="${LOGURU_FORMAT//\{module\}/$model}"
cat > /etc/supervisord.d/$model.conf <<EOF
[program:subs-$model]
command=$app $model
@@ -61,7 +64,7 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
autorestart=true
-environment=PATH=$APP_PATH,PYTHONUNBUFFERED="1"
+environment=PATH=$APP_PATH,PYTHONUNBUFFERED="1",LOGURU_FORMAT="$loguru_format"
EOF
}
@@ -89,7 +92,11 @@ for dir in "$MODELS_CONFIG"/*; do
install_and_configure_yang_model $dir $model
app="$dir/subscriber.py"
if [ -x "$app" ]; then
- configure_subscriber_execution $dir $model $app
+ log INFO Module $model is using its own subscriber
+ else
+ log WARN Module $model is using the generic subscriber
+ app=$GENERIC_SUBSCRIBER
fi
+ configure_subscriber_execution $dir $model $app
fi
done