+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+
+ if [ "$A1PMS_VERSION" == "V3" ]; then
+ a1pms_api_put_policy_v3 200 3000 testdata/OSC/pi1_template.json 1
+ else
+ a1pms_api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1
+ fi
+
+ sim_equal ricsim_g1_1 num_instances 2
+
+
+ use_a1pms_rest_http
+
+ if [ "$A1PMS_VERSION" == "V3" ]; then
+ a1pms_api_put_policy_v3 200 2100 testdata/STD/pi1_template.json 1
+ else
+ a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
+ fi
+
+ sim_equal ricsim_g2_1 num_instances 2
+
+
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+
+ if [ "$A1PMS_VERSION" == "V3" ]; then
+ a1pms_api_put_policy_v3 200 3100 testdata/STD/pi1_template.json 1
+ else
+ a1pms_api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1
+ fi
+
+ sim_equal ricsim_g2_1 num_instances 2
+
+ use_a1pms_rest_http
+
+ if [ "$A1PMS_VERSION" == "V3" ]; then
+ a1pms_api_put_policy_v3 200 2200 testdata/STD2/pi_qos_template.json 1
+ else
+ a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+ fi
+
+ sim_equal ricsim_g3_1 num_instances 2
+
+
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+
+ if [ "$A1PMS_VERSION" == "V3" ]; then
+ a1pms_api_put_policy_v3 200 3200 testdata/STD2/pi_qos_template.json 1
+ else
+ a1pms_api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 true $notificationurl testdata/STD2/pi_qos_template.json 1
+ fi
+
+ sim_equal ricsim_g3_1 num_instances 2
+
+ if [ "$A1PMS_VERSION" != "V3" ]; then
+ # Check policies
+ a1pms_api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
+ a1pms_api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl
+ a1pms_api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
+ a1pms_api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl
+ a1pms_api_get_policy 200 2200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
+ a1pms_api_get_policy 200 3200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl
+ fi
+
+ sim_equal ricsim_g1_1 num_instances 2
+ sim_equal ricsim_g2_1 num_instances 2
+
+ sim_equal ricsim_g3_1 num_instances 2
+
+ # Remove policies
+
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+ a1pms_api_delete_policy 204 2000
+ use_a1pms_rest_http
+ a1pms_api_delete_policy 204 3000
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+ a1pms_api_delete_policy 204 2100
+ use_a1pms_rest_http
+ a1pms_api_delete_policy 204 3100
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+ a1pms_api_delete_policy 204 2200
+ use_a1pms_rest_http
+ a1pms_api_delete_policy 204 3200
+
+ sim_equal ricsim_g1_1 num_instances 0
+ sim_equal ricsim_g2_1 num_instances 0
+
+ sim_equal ricsim_g3_1 num_instances 0
+
+ # Check remote host access to simulator
+
+ sim_contains_str ricsim_g1_1 remote_hosts $A1PMS_APP_NAME
+ sim_contains_str ricsim_g2_1 remote_hosts $A1PMS_APP_NAME
+ sim_contains_str ricsim_g3_1 remote_hosts $A1PMS_APP_NAME
+
+ # Check policy removal
+ use_a1pms_rest_http
+ a1pms_api_get_policy 404 2000
+ a1pms_api_get_policy 404 3000
+ a1pms_api_get_policy 404 2100
+ a1pms_api_get_policy 404 3100
+
+ a1pms_api_get_policy 404 2200
+ a1pms_api_get_policy 404 3200
+
+ # Remove the service
+ if [[ "$A1PMS_FEATURE_LEVEL" == *"NO-DMAAP"* ]]; then
+ use_a1pms_rest_http
+ else
+ use_a1pms_dmaap_http
+ fi
+ a1pms_api_delete_services 204 "service1"
+
+ a1pms_api_get_services 404 "service1"
+
+ check_a1pms_logs
+done
+ #### TEST COMPLETE ####