+#Test agent and simulator protocol versions (others are http only)
+TESTED_PROTOCOLS="HTTP HTTPS"
+
+for __httpx in $TESTED_PROTOCOLS ; do
+ for interface in $TESTED_VARIANTS ; do
+
+ echo "#####################################################################"
+ echo "#####################################################################"
+ echo "### Testing agent: $interface using $__httpx"
+ echo "#####################################################################"
+ echo "#####################################################################"
+
+ # Clean container and start all needed containers #
+ clean_environment
+
+ start_kube_proxy
+
+ if [ $__httpx == "HTTPS" ]; then
+ use_cr_https
+ use_agent_rest_https
+ else
+ use_agent_rest_http
+ use_cr_http
+ fi
+
+ start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE
+
+ set_agent_debug
+
+ # Create service to be able to receive events when rics becomes available
+ # Must use rest towards the agent since dmaap is not configured yet
+ api_put_service 201 "ric-registration" 0 "$CR_SERVICE_APP_PATH_0/ric-registration"
+
+
+ if [ $__httpx == "HTTPS" ]; then
+ use_simulator_https
+ use_mr_https
+ if [[ $interface = *"SDNC"* ]]; then
+ use_sdnc_https
+ fi
+ if [[ $interface = *"DMAAP"* ]]; then
+ use_agent_dmaap_https
+ else
+ use_agent_rest_https
+ fi
+ else
+ use_simulator_http
+ use_mr_http
+ if [[ $interface = *"SDNC"* ]]; then
+ use_sdnc_http
+ fi
+ if [[ $interface = *"DMAAP"* ]]; then
+ use_agent_dmaap_http
+ else
+ use_agent_rest_http
+ fi
+ fi
+
+ start_ric_simulators ricsim_g1 1 OSC_2.1.0
+ start_ric_simulators ricsim_g2 1 STD_1.1.3
+
+ sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
+ sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 1 STD_2.0.0
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
+ fi
+
+ start_mr
+
+ start_cr 1
+
+ start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
+
+ if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
+ start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
+ fi
+
+ if [[ $interface = *"SDNC"* ]]; then
+ start_sdnc
+ prepare_consul_config SDNC ".consul_config.json"
+ else
+ prepare_consul_config NOSDNC ".consul_config.json"
+ fi
+
+ if [ $RUNMODE == "KUBE" ]; then
+ agent_load_config ".consul_config.json"
+ else
+ if [[ "$PMS_FEATURE_LEVEL" == *"NOCONSUL"* ]]; then
+ #Temporary switch to http/https if dmaap use. Otherwise it is not possibble to push config
+ if [ $__httpx == "HTTPS" ]; then
+ use_agent_rest_https
+ else
+ use_agent_rest_http
+ fi
+
+ if [[ $interface != *"DMAAP"* ]]; then
+ echo "{}" > ".consul_config_incorrect.json"
+ api_put_configuration 400 ".consul_config_incorrect.json"
+ fi
+
+ api_put_configuration 200 ".consul_config.json"
+ api_get_configuration 200 ".consul_config.json"
+ if [ $__httpx == "HTTPS" ]; then
+ if [[ $interface = *"DMAAP"* ]]; then
+ use_agent_dmaap_https
+ else
+ use_agent_rest_https
+ fi
+ else
+ if [[ $interface = *"DMAAP"* ]]; then
+ use_agent_dmaap_http
+ else
+ use_agent_rest_http
+ fi
+ fi
+
+ else
+ start_consul_cbs
+ consul_config_app ".consul_config.json"
+ fi
+ fi
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:rics 3 300
+
+ api_equal json:policy-types 5 120
+
+ api_equal json:policies 0
+
+ api_equal json:policy-instances 0
+ else
+ api_equal json:rics 2 300
+
+ api_equal json:policy_schemas 3 120
+
+ api_equal json:policy_types 3
+
+ api_equal json:policies 0
+
+ api_equal json:policy_ids 0
+ fi
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ cr_equal 0 received_callbacks 3 120
+ cr_api_check_all_sync_events 200 0 ric-registration ricsim_g1_1 ricsim_g2_1 ricsim_g3_1
+ fi
+ mr_equal requests_submitted 0