3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020 Nordix Foundation. All rights reserved.
5 # ========================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=================================================
20 TC_ONELINE_DESCR="Basic use case, register service, create/update policy, delete policy, de-register service using both STD and OSC interface while mixing REST and Dmaap"
22 #App names to exclude checking pulling images for, space separated list
23 EXCLUDED_IMAGES="SDNC SDNC_ONAP"
25 . ../common/testcase_common.sh $@
26 . ../common/agent_api_functions.sh
27 . ../common/ricsimulator_api_functions.sh
31 #Local vars in test script
32 ##########################
33 # Path to callback receiver
34 CR_PATH="http://$CR_APP_NAME:$CR_EXTERNAL_PORT/callbacks"
38 start_ric_simulators ricsim_g1 3 OSC_2.1.0
40 start_ric_simulators ricsim_g2 5 STD_1.1.3
48 prepare_consul_config NOSDNC ".consul_config.json"
49 consul_config_app ".consul_config.json"
61 sim_print ricsim_g1_1 interface
63 sim_print ricsim_g2_1 interface
65 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
67 api_equal json:policy_types 2 60
73 api_put_service 201 "service1" 3600 "$CR_PATH/1"
75 api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json 1
77 sim_equal ricsim_g1_1 num_instances 1
82 api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
84 sim_equal ricsim_g1_1 num_instances 2
89 api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT testdata/STD/pi1_template.json 1
91 sim_equal ricsim_g2_1 num_instances 1
96 api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
98 sim_equal ricsim_g2_1 num_instances 2
104 api_put_service 200 "service1" 3600 "$CR_PATH/1"
106 api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT testdata/OSC/pi1_template.json 1
108 sim_equal ricsim_g1_1 num_instances 2
113 api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT testdata/OSC/pi1_template.json 1
115 sim_equal ricsim_g1_1 num_instances 2
121 api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT testdata/STD/pi1_template.json 1
123 sim_equal ricsim_g2_1 num_instances 2
128 api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT testdata/STD/pi1_template.json 1
130 sim_equal ricsim_g2_1 num_instances 2
133 api_get_policy 200 2000 testdata/OSC/pi1_template.json
134 api_get_policy 200 3000 testdata/OSC/pi1_template.json
135 api_get_policy 200 2100 testdata/STD/pi1_template.json
136 api_get_policy 200 3100 testdata/STD/pi1_template.json
141 api_delete_policy 204 2000
143 api_delete_policy 204 3000
145 api_delete_policy 204 2100
147 api_delete_policy 204 3100
149 sim_equal ricsim_g1_1 num_instances 0
150 sim_equal ricsim_g2_1 num_instances 0
152 # Check remote host access to simulator
154 sim_contains_ste ricsim_g1_1 hosts "policy-agent"
155 sim_contains_ste ricsim_g2_1 hosts "policy-agent"
157 # Check policy removal
159 api_get_policy 404 2000
160 api_get_policy 404 3000
161 api_get_policy 404 2100
162 api_get_policy 404 3100
166 api_delete_services 204 "service1"
168 api_get_services 404 "service1"
172 check_policy_agent_logs
174 #### TEST COMPLETE ####
180 auto_clean_containers