- 'emssimulator-swm-netconf':
pattern: 'test/mocks/emssimulator/swm-netconf/**'
docker_root: 'test/mocks/emssimulator/swm-netconf'
- post_script: !include-raw-escape: emssimulator-swm-netconf_post.sh
+ netconf_sim_service_name: 'ems-netconf-swm'
+ post_script: !include-raw-escape: netconf-pnp-simulator-verify.sh
node: 'ubuntu1804-docker-8c-8g'
docker_root: '$WORKSPACE'
post_script: ''
+ netconf_sim_service_name: ''
parameters:
- lf-infra-parameters:
- inject:
properties-content: |
DOCKER_ROOT={docker_root}
+ NETCONF_SIM_SERVICE_NAME={netconf_sim_service_name}
- shell: '{script}'
- shell: '{post_script}'
# See the License for the specific language governing permissions and
# limitations under the License.
-echo "---> emssimulator-swm-netconf_post.sh"
+# Script verifies if all services in Netconf simulator's docker
+# service container were launched successfully.
+
+echo "---> netconf-pnp-simulator-verify.sh"
set -e # Exit with zero only if all commands succeed
-SERVICE_NAME="ems-netconf-swm"
DOCKER_COMPOSE_LOG="/tmp/docker-compose.log"
DOCKER_COMPOSE_LOG_MSG=( "INFO success:" "entered RUNNING state" )
DOCKER_COMPOSE_SLEEP_INTERVAL=4
+if [ -z ${NETCONF_SIM_SERVICE_NAME} ];
+then
+ echo "ERROR: netconf-pnp-simulator service name not set."
+ exit 1
+fi
+
pushd $DOCKER_ROOT
# Dump container logs
docker-compose logs --no-color > ${DOCKER_COMPOSE_LOG}
# Get the supervisord services running within container
-supervisord_services=($(docker-compose exec -T ${SERVICE_NAME} /bin/sh -c \
+supervisord_services=($(docker-compose exec -T ${NETCONF_SIM_SERVICE_NAME} /bin/sh -c \
'cat /etc/supervisord.conf /etc/supervisord.d/*' | grep -ho "program:[-a-zA-Z0-9]*" | cut -d: -f 2))
# Check all services are running and fail if not