Include dashbaord and SDNC A1 Adapter bringing up in the test start.
Issue-ID: NONRTRIC-148
Signed-off-by: YongchaoWu <yongchao.wu@est.tech>
Change-Id: I5f8a94192dde0a5d97113df9173c5f9a9e76024c
TC_ONELINE_DESCR="dockerirze the test, setup docker container for policy agent, cbs, consul, near realtime ric simulator"
-. ../common/testcase_common.sh $1 $2
+. ../common/testcase_common.sh $1 $2 $3
#### TEST BEGIN ####
consul_config_app "../simulator-group/consul_cbs/config.json"
+start_dashboard
+
+start_sdnc
+
start_policy_agent
check_policy_agent_logs
# Set the images for the Policy agent app to use for the auto tests. Do not add the image tag.
#
-# Local image and tag, shall point to locally built image (non-nexus path)
+# Local Policy Agent image and tag, shall point to locally built image (non-nexus path)
export POLICY_AGENT_LOCAL_IMAGE=o-ran-sc/nonrtric-policy-agent
# Remote image
export POLICY_AGENT_REMOTE_IMAGE=nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent
+# SDNC A1 Adapter remote image
+export SDNC_A1_ADAPTER_IMAGE=nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-a1-controller:1.7.4
+# Dashboard remote image
+export DASHBOARD_IMAGE=nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-dashboard:1.0.1
# Common env var for auto-test.
. ../common/test_env.sh
-echo "Test case started as: ${BASH_SOURCE[$i+1]} "$1 $2
+echo "Test case started as: ${BASH_SOURCE[$i+1]} "$1 $2 $3
echo "Numbers of ric simulator started" $2
# This is a script that contains all the functions needed for auto test
IMAGE_TAG="1.0.0-SNAPSHOT"
IMAGE_TAG_REMOTE="latest"
RIC_NUMBER=$2
+SDNC=$3
-if [ $# -lt 1 ] || [ $# -gt 2 ]; then
- echo "Expected arg: local | remote and numbers of the rics "
+if [ $# -lt 1 ] || [ $# -gt 4 ]; then
+ echo "Expected arg: local | remote and numbers of the rics and SDNC "
exit 1
elif [ $1 == "local" ]; then
if [ -z $POLICY_AGENT_LOCAL_IMAGE ]; then
echo ""
}
+start_dashboard() {
+
+ DOCKER_SIM_NWNAME="nonrtric-docker-net"
+ echo "Creating docker network $DOCKER_SIM_NWNAME, if needed"
+ docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME
+
+ echo "start dashboard"
+ curdir=$PWD
+ cd $SIM_GROUP
+ cd dashboard/
+
+ docker-compose up -d
+
+ cd $curdir
+ echo ""
+}
+
+start_sdnc() {
+
+ if [ $SDNC == "sdnc" ]; then
+ DOCKER_SIM_NWNAME="nonrtric-docker-net"
+ echo "Creating docker network $DOCKER_SIM_NWNAME, if needed"
+ docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME
+
+ echo "start sdnc"
+ curdir=$PWD
+ cd $SIM_GROUP
+ cd sdnc/
+
+ docker-compose up -d a1-controller
+
+ cd $curdir
+ echo ""
+ fi
+}
+
prepare_consul_config() {
echo "prepare consul config"
curdir=$PWD
echo ""
}
+
+
clean_containers() {
echo "Stopping all containers, policy agent app(s) and simulators with name prefix 'policy_agent'"
docker stop $(docker ps -q --filter name=/policy-agent) &> /dev/null
docker stop $(docker ps -q --filter name=ric-simulator) &> /dev/null
echo "Removing all containers, policy agent app and simulators with name prefix 'ric-simulator'"
docker rm $(docker ps -a -q --filter name=ric-simulator) &> /dev/null
+ echo "Removing all containers, policy agent app and simulators with name prefix 'dashboard'"
+ docker rm $(docker ps -a -q --filter name=dashboard) &> /dev/null
+ echo "Removing all containers, policy agent app and simulators with name prefix 'a1-controller'"
+ docker rm $(docker ps -a -q --filter name=a1-controller) &> /dev/null
+ echo "Removing all containers, policy agent app and simulators with name prefix 'sdnc_db_container'"
+ docker rm $(docker ps -a -q --filter name=sdnc_db_container) &> /dev/null
+ echo "Removing all containers, policy agent app and simulators with name prefix 'cbs'"
+ docker rm $(docker ps -a -q --filter name=polman_cbs) &> /dev/null
+ echo "Removing all containers, policy agent app and simulators with name prefix 'consul'"
+ docker rm $(docker ps -a -q --filter name=polman_consul) &> /dev/null
echo "Removing unused docker networks with substring 'policy agent' in network name"
docker network rm $(docker network ls -q --filter name=nonrtric)
echo ""
{
"ric": [
- {
- "name": "ric_ric-simulator_6",
- "baseUrl": "http://ric_ric-simulator_6:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_6",
- "stockholm_ric_ric-simulator_6"
- ]
- },
- {
- "name": "ric_ric-simulator_2",
- "baseUrl": "http://ric_ric-simulator_2:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_2",
- "stockholm_ric_ric-simulator_2"
- ]
- },
{
"name": "ric_ric-simulator_3",
"baseUrl": "http://ric_ric-simulator_3:8085/",
]
},
{
- "name": "ric_ric-simulator_7",
- "baseUrl": "http://ric_ric-simulator_7:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_7",
- "stockholm_ric_ric-simulator_7"
- ]
- },
- {
- "name": "ric_ric-simulator_8",
- "baseUrl": "http://ric_ric-simulator_8:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_8",
- "stockholm_ric_ric-simulator_8"
- ]
- },
- {
- "name": "ric_ric-simulator_5",
- "baseUrl": "http://ric_ric-simulator_5:8085/",
+ "name": "ric_ric-simulator_2",
+ "baseUrl": "http://ric_ric-simulator_2:8085/",
"managedElementIds": [
- "kista_ric_ric-simulator_5",
- "stockholm_ric_ric-simulator_5"
+ "kista_ric_ric-simulator_2",
+ "stockholm_ric_ric-simulator_2"
]
},
{
"kista_ric_ric-simulator_1",
"stockholm_ric_ric-simulator_1"
]
- },
- {
- "name": "ric_ric-simulator_9",
- "baseUrl": "http://ric_ric-simulator_9:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_9",
- "stockholm_ric_ric-simulator_9"
- ]
- },
- {
- "name": "ric_ric-simulator_4",
- "baseUrl": "http://ric_ric-simulator_4:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_4",
- "stockholm_ric_ric-simulator_4"
- ]
- },
- {
- "name": "ric_ric-simulator_10",
- "baseUrl": "http://ric_ric-simulator_10:8085/",
- "managedElementIds": [
- "kista_ric_ric-simulator_10",
- "stockholm_ric_ric-simulator_10"
- ]
}
],
"streams_publishes": {
"dmaap_publisher": {
"type": "message_router",
"dmaap_info": {
- "topic_url": "http://admin:admin@localhost:6845/events/A1-POLICY-AGENT-WRITE"
+ "topic_url": "http://message-router:3905/events/A1-POLICY-AGENT-WRITE"
}
}
},
"dmaap_subscriber": {
"type": "message_router",
"dmaap_info": {
- "topic_url": "http://admin:admin@localhost:6845/events/A1-POLICY-AGENT-READ/users/policy-agent"
+ "topic_url": "http://message-router:3905/events/A1-POLICY-AGENT-READ/users/policy-agent"
}
}
}
--- /dev/null
+networks:
+ nonrtric-docker-net:
+ external:
+ name: nonrtric-docker-net
+services:
+ dashboard:
+ image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-dashboard:1.0.1
+
+ networks:
+ nonrtric-docker-net: null
+ ports:
+ - 8080:8080
+version: '3.0'
+
+
--- /dev/null
+# ==================================================================================
+# Modifications Copyright (c) 2019 Nordix Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ==================================================================================
+version: '2.1'
+
+networks:
+ default:
+ driver: bridge
+ name: nonrtric-docker-net
+
+services:
+ db:
+ image: mysql/mysql-server:5.6
+ container_name: sdnc_db_container
+ networks:
+ - default
+ ports:
+ - "3306"
+ environment:
+ - MYSQL_ROOT_PASSWORD=openECOMP1.0
+ - MYSQL_ROOT_HOST=%
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "30m"
+ max-file: "5"
+
+ a1-controller:
+ image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-a1-controller:1.7.4
+ depends_on :
+ - db
+ container_name: a1-controller-container
+ networks:
+ - default
+ entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"]
+ ports:
+ - "8282:8181"
+ links:
+ - db:dbhost
+ - db:sdnctldb01
+ - db:sdnctldb02
+ environment:
+ - MYSQL_ROOT_PASSWORD=openECOMP1.0
+ - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties
+ dns:
+ - ${DNS_IP_ADDR-10.0.100.1}
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "30m"
+ max-file: "5"
+ extra_hosts:
+ aaf.osaaf.org: 10.12.6.214