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="Testing of the health check app"
22 #App names to exclude checking pulling images for, space separated list
23 EXCLUDED_IMAGES="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 6 OSC_2.1.0
40 start_ric_simulators ricsim_g2 5 STD_1.1.3
46 prepare_consul_config NOSDNC ".consul_config.json"
47 consul_config_app ".consul_config.json"
57 sim_print ricsim_g1_1 interface
58 sim_print ricsim_g1_2 interface
59 sim_print ricsim_g1_3 interface
60 sim_print ricsim_g1_4 interface
61 sim_print ricsim_g1_5 interface
62 sim_print ricsim_g1_6 interface
64 sim_print ricsim_g2_1 interface
65 sim_print ricsim_g2_2 interface
66 sim_print ricsim_g2_3 interface
67 sim_print ricsim_g2_4 interface
68 sim_print ricsim_g2_5 interface
70 sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json
71 sim_put_policy_type 201 ricsim_g1_2 1 testdata/OSC/sim_1.json
72 sim_put_policy_type 201 ricsim_g1_3 1 testdata/OSC/sim_1.json
73 sim_put_policy_type 201 ricsim_g1_4 1 testdata/OSC/sim_1.json
74 sim_put_policy_type 201 ricsim_g1_5 1 testdata/OSC/sim_1.json
75 sim_put_policy_type 201 ricsim_g1_6 1 testdata/OSC/sim_1.json
77 api_equal json:policy_types 2 120
79 sleep_wait 30 "Give the agent some extra time...."
84 api_put_service 201 "rapp1" 3600 "$CR_PATH/1"
86 api_put_policy 201 "rapp1" ricsim_g1_1 1 2010 NOTRANSIENT testdata/OSC/pi1_template.json 1
87 api_put_policy 201 "rapp1" ricsim_g1_2 1 2020 NOTRANSIENT testdata/OSC/pi1_template.json 1
88 api_put_policy 201 "rapp1" ricsim_g1_3 1 2030 NOTRANSIENT testdata/OSC/pi1_template.json 1
89 api_put_policy 201 "rapp1" ricsim_g1_4 1 2040 NOTRANSIENT testdata/OSC/pi1_template.json 1
90 api_put_policy 201 "rapp1" ricsim_g1_5 1 2050 NOTRANSIENT testdata/OSC/pi1_template.json 1
91 api_put_policy 201 "rapp1" ricsim_g1_6 1 2060 NOTRANSIENT testdata/OSC/pi1_template.json 1
93 sim_equal ricsim_g1_1 num_instances 1
94 sim_equal ricsim_g1_2 num_instances 1
95 sim_equal ricsim_g1_3 num_instances 1
96 sim_equal ricsim_g1_4 num_instances 1
97 sim_equal ricsim_g1_5 num_instances 1
98 sim_equal ricsim_g1_6 num_instances 1
100 api_put_policy 201 "rapp1" ricsim_g2_1 NOTYPE 2110 NOTRANSIENT testdata/STD/pi1_template.json 1
101 api_put_policy 201 "rapp1" ricsim_g2_2 NOTYPE 2120 NOTRANSIENT testdata/STD/pi1_template.json 1
102 api_put_policy 201 "rapp1" ricsim_g2_3 NOTYPE 2130 NOTRANSIENT testdata/STD/pi1_template.json 1
103 api_put_policy 201 "rapp1" ricsim_g2_4 NOTYPE 2140 NOTRANSIENT testdata/STD/pi1_template.json 1
104 api_put_policy 201 "rapp1" ricsim_g2_5 NOTYPE 2150 NOTRANSIENT testdata/STD/pi1_template.json 1
106 sim_equal ricsim_g2_1 num_instances 1
107 sim_equal ricsim_g2_2 num_instances 1
108 sim_equal ricsim_g2_3 num_instances 1
109 sim_equal ricsim_g2_4 num_instances 1
110 sim_equal ricsim_g2_5 num_instances 1
113 check_policy_agent_logs
115 #### TEST COMPLETE ####