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="Create 1 policy with SDNC and 1 policy without SDNC over agent REST"
22 . ../common/testcase_common.sh $@
23 . ../common/agent_api_functions.sh
27 VARIANTS="NOSDNC SDNC"
29 for TEST in $VARIANTS ; do
34 start_ric_simulators ricsim_g1 1 OSC_2.1.0
35 start_ric_simulators ricsim_g2 1 STD_1.1.3
43 prepare_consul_config $TEST ".consul_config.json"
44 consul_config_app ".consul_config.json"
48 if [ $TEST == "SDNC" ]; then
63 sim_print ricsim_g1_1 interface
64 sim_print ricsim_g2_1 interface
66 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
68 api_equal json:policy_types 2 120 #Wait for the agent to refresh types from the simulator
70 api_put_service 201 "rapp1" 3600 "http://callback-receiver:8090/callbacks/1"
72 api_put_policy 201 "rapp1" ricsim_g1_1 1 2000 testdata/OSC/pi1_template.json 10
74 api_put_policy 201 "rapp1" ricsim_g2_1 NOTYPE 3000 testdata/STD/pi1_template.json 10
76 sim_equal ricsim_g1_1 num_instances 10
77 sim_equal ricsim_g2_1 num_instances 10
80 check_policy_agent_logs
81 check_control_panel_logs
86 echo -e $BOLD"Test complete for variant: "$TEST $EBOLD
91 #### TEST COMPLETE ####