set -euo pipefail
COMPOSE_FILE_NAME=docker-compose.yml
-DEV_COMPOSE_FILE_NAME=docker-compose.dev.yml
NETOPEER_CONTAINER_NAME=netopeer
SIMULATOR_CONTAINER_NAME=pnf-simulator
SIMULATOR_PORT=5000
"start")
start $COMPOSE_FILE_NAME;;
"start-dev")
- start $DEV_COMPOSE_FILE_NAME;;
- "start-debug")
- start_netconf_server $DEV_COMPOSE_FILE_NAME;;
+ start_netconf_server $COMPOSE_FILE_NAME;;
"stop")
stop;;
"run-simulator")
function build_image(){
if [ -f pom.xml ]; then
- mvn clean package
+ mvn clean package docker:build
else
echo "pom.xml file not found"
exit 1
fi
}
+function set_vsftpd_file_owner() {
+ sudo chown root ./ftpes/vsftpd/configuration/vsftpd_ssl.conf
+}
+
function start_netconf_server() {
+ set_vsftpd_file_owner
docker-compose -f $1 up -d $NETOPEER_CONTAINER_NAME
echo
echo "NETCONF server container's logs:"
echo "Simulator containers are already up"
else
echo "Starting simulator containers using netconf model specified in config/netconf.env"
-
+ set_vsftpd_file_owner
archive_logs
start_netconf_server $1
docker-compose -f $1 up -d $SIMULATOR_CONTAINER_NAME
}
function running_containers(){
- docker-compose -f $COMPOSE_FILE_NAME ps -q && docker-compose -f $DEV_COMPOSE_FILE_NAME ps -q
+ docker-compose -f $COMPOSE_FILE_NAME ps -q
}
function stop(){
function run_simulator(){
cat << EndOfMessage
Simulator response:
-$(curl -s -X POST -H "Content-Type: application/json" -d @config/config.json $SIMULATOR_START_URL | json_pp)
+$(curl -s -X POST -H "Content-Type: application/json" -H "X-ONAP-RequestID: 123" -H "X-InvocationID: 456" -d @config/config.json $SIMULATOR_START_URL)
EndOfMessage
}
function stop_simulator(){
cat << EndOfMessage
Simulator response:
-$(curl -s -X POST $SIMULATOR_STOP_URL | json_pp)
+$(curl -s -X POST $SIMULATOR_STOP_URL)
EndOfMessage
}
$(docker-compose -f $RUNNING_COMPOSE_CONFIG ps)
Simulator response:
-$(curl -s -X GET $SIMULATOR_STATUS_URL | json_pp)
+$(curl -s -X GET $SIMULATOR_STATUS_URL)
EndOfMessage
}
Available options:
build - locally builds simulator image from existing code
start - starts simulator and netopeer2 containers using remote simulator image and specified model name
-start-dev - starts simulator and netopeer2 containers using remote simulator image
-start-debug - starts only netopeer2 container
+start-dev - starts only netopeer2 container
run-simulator - starts sending PNF registration messages with parameters specified in config.json
stop-simulator - stop sending PNF registration messages
stop - stops both containers