Dockerize the test enviroment
-Dockerize policy-agent, cbs, consul, simulator
-end2end call from policy-agent to simulator can be called
in a dockerized way for future demo and test.
Issue-ID: NONRTRIC-79
Signed-off-by: YongchaoWu <yongchao.wu@est.tech>
Change-Id: Ib57bcb900a337e315b839a7761789c5153a09266
diff --git a/near-rt-ric-simulator/auto-test/Dockerize_test.sh b/near-rt-ric-simulator/auto-test/Dockerize_test.sh
new file mode 100755
index 0000000..611523e
--- /dev/null
+++ b/near-rt-ric-simulator/auto-test/Dockerize_test.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+TC_ONELINE_DESCR="dockerirze the test, setup docker container for policy agent, cbs, consul, near realtime ric simulator"
+
+. ../common/testcase_common.sh $1
+
+#### TEST BEGIN ####
+
+clean_containers
+
+start_simulators
+
+consul_config_app "../simulator-group/consul_cbs/config.json"
+
+start_policy_agent
+
+check_policy_agent_logs
+
+#### TEST COMPLETE ####
+
+store_logs END
diff --git a/near-rt-ric-simulator/auto-test/FTC1.sh b/near-rt-ric-simulator/auto-test/FTC1.sh
index f49a179..80d1219 100755
--- a/near-rt-ric-simulator/auto-test/FTC1.sh
+++ b/near-rt-ric-simulator/auto-test/FTC1.sh
@@ -2,7 +2,7 @@
TC_ONELINE_DESCR="Auto test for policy agent refreshing configurations from consul/cbs"
-. ../common/testcase_common.sh $1 $2
+. ../common/testcase_common.sh $1
#### TEST BEGIN ####
diff --git a/near-rt-ric-simulator/auto-test/README.md b/near-rt-ric-simulator/auto-test/README.md
index 676f079..319137a 100644
--- a/near-rt-ric-simulator/auto-test/README.md
+++ b/near-rt-ric-simulator/auto-test/README.md
@@ -1,3 +1,4 @@
+
## Automated test Description
This auto-test repo stores test script for automated test cases for policy agent.
Each of the testcase script will bring up a containerized test enviroment for Policy Agent,
diff --git a/near-rt-ric-simulator/common/testcase_common.sh b/near-rt-ric-simulator/common/testcase_common.sh
index 7a8d8dc..ae6563d 100755
--- a/near-rt-ric-simulator/common/testcase_common.sh
+++ b/near-rt-ric-simulator/common/testcase_common.sh
@@ -2,7 +2,7 @@
. ../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
# This is a script that contains all the functions needed for auto test
# Arg: local | remote
@@ -13,7 +13,7 @@
IMAGE_TAG_REMOTE="1.0.0"
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
- echo "Expected arg: local [<image-tag>] | remote [<image-tag>] "
+ echo "Expected arg: local | remote "
exit 1
elif [ $1 == "local" ]; then
if [ -z $POLICY_AGENT_LOCAL_IMAGE ]; then
@@ -111,6 +111,22 @@
fi
fi
+echo ""
+
+echo "Building images for the simulators"
+curdir=$PWD
+cd $SIM_GROUP
+cd ../ric-plt/a1
+docker build -t ric-simulator:latest . &> /dev/null
+cd $curdir
+
+echo ""
+
+echo "Local registry images for simulators:"
+echo "Consul: " $(docker images | grep consul)
+echo "CBS: " $(docker images | grep platform.configbinding.app)
+echo "RIC: " $(docker images | grep ric-simulator)
+echo ""
__consul_config() {
diff --git a/near-rt-ric-simulator/simulator-group/consul_cbs/config.json b/near-rt-ric-simulator/simulator-group/consul_cbs/config.json
index d63d860..4dc0f6c 100644
--- a/near-rt-ric-simulator/simulator-group/consul_cbs/config.json
+++ b/near-rt-ric-simulator/simulator-group/consul_cbs/config.json
@@ -2,19 +2,11 @@
"//description": "Application configuration",
"ric": [
{
- "name": "ric1",
- "baseUrl": "http://localhost:8080/",
+ "name": "ric3",
+ "baseUrl": "http://ric3:8085/",
"managedElementIds": [
- "kista_1",
- "kista_2"
- ]
- },
- {
- "name": "ric2",
- "baseUrl": "http://localhost:8081/",
- "managedElementIds": [
- "kista_3",
- "kista_4"
+ "kista_5",
+ "kista_6"
]
}
]
diff --git a/near-rt-ric-simulator/simulator-group/consul_cbs/docker-compose-template.yml b/near-rt-ric-simulator/simulator-group/consul_cbs/docker-compose-template.yml
index 1dcdb79..2f7ac3e 100644
--- a/near-rt-ric-simulator/simulator-group/consul_cbs/docker-compose-template.yml
+++ b/near-rt-ric-simulator/simulator-group/consul_cbs/docker-compose-template.yml
@@ -27,4 +27,12 @@
environment:
- CONSUL_HOST=consul-server
depends_on:
- - consul-server
\ No newline at end of file
+ - consul-server
+
+ ric-simulator:
+ networks:
+ - nonrtric-docker-net
+ container_name: ric3
+ image: ric-simulator:latest
+ ports:
+ - "8085:8085"
diff --git a/near-rt-ric-simulator/simulator-group/docker-compose.yml b/near-rt-ric-simulator/simulator-group/docker-compose.yml
deleted file mode 100644
index 2464b0e..0000000
--- a/near-rt-ric-simulator/simulator-group/docker-compose.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-networks:
- nonrtric-docker-net:
- external:
- name: nonrtric-docker-net
-services:
- config-binding-service:
- container_name: polman_cbs
- depends_on:
- - consul-server
- environment:
- CONSUL_HOST: consul-server
- image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:2.3.0
- networks:
- nonrtric-docker-net: null
- ports:
- - 10000:10000/tcp
- consul-server:
- container_name: polman_consul
- image: docker.io/consul:1.4.4
- networks:
- nonrtric-docker-net: null
- ports:
- - 8500:8500/tcp
- volumes:
- - /Users/yonwu/ORAN/nonrtric/near-rt-ric-simulator/simulator-group/consul_cbs/consul:/consul/config:rw
-version: '3.0'
-