sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
if [ "$PMS_VERSION" == "V2" ]; then
+
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
+
api_equal json:rics 3 60
api_equal json:policy-types 2 120
echo "############################################"
if [ "$PMS_VERSION" == "V2" ]; then
- api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:NOTYPE:AVAILABLE"
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0:AVAILABLE"
else
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
fi
fi
api_put_policy 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
api_put_policy 200 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_put_policy 201 "serv1" ricsim_g3_1 STD_QOS_0_2_0 5200 true $notificationurl testdata/STD2/pi_qos_template.json
+ api_put_policy 200 "serv1" ricsim_g3_1 STD_QOS_0_2_0 5200 true $notificationurl testdata/STD2/pi_qos_template.json
+ fi
api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
api_put_policy 200 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policies 3
+ else
+ api_equal json:policies 2
+ fi
+
api_delete_policy 204 5000
api_delete_policy 204 5100
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_delete_policy 204 5200
+ fi
+
if [ "$PMS_VERSION" == "V2" ]; then
api_equal json:policies 0
fi
if [[ $interface = *"DMAAP"* ]]; then
- VAL=11 # Number of Agent API calls over DMAAP
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ VAL=14 # Number of Agent API calls over DMAAP
+ else
+ VAL=11 # Number of Agent API calls over DMAAP
+ fi
mr_equal requests_fetched $VAL
mr_equal responses_submitted $VAL
mr_equal responses_fetched $VAL
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
if [ "$PMS_VERSION" == "V2" ]; then
- api_equal json:policy-types 2 60
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json
+ api_equal json:policy-types 3 60
else
api_equal json:policy_types 2 60
fi
sim_equal ricsim_g2_1 num_instances 2
+if [ "$PMS_VERSION" == "V2" ]; then
+ use_agent_rest_http
+
+ api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+
+ sim_equal ricsim_g3_1 num_instances 1
+
+ use_agent_dmaap_http
+
+ api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1
+
+ sim_equal ricsim_g3_1 num_instances 2
+
+fi
#Update policies
use_agent_rest_http
sim_equal ricsim_g2_1 num_instances 2
+if [ "$PMS_VERSION" == "V2" ]; then
+ use_agent_rest_http
+
+ api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+
+ sim_equal ricsim_g3_1 num_instances 2
+
+
+ use_agent_dmaap_http
+
+ api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+
+ sim_equal ricsim_g3_1 num_instances 2
+fi
+
# Check policies
if [ "$PMS_VERSION" == "V2" ]; then
api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
+ api_get_policy 200 2200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
+ api_get_policy 200 3200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
else
api_get_policy 200 2000 testdata/OSC/pi1_template.json
api_get_policy 200 3000 testdata/OSC/pi1_template.json
api_get_policy 200 3100 testdata/STD/pi1_template.json
fi
+sim_equal ricsim_g1_1 num_instances 2
+sim_equal ricsim_g2_1 num_instances 2
+
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal ricsim_g3_1 num_instances 2
+fi
+
# Remove policies
use_agent_dmaap_http
api_delete_policy 204 2100
use_agent_rest_http
api_delete_policy 204 3100
+if [ "$PMS_VERSION" == "V2" ]; then
+ use_agent_dmaap_http
+ api_delete_policy 204 2200
+ use_agent_rest_http
+ api_delete_policy 204 3200
+fi
sim_equal ricsim_g1_1 num_instances 0
sim_equal ricsim_g2_1 num_instances 0
api_get_policy 404 2100
api_get_policy 404 3100
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy 404 2200
+ api_get_policy 404 3200
+fi
+
# Remove the service
use_agent_dmaap_http
api_delete_services 204 "service1"
sim_put_policy_type 201 ricsim_g1_1 2 testdata/OSC/sim_2.json
if [ "$PMS_VERSION" == "V2" ]; then
+ 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
+
api_equal json:rics 3 60
- api_equal json:policy-types 3 120
+ api_equal json:policy-types 5 120
api_equal json:policies 0
echo "############################################"
if [ "$PMS_VERSION" == "V2" ]; then
- api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:NOTYPE:AVAILABLE"
+ api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
else
api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
fi
api_get_ric 200 me2_ricsim_g2_1 NORIC "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ api_get_ric 200 me1_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
+
+ api_get_ric 200 me2_ricsim_g3_1 NORIC "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
+
api_get_ric 200 NOME ricsim_g1_1 "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2:AVAILABLE"
api_get_ric 200 NOME ricsim_g2_1 "ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE"
+ api_get_ric 200 NOME ricsim_g3_1 "ricsim_g3_1:me1_ricsim_g3_1,me2_ricsim_g3_1:STD_QOS_0_2_0,STD_QOS2_0.1.0:AVAILABLE"
+
api_get_ric 404 NOME test1
api_get_ric 404 test NORIC
deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
#Behaviour accepted for now
api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-agent-modified.json
+ deviation "TR9 - agent modify the type with type id - test combo $interface and $__httpx"
+ #Behaviour accepted for now
+ api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-agent-modified.json
api_get_policy_type 404 3
else
fi
-
- api_get_policy_types 200 NORIC 1 2 EMPTY
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_types 200 NORIC 1 2 EMPTY STD_QOS_0_2_0 STD_QOS2_0.1.0
+ else
+ api_get_policy_types 200 NORIC 1 2 EMPTY
+ fi
api_get_policy_types 200 ricsim_g1_1 1 2
api_get_policy_types 200 ricsim_g2_1 EMPTY
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_types 200 ricsim_g3_1 STD_QOS_0_2_0 STD_QOS2_0.1.0
+ fi
+
api_get_policy_types 404 dummy-ric
api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 true $notificationurl testdata/STD/pi1_template.json
api_put_policy 200 "service10" ricsim_g2_1 NOTYPE 5100 false $notificationurl testdata/STD/pi1_template.json
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
+ api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
+
+ api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 true $notificationurl testdata/STD2/pi_qos2_template.json
+ api_put_policy 200 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 false $notificationurl testdata/STD2/pi_qos2_template.json
+ fi
+
VAL='NOT IN EFFECT'
api_get_policy_status 200 5000 OSC "$VAL" "false"
api_get_policy_status 200 5100 STD "UNDEFINED"
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_status 200 5200 STD "UNDEFINED"
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
#api_equal json:policies 2
#Allow 3 for now
- api_equal json:policies 3
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policies 4
+ else
+ api_equal json:policies 3
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
#api_equal json:policy_ids 2
#Allow 3 for now
if [ "$PMS_VERSION" == "V2" ]; then
- api_equal json:policy-instances 3
+ api_equal json:policy-instances 4
else
api_equal json:policy_ids 3
fi
#kept until decision
#api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100
#Allow policy create with unregistered service for now
- api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000
-
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000 5200
+ else
+ api_get_policy_ids 200 NORIC NOSERVICE NOTYPE 5000 5100 2000
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
#api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000
#Allow policy create with unregistered service for now
- api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
+
+ api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
+
+ api_get_policy_ids 200 ricsim_g3_1 NOSERVICE NOTYPE 5200
+
+ api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100 5200
+ else
+ api_get_policy_ids 200 ricsim_g1_1 NOSERVICE NOTYPE 5000 2000
- api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
+ api_get_policy_ids 200 ricsim_g2_1 NOSERVICE NOTYPE 5100
- api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100
+ api_get_policy_ids 200 NORIC "service10" NOTYPE 5000 5100
+ fi
deviation "TR10 - agent allows policy creation on unregistered service (side effect of orig. problem)- test combo $interface and $__httpx"
#kept until decision
#api_get_policy_ids 200 NORIC NOSERVICE 1 5000
#Allow policy create with unregistered service for now
+
api_get_policy_ids 200 NORIC NOSERVICE 1 5000 2000
api_get_policy_ids 200 NORIC NOSERVICE 2 NOID
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_get_policy_ids 200 NORIC NOSERVICE STD_QOS2_0.1.0 5200
+ fi
+
api_get_policy_ids 200 ricsim_g2_1 NOSERVICE 1 NOID
if [ "$PMS_VERSION" == "V2" ]; then
api_get_policy 200 5100 testdata/STD/pi1_template.json "service10" ricsim_g2_1 NOTYPE false $notificationurl
- api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" 1 false $notificationurl testdata/OSC/pi1_template.json
+ api_get_policy 200 5200 testdata/STD2/pi_qos2_template.json "service10" ricsim_g3_1 NOTYPE false $notificationurl
+
+ api_get_policies 200 ricsim_g1_1 "service10" 1 5000 ricsim_g1_1 "service10" STD_QOS2_0 true $notificationurl testdata/OSC/pi1_template.json
else
api_get_policy 200 5000 testdata/OSC/pi1_template.json
api_delete_policy 204 5000
+ if [ "$PMS_VERSION" == "V2" ]; then
+
+ api_delete_policy 204 5200
+ fi
+
api_equal json:policies 1
+
if [ "$PMS_VERSION" == "V2" ]; then
api_equal json:policy-instances 1
else
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
if [ "$PMS_VERSION" == "V2" ]; then
+
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
+
api_equal json:rics 3 60
#api_equal json:policy_schemas 2 120
- api_equal json:policy-types 2 120
+ api_equal json:policy-types 3 120
api_equal json:policies 0
else
api_put_policy 201 "service10" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json
api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json
-api_equal json:policies 2
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json
+ api_equal json:policies 3
+else
+ api_equal json:policies 2
+fi
sim_equal ricsim_g1_1 num_instances 1
sim_equal ricsim_g2_1 num_instances 1
api_put_policy 201 "service10" ricsim_g1_1 1 5001 true $notificationurl testdata/OSC/pi1_template.json
api_put_policy 201 "service10" ricsim_g2_1 NOTYPE 5101 true $notificationurl testdata/STD/pi1_template.json
-api_equal json:policies 4
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_put_policy 201 "service10" ricsim_g3_1 STD_QOS2_0.1.0 5201 true $notificationurl testdata/STD2/pi_qos2_template.json
+ api_equal json:policies 6
+else
+ api_equal json:policies 4
+fi
sim_equal ricsim_g1_1 num_instances 2
sim_equal ricsim_g2_1 num_instances 2
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal ricsim_g3_1 num_instances 2
+fi
sim_post_delete_instances 200 ricsim_g1_1
sim_post_delete_instances 200 ricsim_g2_1
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_post_delete_instances 200 ricsim_g3_1
+fi
+
#Wait for recreate of non transient policy
-api_equal json:policies 2 180
+if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policies 3 180
+else
+ api_equal json:policies 2 180
+fi
sim_equal ricsim_g1_1 num_instances 1
sim_equal ricsim_g2_1 num_instances 1
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal ricsim_g3_1 num_instances 1
+fi
api_put_service 200 "service10" 10 "$CR_PATH/service10"
sim_equal ricsim_g1_1 num_instances 0
sim_equal ricsim_g2_1 num_instances 0
+if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal ricsim_g3_1 num_instances 0
+fi
api_get_service_ids 200
notificationurl=""
fi
+ sleep_wait 120
+
# Load config with reduced number of rics
consul_config_app ".consul_config_initial.json"
#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
sim_print ricsim_g1_1 interface
sim_print ricsim_g2_1 interface
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_print ricsim_g3_1 interface
+ fi
sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
if [ "$PMS_VERSION" == "V2" ]; then
- api_equal json:policy-types 2 120 #Wait for the agent to refresh types from the simulators
+ sim_put_policy_type 201 ricsim_g3_1 STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
+
+ api_equal json:policy-types 3 120 #Wait for the agent to refresh types from the simulators
else
api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulators
fi
sim_equal ricsim_g2_1 num_instances $NUM_POLICIES
+ if [ "$PMS_VERSION" == "V2" ]; then
+
+ START_ID=$(($START_ID+$NUM_POLICIES))
+
+ start_timer "Create polices in STD 2 via agent REST and $interface using "$__httpx
+ api_put_policy 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
+ print_timer "Create polices in STD via agent REST and $interface using "$__httpx
+
+ sim_equal ricsim_g3_1 num_instances $NUM_POLICIES
+ fi
+
if [ $__httpx == "HTTPS" ]; then
echo "Using secure ports towards dmaap"
use_agent_dmaap_https
sim_equal ricsim_g2_1 num_instances $((2*$NUM_POLICIES))
+ if [ "$PMS_VERSION" == "V2" ]; then
+
+ START_ID=$(($START_ID+$NUM_POLICIES))
+
+ start_timer "Create polices in STD 2 via agent DMAAP, one by one, and $interface using "$__httpx
+ api_put_policy 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
+ print_timer "Create polices in STD via agent DMAAP, one by one, and $interface using "$__httpx
+
+ sim_equal ricsim_g3_1 num_instances $((2*$NUM_POLICIES))
+ fi
+
START_ID=$(($START_ID+$NUM_POLICIES))
start_timer "Create polices in OSC via agent DMAAP in batch and $interface using "$__httpx
sim_equal ricsim_g2_1 num_instances $((3*$NUM_POLICIES))
+ if [ "$PMS_VERSION" == "V2" ]; then
+
+ START_ID=$(($START_ID+$NUM_POLICIES))
+
+ start_timer "Create polices in STD via agent DMAAP in batch and $interface using "$__httpx
+ api_put_policy_batch 201 "serv1" ricsim_g3_1 STD_QOS2_0.1.0 $START_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_POLICIES
+ print_timer "Create polices in STD via agent DMAAP in batch and $interface using "$__httpx
+
+ sim_equal ricsim_g3_1 num_instances $((3*$NUM_POLICIES))
+ fi
+
if [ $interface == "SDNC" ]; then
sim_contains_str ricsim_g1_1 remote_hosts "a1-controller"
sim_contains_str ricsim_g2_1 remote_hosts "a1-controller"
# Number of RICs per interface type (OSC and STD)
NUM_RICS=30
+if [ "$PMS_VERSION" == "V2" ]; then
+ NUM_RICS=20 # 3 A1 interfaces test, less sims per interface. total sims will be same
+fi
+
# Number of policy instances per RIC
NUM_INSTANCES=5
start_ric_simulators ricsim_g2 $NUM_RICS STD_1.1.3
+if [ "$PMS_VERSION" == "V2" ]; then
+ start_ric_simulators ricsim_g3 $NUM_RICS STD_2.0.0
+fi
+
start_mr
start_cr
sim_print ricsim_g2_$i interface
done
+if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Print the interface for group 2 simulators, shall be STD 2"
+ for ((i=1; i<=$NUM_RICS; i++))
+ do
+ sim_print ricsim_g3_$i interface
+ done
+fi
+
echo "Load policy type in group 1 simulators"
for ((i=1; i<=$NUM_RICS; i++))
do
sim_put_policy_type 201 ricsim_g1_$i 1 testdata/OSC/sim_1.json
done
+if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Load policy type in group 3 simulators"
+ for ((i=1; i<=$NUM_RICS; i++))
+ do
+ sim_put_policy_type 201 ricsim_g3_$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
+ done
+fi
+
echo "Check the number of instances in group 1 simulators, shall be 0"
for ((i=1; i<=$NUM_RICS; i++))
do
sim_equal ricsim_g2_$i num_instances 0
done
+if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Check the number of instances in group 3 simulators, shall be 0"
+ for ((i=1; i<=$NUM_RICS; i++))
+ do
+ sim_equal ricsim_g3_$i num_instances 0
+ done
+fi
+
echo "Wait for the agent to refresh types from the simulator"
if [ "$PMS_VERSION" == "V2" ]; then
- api_equal json:policy-types 2 120
+ api_equal json:policy-types 3 120
else
api_equal json:policy_types 2 120
fi
do
if [ "$PMS_VERSION" == "V2" ]; then
api_equal json:policy-types?ric_id=ricsim_g1_$i 1 120
+ api_equal json:policy-types?ric_id=ricsim_g3_$i 1 120
else
api_equal json:policy_types?ric=ricsim_g1_$i 1 120
fi
api_equal json:policy_ids $INSTANCES
fi
+ if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Create $NUM_INSTANCES instances in each STD 2 RIC"
+ if [ $interface == "REST_PARALLEL" ]; then
+ api_put_policy_parallel 201 "serv1" ricsim_g3_ $NUM_RICS STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES 3
+ fi
+ for ((i=1; i<=$NUM_RICS; i++))
+ do
+ if [ $interface == "DMAAP-BATCH" ]; then
+ api_put_policy_batch 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES
+ elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
+ api_put_policy 201 "serv1" ricsim_g3_$i STD_QOS2_0.1.0 $INSTANCE_ID NOTRANSIENT $notificationurl testdata/STD2/pi_qos2_template.json $NUM_INSTANCES
+ fi
+ if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
+ MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
+ fi
+ sim_equal ricsim_g3_$i num_instances $NUM_INSTANCES
+ INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
+ INSTANCES=$(($INSTANCES+$NUM_INSTANCES))
+ done
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
+ fi
+
echo "Delete all instances in each OSC RIC"
api_equal json:policy_ids $INSTANCES
fi
+ if [ "$PMS_VERSION" == "V2" ]; then
+ echo "Delete all instances in each STD 2 RIC"
+
+ if [ $interface == "REST_PARALLEL" ]; then
+ api_delete_policy_parallel 204 $NUM_RICS $INSTANCE_ID $NUM_INSTANCES 3
+ fi
+ for ((i=1; i<=$NUM_RICS; i++))
+ do
+ if [ $interface == "DMAAP-BATCH" ]; then
+ api_delete_policy_batch 204 $INSTANCE_ID $NUM_INSTANCES
+ elif [ $interface == "DMAAP" ] || [ $interface == "REST" ]; then
+ api_delete_policy 204 $INSTANCE_ID $NUM_INSTANCES
+ fi
+ if [ $interface == "DMAAP" ] || [ $interface == "DMAAP-BATCH" ]; then
+ MR_MESSAGES=$(($MR_MESSAGES+$NUM_INSTANCES))
+ fi
+ INSTANCES=$(($INSTANCES-$NUM_INSTANCES))
+ sim_equal ricsim_g3_$i num_instances 0
+ INSTANCE_ID=$(($INSTANCE_ID+$NUM_INSTANCES))
+ done
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ api_equal json:policy-instances $INSTANCES
+ else
+ api_equal json:policy_ids $INSTANCES
+ fi
+ fi
+
mr_equal requests_submitted $MR_MESSAGES
mr_equal requests_fetched $MR_MESSAGES
mr_equal responses_submitted $MR_MESSAGES
do
sim_contains_str ricsim_g1_$i remote_hosts "a1-controller"
sim_contains_str ricsim_g2_$i remote_hosts "a1-controller"
+
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_contains_str ricsim_g3_$i remote_hosts "a1-controller"
+ fi
done
done
sim_print $RIC_SIM_PREFIX"_g2_"$i interface
done
+if [ "$PMS_VERSION" == "V2" ]; then
+ # Print the A1 version for STD 2.X
+ for ((i=1; i<=$STD_NUM_RICS; i++))
+ do
+ sim_print $RIC_SIM_PREFIX"_g3_"$i interface
+ done
+fi
# Load the polictypes in osc
for ((i=1; i<=$OSC_NUM_RICS; i++))
done
fi
+if [ "$PMS_VERSION" == "V2" ]; then
+
+ # Load the polictypes in std
+ for ((i=1; i<=$STD_NUM_RICS; i++))
+ do
+ sim_put_policy_type 201 $RIC_SIM_PREFIX"_g3_"$i STD_QOS_0_2_0 demo-testdata/STD2/sim_qos.json
+ sim_put_policy_type 201 $RIC_SIM_PREFIX"_g3_"$i STD_QOS2_0.1.0 demo-testdata/STD2/sim_qos2.json
+ done
+
+ #Check the number of schemas and the individual schemas in STD
+ api_equal json:policy-types 6 120
+
+ for ((i=1; i<=$STD_NUM_RICS; i++))
+ do
+ api_equal json:policy-types?ric_id=$RIC_SIM_PREFIX"_g3_"$i 2 120
+ done
+
+ # Check the schemas in STD
+ for ((i=1; i<=$STD_NUM_RICS; i++))
+ do
+ api_get_policy_type 200 STD_QOS_0_2_0 demo-testdata/STD2/qos-agent-modified.json
+ api_get_policy_type 200 'STD_QOS2_0.1.0' demo-testdata/STD2/qos2-agent-modified.json
+ done
+fi
+
# Create policies
use_agent_rest_http
do
generate_uuid
api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g2_"$i NOTYPE $((2100+$i)) NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
+ if [ "$PMS_VERSION" == "V2" ]; then
+ generate_uuid
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i STD_QOS_0_2_0 $((2300+$i)) NOTRANSIENT $notificationurl demo-testdata/STD2/pi1_template.json 1
+ generate_uuid
+ api_put_policy 201 "Emergency-response-app" $RIC_SIM_PREFIX"_g3_"$i 'STD_QOS2_0.1.0' $((2400+$i)) NOTRANSIENT $notificationurl demo-testdata/STD2/pi1_template.json 1
+ fi
done
for ((i=1; i<=$STD_NUM_RICS; i++))
do
sim_equal $RIC_SIM_PREFIX"_g2_"$i num_instances 1
+ if [ "$PMS_VERSION" == "V2" ]; then
+ sim_equal $RIC_SIM_PREFIX"_g3_"$i num_instances 2
+ fi
done
check_policy_agent_logs
done
fi
-#Check the number of schemas and the individual schemas in OSC
+#Check the number of types
if [ "$PMS_VERSION" == "V2" ]; then
api_equal json:policy-types 5 120
else
--- /dev/null
+{
+ "scope": {
+ "qosId": "qosXXX"
+ },
+ "qosObjectives": {
+ "priorityLevel": XXX
+ }
+}
\ No newline at end of file
--- /dev/null
+{
+ "scope": {
+ "ueId": "ueXXX",
+ "qosId": "qosXXX"
+ },
+ "qosObjectives": {
+ "priorityLevel": XXX
+ }
+}
\ No newline at end of file
--- /dev/null
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "description": "STD QOS policy type",
+ "title": "STD_QOS_0_2_0",
+ "type": "object",
+ "properties": {
+ "qosObjectives": {
+ "additionalProperties": false,
+ "type": "object",
+ "properties": {
+ "priorityLevel": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "priorityLevel"
+ ]
+ },
+ "scope": {
+ "additionalProperties": false,
+ "type": "object",
+ "properties": {
+ "qosId": {
+ "type": "string"
+ },
+ "ueId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ueId",
+ "qosId"
+ ]
+ }
+ }
+ }
\ No newline at end of file
--- /dev/null
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "description": "STD QOS2 policy type",
+ "title": "STD_QOS2_0.1.0",
+ "type": "object",
+ "properties": {
+ "qosObjectives": {
+ "additionalProperties": false,
+ "type": "object",
+ "properties": {
+ "priorityLevel": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "priorityLevel"
+ ]
+ },
+ "scope": {
+ "additionalProperties": false,
+ "type": "object",
+ "properties": {
+ "qosId": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "qosId"
+ ]
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+{
+ "policySchema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_QOS_0_2_0",
+ "description": "STD QOS policy type",
+ "type": "object",
+ "properties": {
+ "scope": {
+ "type": "object",
+ "properties": {
+ "ueId": {
+ "type": "string"
+ },
+ "qosId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "ueId",
+ "qosId"
+ ]
+ },
+ "qosObjectives": {
+ "type": "object",
+ "properties": {
+ "priorityLevel": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "priorityLevel"
+ ]
+ }
+ }
+ },
+ "statusSchema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_QOS_0.2.0",
+ "description": "STD QOS policy type status",
+ "type": "object",
+ "properties": {
+ "enforceStatus": {
+ "type": "string"
+ },
+ "enforceReason": {
+ "type": "string"
+ },
+ "additionalProperties": false,
+ "required": [
+ "enforceStatus"
+ ]
+ }
+ }
+ }
\ No newline at end of file
--- /dev/null
+{
+ "policySchema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_QOS2_0.1.0",
+ "description": "STD QOS2 policy type",
+ "type": "object",
+ "properties": {
+ "scope": {
+ "type": "object",
+ "properties": {
+ "qosId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "qosId"
+ ]
+ },
+ "qosObjectives": {
+ "type": "object",
+ "properties": {
+ "priorityLevel": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "priorityLevel"
+ ]
+ }
+ }
+ },
+ "statusSchema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_QOS_0.2.0",
+ "description": "STD QOS policy type status",
+ "type": "object",
+ "properties": {
+ "enforceStatus": {
+ "type": "string"
+ },
+ "enforceReason": {
+ "type": "string"
+ },
+ "additionalProperties": false,
+ "required": [
+ "enforceStatus"
+ ]
+ }
+ }
+ }
\ No newline at end of file
--- /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=================================================
+#
+
+. ../common/api_curl.sh
+
+### Admin API functions for the Callback Reciver
+
+
+# Excute a curl cmd towards a Callback Reciver admin interface and check the response code.
+# args: <expected-response-code> <curl-cmd-string>
+__execute_curl_to_cr() {
+ echo ${FUNCNAME[1]} "line: "${BASH_LINENO[1]} >> $HTTPLOG
+ echo " CMD: $2" >> $HTTPLOG
+ res="$($2)"
+ echo " RESP: $res" >> $HTTPLOG
+ retcode=$?
+ if [ $retcode -ne 0 ]; then
+ ((RES_CONF_FAIL++))
+ echo " RETCODE: "$retcode
+ echo -e $RED" FAIL - fatal error when executing curl."$ERED
+ return 1
+ fi
+ status=${res:${#res}-3}
+ if [ $status -eq $1 ]; then
+ echo -e $GREEN" OK"$EGREEN
+ return 0
+ fi
+ echo -e $RED" FAIL - expected http response: "$1" but got http response: "$status $ERED
+ ((RES_CONF_FAIL++))
+ return 1
+}
+
+# Tests if a variable value in the CR is equal to a target value and and optional timeout.
+# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
+# equal to the target or not.
+# Arg: <variable-name> <target-value> <timeout-in-sec> - This test waits up to the timeout seconds
+# before setting pass or fail depending on if the variable value becomes equal to the target
+# value or not.
+# (Function for test scripts)
+cr_equal() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test "CR" "$LOCALHOST$CR_EXTERNAL_PORT/counter/" $1 "=" $2 $3
+ else
+ ((RES_CONF_FAIL++))
+ __print_err "Wrong args to cr_equal, needs two or three args: <sim-param> <target-value> [ timeout ]" $@
+ fi
+}
+
+# CR API: Check the contents of all current ric sync events from PMS
+# <response-code> <id> [ EMPTY | ( <ric-id> )+ ]
+# (Function for test scripts)
+cr_api_check_all_sync_events() {
+ echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD
+ echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG
+ ((RES_TEST++))
+
+ if [ "$PMS_VERSION" != "V2" ]; then
+ echo -e $RED" FAIL, function not supported"$ERED
+ ((RES_FAIL++))
+ __check_stop_at_error
+ return 1
+ fi
+
+ if [ $# -lt 2 ]; then
+ __print_err "<response-code> <id> [ EMPTY | ( <ric-id> )+ ]" $@
+ return 1
+ fi
+
+ query="/get-all-events/"$2
+ res="$(__do_curl_to_api CR GET $query)"
+ status=${res:${#res}-3}
+
+ if [ $status -ne $1 ]; then
+ echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
+ ((RES_FAIL++))
+ __check_stop_at_error
+ return 1
+ fi
+
+ if [ $# -gt 2 ]; then
+ body=${res:0:${#res}-3}
+ if [ $# -eq 3 ] && [ $3 == "EMPTY" ]; then
+ targetJson="["
+ else
+ targetJson="["
+ arr=(${@:3})
+
+ for ((i=0; i<$(($#-2)); i=i+1)); do
+
+ if [ "$targetJson" != "[" ]; then
+ targetJson=$targetJson","
+ fi
+ targetJson=$targetJson"{\"ric_id\":\"${arr[$i]}\",\"event_type\":\"AVAILABLE\"}"
+ done
+ fi
+
+ targetJson=$targetJson"]"
+ echo "TARGET JSON: $targetJson" >> $HTTPLOG
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
+
+ if [ $res -ne 0 ]; then
+ echo -e $RED" FAIL, returned body not correct"$ERED
+ ((RES_FAIL++))
+ __check_stop_at_error
+ return 1
+ fi
+ fi
+ ((RES_PASS++))
+ echo -e $GREEN" PASS"$EGREEN
+ return 0
+}
\ No newline at end of file
echo -e $RED" Build Failed"$ERED
((RES_CONF_FAIL++))
cat .dockererr
+ echo -e $RED"Exiting...."$ERED
+ exit 1
fi
cd $curdir
else
echo -e $RED" Build Failed"$ERED
((RES_CONF_FAIL++))
cat .dockererr
+ echo -e $RED"Exiting...."$ERED
+ exit 1
fi
cd $curdir
else
echo -e $RED" Build Failed"$ERED
((RES_CONF_FAIL++))
cat .dockererr
+ echo -e $RED"Exiting...."$ERED
+ exit 1
fi
cd $curdir
else
echo "-------------------------------------------------------------------------------------------------"
echo "-- Description: "$TC_ONELINE_DESCR
echo "-- Execution time: " $duration " seconds"
+ echo "-- Used env file: "$TEST_ENV_VAR_FILE
echo "-------------------------------------------------------------------------------------------------"
echo "------------------------------------- RESULTS"
echo ""
start_ecs() {
echo -e $BOLD"Starting ECS"$EBOLD
+
+ curdir=$PWD
+ cd $SIM_GROUP
+ cd ecs
+ cd $ECS_HOST_MNT_DIR
+ if [ -d database ]; then
+ echo -e $BOLD" Cleaning files in mounted dir: $PWD/database"$EBOLD
+ rm database/* > /dev/null
+ if [ $? -ne 0 ]; then
+ echo -e $RED" Cannot remove database files in: $PWD"$ERED
+ exit 1
+ fi
+ else
+ echo " No files in mounted dir or dir does not exists"
+ fi
+ cd $curdir
+
__check_included_image 'ECS'
if [ $? -eq 1 ]; then
echo -e $RED"The ECS image has not been checked for this test run due to arg to the test script"$ERED