echo -ne $EBOLD
# default test environment variables
-TEST_ENV_VAR_FILE="../common/test_env.sh"
+TEST_ENV_VAR_FILE=""
echo "Test case started as: ${BASH_SOURCE[$i+1]} "$@
if [ -z "$1" ]; then
paramerror=1
else
- echo "Option set - Overriding test_env.sh with: "$1
+ echo "Option set - Reading test env from: "$1
shift;
foundparm=0
fi
. $TEST_ENV_VAR_FILE
else
echo -e $RED"Selected env var file does not exist: "$TEST_ENV_VAR_FILE$ERED
+ echo " Select one of following env var file matching the intended target of the test"
+ echo " Restart the test using the flag '--env-file <path-to-env-file>"
+ ls ../common/test_env* | indent1
exit 1
fi
G1_A1_VERSION=""
G2_A1_VERSION=""
G3_A1_VERSION=""
+G4_A1_VERSION=""
+G5_A1_VERSION=""
G1_COUNT=0
G2_COUNT=0
G3_COUNT=0
+G4_COUNT=0
+G5_COUNT=0
# Vars to switch between http and https. Extra curl flag needed for https
export RIC_SIM_HTTPX="http"
tag="${!5}"
if [ -z $image ]; then
- echo -e $RED"\$"$4" not set in test_env"$ERED
+ echo -e $RED"\$"$4" not set in $TEST_ENV_VAR_FILE"$ERED
((IMAGE_ERR++))
echo ""
tmp=$tmp"<no-image>\t"
tmp=$tmp$image"\t"
fi
if [ -z $tag ]; then
- echo -e $RED"\$"$5" not set in test_env"$ERED
+ echo -e $RED"\$"$5" not set in $TEST_ENV_VAR_FILE"$ERED
((IMAGE_ERR++))
echo ""
tmp=$tmp"<no-tag>\t"
SIM_GROUP=$PWD/../simulator-group
if [ ! -d $SIM_GROUP ]; then
echo "Trying to set env var SIM_GROUP to dir 'simulator-group' in the nontrtric repo, but failed."
- echo -e $RED"Please set the SIM_GROUP manually in the test_env.sh"$ERED
+ echo -e $RED"Please set the SIM_GROUP manually in the applicable $TEST_ENV_VAR_FILE"$ERED
exit 1
else
echo " SIM_GROUP auto set to: " $SIM_GROUP
fi
elif [ $SIM_GROUP = *simulator_group ]; then
- echo -e $RED"Env var SIM_GROUP does not seem to point to dir 'simulator-group' in the repo, check common/test_env.sh"$ERED
+ echo -e $RED"Env var SIM_GROUP does not seem to point to dir 'simulator-group' in the repo, check $TEST_ENV_VAR_FILE"$ERED
exit 1
else
echo " SIM_GROUP env var already set to: " $SIM_GROUP
echo ""
}
-# Start one group (ricsim_g1, ricsim_g2 or ricsim_g3) with a number of RIC Simulators using a given A interface
+# Start one group (ricsim_g1, ricsim_g2 .. ricsim_g5) with a number of RIC Simulators using a given A interface
# 'ricsim' may be set on command line to other prefix
-# args: ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>
+# args: ricsim_g1|ricsim_g2|ricsim_g3|ricsim_g4|ricsim_g5 <count> <interface-id>
# (Function for test scripts)
start_ric_simulators() {
RIC1=$RIC_SIM_PREFIX"_g1"
RIC2=$RIC_SIM_PREFIX"_g2"
RIC3=$RIC_SIM_PREFIX"_g3"
+ RIC4=$RIC_SIM_PREFIX"_g4"
+ RIC5=$RIC_SIM_PREFIX"_g5"
if [ $# != 3 ]; then
((RES_CONF_FAIL++))
- __print_err "need three args, $RIC1|$RIC2|$RIC3 <count> <interface-id>" $@
+ __print_err "need three args, $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
exit 1
fi
echo " $2 simulators using basename: $1 on interface: $3"
elif [ $1 == "$RIC3" ]; then
G3_COUNT=$2
G3_A1_VERSION=$3
+ elif [ $1 == "$RIC4" ]; then
+ G4_COUNT=$2
+ G4_A1_VERSION=$3
+ elif [ $1 == "$RIC5" ]; then
+ G5_COUNT=$2
+ G5_A1_VERSION=$3
else
((RES_CONF_FAIL++))
- __print_err "need three args, $RIC1|$RIC2|$RIC3 <count> <interface-id>" $@
+ __print_err "need three args, $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 <count> <interface-id>" $@
exit 1
fi
export G1_A1_VERSION
export G2_A1_VERSION
export G3_A1_VERSION
+ export G4_A1_VERSION
+ export G5_A1_VERSION
- docker_args="--scale g1=$G1_COUNT --scale g2=$G2_COUNT --scale g3=$G3_COUNT"
+ docker_args="--scale g1=$G1_COUNT --scale g2=$G2_COUNT --scale g3=$G3_COUNT --scale g4=$G4_COUNT --scale g5=$G5_COUNT"
app_data=""
cntr=1
while [ $cntr -le $2 ]; do
# (Function for test scripts)
set_agent_debug() {
echo -e $BOLD"Setting agent debug"$EBOLD
- curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT/actuator/loggers/org.oransc.policyagent -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
+ actuator="/actuator/loggers/org.oransc.policyagent"
+ if [[ $POLICY_AGENT_IMAGE = *"onap"* ]]; then
+ actuator="/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice"
+ fi
+ curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT$actuator -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"debug\"}"
result=$(__do_curl "$curlString")
if [ $? -ne 0 ]; then
__print_err "could not set debug mode" $@
# (Function for test scripts)
set_agent_trace() {
echo -e $BOLD"Setting agent trace"$EBOLD
- curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT/actuator/loggers/org.oransc.policyagent -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
+ actuator="/actuator/loggers/org.oransc.policyagent"
+ if [[ $POLICY_AGENT_IMAGE = *"onap"* ]]; then
+ actuator="/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice"
+ fi
+ curlString="$LOCALHOST$POLICY_AGENT_EXTERNAL_PORT$actuator -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
result=$(__do_curl "$curlString")
if [ $? -ne 0 ]; then
__print_err "could not set trace mode" $@
done
fi
+ __check_included_image 'PRODSTUB'
+ if [ $? -eq 0 ]; then
+ docker logs $PROD_STUB_APP_NAME > $TESTLOGS/$ATC/$1_prodstub.log 2>&1
+ fi
+
echo ""
}