export RIC_SIM_HTTPX="http"
export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
export RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
-export RIC_SIM_CERT_MOUNT_DIR="./fakedir" #Fake dir so that the sim container does not find any cert
+export RIC_SIM_CERT_MOUNT_DIR="./cert"
export MR_HTTPX="http"
export MR_PORT=$MR_INTERNAL_PORT
# (Not for test scripts)
__find_sim_port() {
name=$1" " #Space appended to prevent matching 10 if 1 is desired....
- cmdstr="docker ps --filter name=${name} --format \"{{.Names}} {{.Ports}}\" | grep '${name}' | sed s/0.0.0.0:// | cut -f 2 -d ' ' | cut -f 1 -d '-'"
- cmdstr="docker ps --filter name=${name} --format \"{{.Names}} {{.Ports}}\" | grep '${name}' | cut -f 3 -d ',' | sed s/0.0.0.0:// | cut -f 2 -d ' ' | cut -f 1 -d '-'"
-
- res=$(eval $cmdstr)
+ cmdstr="docker inspect --format='{{(index (index .NetworkSettings.Ports \"$RIC_SIM_PORT/tcp\") 0).HostPort}}' ${name}"
+ res=$(eval $cmdstr)
if [[ "$res" =~ ^[0-9]+$ ]]; then
echo $res
else
export RIC_SIM_HTTPX="http"
export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
export RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT
- export RIC_SIM_CERT_MOUNT_DIR="./fakedir" #Fake dir so that the sim container does not find any cert
echo ""
}
export RIC_SIM_HTTPX="https"
export RIC_SIM_LOCALHOST=$RIC_SIM_HTTPX"://localhost:"
export RIC_SIM_PORT=$RIC_SIM_INTERNAL_SECURE_PORT
- export RIC_SIM_CERT_MOUNT_DIR="./cert"
echo ""
}
--- /dev/null
+#!/bin/bash
+
+# ============LICENSE_START===============================================
+# Copyright (C) 2020 Nordix Foundation. All rights reserved.
+# ========================================================================
+# 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.
+# ============LICENSE_END=================================================
+#
+
+# This will generate a self-signed certificate with password 'test'
+openssl req -x509 -passout pass:"test" -newkey rsa:2048 -keyout key.crt -out cert.crt -days 9999
--- /dev/null
+test
\ No newline at end of file
networks:
- default
ports:
- - ${RIC_SIM_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp
environment:
- A1_VERSION=${G1_A1_VERSION}
- REMOTE_HOSTS_LOGGING=1
networks:
- default
ports:
- - ${RIC_SIM_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp
environment:
- A1_VERSION=${G2_A1_VERSION}
- REMOTE_HOSTS_LOGGING=1
networks:
- default
ports:
- - ${RIC_SIM_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_PORT}/tcp
+ - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp
environment:
- A1_VERSION=${G3_A1_VERSION}
- REMOTE_HOSTS_LOGGING=1