--- /dev/null
+#!/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
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 ####
+
## 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,
. ../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
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
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() {
"//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"
]
}
]
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"
+++ /dev/null
-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'
-