# arg: <image-tag-suffix> (selects staging, snapshot, release etc)
# <image-tag-suffix> is present only for images with staging, snapshot,release tags
__RICSIM_imagesetup() {
- __check_and_create_image_var RICSIM "RIC_SIM_IMAGE" "RIC_SIM_IMAGE_BASE" "RIC_SIM_IMAGE_TAG" $1 "$RIC_SIM_DISPLAY_NAME"
+ __check_and_create_image_var RICSIM "RIC_SIM_IMAGE" "RIC_SIM_IMAGE_BASE" "RIC_SIM_IMAGE_TAG" $1 "$RIC_SIM_DISPLAY_NAME" ""
}
# Pull image from remote repo or use locally built image
}
# Scale kubernetes resources to zero and wait until this has been accomplished, if relevant. If not relevant to scale, then do no action.
-# This function is called for prestarted apps not managed by the test script.
+# This function is called for pre-started apps not managed by the test script.
__RICSIM_kube_scale_zero_and_wait() {
#__kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app $KUBE_A1SIM_NAMESPACE"-"$RIC_SIM_PREFIX
__kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app $KUBE_A1SIM_NAMESPACE"-a1simulator"
}
-# Delete all kube resouces for the app
+# Delete all kube resources for the app
# This function is called for apps managed by the test script.
__RICSIM_kube_delete_all() {
__kube_delete_all_resources $KUBE_A1SIM_NAMESPACE autotest RICSIM
# Store docker logs
# This function is called for apps managed by the test script.
-# args: <log-dir> <file-prexix>
+# args: <log-dir> <file-prefix>
__RICSIM_store_docker_logs() {
if [ $RUNMODE == "KUBE" ]; then
for podname in $(kubectl $KUBECONF get pods -n $KUBE_A1SIM_NAMESPACE -l "autotest=RICSIM" -o custom-columns=":metadata.name"); do
use_simulator_http
}
-# Set app short-name, app name and namespace for logging runtime statistics of kubernets pods or docker containers
+# Set app short-name, app name and namespace for logging runtime statistics of kubernetes pods or docker containers
# For docker, the namespace shall be excluded
-# This function is called for apps managed by the test script as well as for prestarted apps.
+# This function is called for apps managed by the test script as well as for pre-started apps.
# args: -
-__RICSIM_statisics_setup() {
+__RICSIM_statistics_setup() {
for ((RICSIM_INSTANCE=10; RICSIM_INSTANCE>0; RICSIM_INSTANCE-- )); do
if [ $RUNMODE == "KUBE" ]; then
RICSIM_INSTANCE_KUBE=$(($RICSIM_INSTANCE-1))
echo -n " RICSIM_G2_$RICSIM_INSTANCE_KUBE ${RIC_SIM_PREFIX}-g2-$RICSIM_INSTANCE_KUBE $KUBE_A1SIM_NAMESPACE "
echo -n " RICSIM_G3_$RICSIM_INSTANCE_KUBE ${RIC_SIM_PREFIX}-g3-$RICSIM_INSTANCE_KUBE $KUBE_A1SIM_NAMESPACE "
else
- if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then
- echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g1_$RICSIM_INSTANCE "
- echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g2_$RICSIM_INSTANCE "
- echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g3_$RICSIM_INSTANCE "
- else
- echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g1-$RICSIM_INSTANCE "
- echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g2-$RICSIM_INSTANCE "
- echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g3-$RICSIM_INSTANCE "
- fi
+ echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g1-$RICSIM_INSTANCE "
+ echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g2-$RICSIM_INSTANCE "
+ echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g3-$RICSIM_INSTANCE "
fi
done
}
__check_included_image "RICSIM"
retcode_i=$?
- # Check if app shall only be used by the testscipt
+ # Check if app shall only be used by the test script
__check_prestarted_image "RICSIM"
retcode_p=$?
fi
echo " $2 simulators using basename: $1 on interface: $3"
- #Set env var for simulator count and A1 interface vesion for the given group
+ #Set env var for simulator count and A1 interface version for the given group
if [ $1 == "$RIC1" ]; then
G1_COUNT=$2
elif [ $1 == "$RIC2" ]; then
echo -e $BOLD$YELLOW" Warning: Using docker compose --force-recreate "$EYELLOW$EBOLD
docker_args="--force-recreate --scale $RICSIM_COMPOSE_SERVICE_NAME=$2"
- #Create a list of contsiner names
- #Will be <ricsim-prefix>_<service-name>_<index>
- # or
- # <ricsim-prefix>-<service-name>-<index>
+ #Create a list of container names
+ #Will be <ricsim-prefix>-<service-name>-<index>
app_data=""
cntr=1
- if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then
- app_name_prefix=$RIC_SIM_PREFIX"_"$RICSIM_COMPOSE_SERVICE_NAME"_"
- else
- app_name_prefix=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-"
- fi
+ app_name_prefix=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-"
while [ $cntr -le $2 ]; do
app=$app_name_prefix$cntr
app_data="$app_data $app"
cntr=1
while [ $cntr -le $2 ]; do
- if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then
- app=$RIC_SIM_PREFIX"_"$RICSIM_COMPOSE_SERVICE_NAME"_"$cntr
- else
- app=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-"$cntr
- fi
+ app=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-"$cntr
__check_service_start $app $RIC_SIM_HTTPX"://"$app:$RIC_SIM_PORT$RIC_SIM_ALIVE_URL
let cntr=cntr+1
done
fi
echo $RIC_SIM_HTTPX"://"$ricname.$ric_setname.$KUBE_A1SIM_NAMESPACE":"$RIC_SIM_PORT
else
- if [ $DOCKER_COMPOSE_VERSION == "V1" ]; then
- echo $RIC_SIM_HTTPX"://"$1":"$RIC_SIM_PORT
- else
- ricname=$(echo "$1" | tr '_' '-')
- echo $RIC_SIM_HTTPX"://"$ricname":"$RIC_SIM_PORT
- fi
+ ricname=$(echo "$1" | tr '_' '-')
+ echo $RIC_SIM_HTTPX"://"$ricname":"$RIC_SIM_PORT
fi
}
UUID=${UUID:0:${#UUID}-4}"a"
}
-# Excute a curl cmd towards a ricsimulator and check the response code.
+# Execute a curl cmd towards a ricsimulator and check the response code.
# args: <expected-response-code> <curl-cmd-string>
__execute_curl_to_sim() {
echo ${FUNCNAME[1]} "line: "${BASH_LINENO[1]} >> $HTTPLOG