BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 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 |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 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================================================= |
| 18 | # |
| 19 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 20 | TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm chats - all components - E-RELEASE" |
| 21 | # This script requires the helm charts for nonrtric, a1simulator and a1controller are installed |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 22 | # There should be 2 simulator of each A1 interface version started |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 23 | |
| 24 | #App names to include in the test when running docker, space separated list |
| 25 | DOCKER_INCLUDED_IMAGES="" # Not used - KUBE only test script |
| 26 | |
| 27 | #App names to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 28 | KUBE_INCLUDED_IMAGES=" MR DMAAPMR CR PRODSTUB KUBEPROXY KAFKAPC" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 29 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 30 | KUBE_PRESTARTED_IMAGES=" A1PMS RICSIM CP ICS RC SDNC DMAAPMED DMAAPADP" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 31 | |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 32 | #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if |
| 33 | #the image is not configured in the supplied env_file |
| 34 | #Used for images not applicable to all supported profile |
| 35 | CONDITIONALLY_IGNORED_IMAGES="" |
| 36 | |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 37 | #Supported test environment profiles |
| 38 | SUPPORTED_PROFILES="ORAN-E-RELEASE" |
| 39 | #Supported run modes |
| 40 | SUPPORTED_RUNMODES="KUBE" |
| 41 | |
| 42 | . ../common/testcase_common.sh $@ |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 43 | |
| 44 | setup_testenvironment |
| 45 | |
| 46 | #### TEST BEGIN #### |
| 47 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 48 | use_mr_https |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 49 | use_cr_https |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 50 | use_a1pms_rest_https |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 51 | use_sdnc_https |
| 52 | use_simulator_https |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 53 | use_ics_rest_https |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 54 | use_prod_stub_https |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 55 | use_dmaapmed_https |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 56 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 57 | if [ $ICS_VERSION == "V1-1" ]; then |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 58 | use_rapp_catalogue_http # https not yet supported |
| 59 | else |
| 60 | ########################################use_rapp_catalogue_https |
| 61 | use_rapp_catalogue_http |
| 62 | fi |
| 63 | |
| 64 | echo -e "$RED CHECK WHY RC HTTPS DOES NOT WORK $ERED" |
| 65 | |
| 66 | ###############################use_control_panel_https |
| 67 | use_control_panel_http |
| 68 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 69 | if [ "$A1PMS_VERSION" == "V1" ]; then |
| 70 | echo "A1PMS VERSION 2 (V2) is required" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 71 | exit 1 |
| 72 | fi |
| 73 | |
| 74 | clean_environment |
| 75 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 76 | ics_kube_pvc_reset |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 77 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 78 | a1pms_kube_pvc_reset |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 79 | |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 80 | start_kube_proxy |
| 81 | |
| 82 | STD_NUM_RICS=2 |
| 83 | OSC_NUM_RICS=2 |
| 84 | |
| 85 | start_ric_simulators a1-sim-osc $STD_NUM_RICS OSC_2.1.0 |
| 86 | echo " RIC MAPPING a1-sim-osc-0 : ric1" |
| 87 | echo " RIC MAPPING a1-sim-osc-1 : ric2" |
| 88 | |
| 89 | start_ric_simulators a1-sim-std $STD_NUM_RICS STD_1.1.3 |
| 90 | echo " RIC MAPPING a1-sim-std-0 : ric3" |
| 91 | echo " RIC MAPPING a1-sim-std-1 : ric4" |
| 92 | |
| 93 | start_ric_simulators a1-sim-std2 $STD_NUM_RICS STD_2.0.0 |
| 94 | echo " RIC MAPPING a1-sim-std2-0 : ric5" |
| 95 | echo " RIC MAPPING a1-sim-std2-1 : ric6" |
| 96 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 97 | start_mr "$MR_READ_TOPIC" "/events" "users/policy-agent" \ |
| 98 | "$MR_WRITE_TOPIC" "/events" "users/mr-stub" \ |
| 99 | "unauthenticated.dmaapmed.json" "/events" "dmaapmediatorproducer/STD_Fault_Messages" \ |
| 100 | "unauthenticated.dmaapadp.json" "/events" "dmaapadapterproducer/msgs" |
| 101 | |
| 102 | start_kafkapc |
| 103 | |
| 104 | kafkapc_api_create_topic 201 "unauthenticated.dmaapadp_kafka.text" "text/plain" |
| 105 | |
| 106 | kafkapc_api_start_sending 200 "unauthenticated.dmaapadp_kafka.text" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 107 | |
| 108 | start_control_panel |
| 109 | |
| 110 | start_sdnc |
| 111 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 112 | start_a1pms |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 113 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 114 | start_cr 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 115 | |
| 116 | start_prod_stub |
| 117 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 118 | start_ics NOPROXY |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 119 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 120 | set_ics_trace |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 121 | |
| 122 | start_rapp_catalogue |
| 123 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 124 | set_a1pms_trace |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 125 | |
| 126 | #### Test RAPP Catalogue #### |
| 127 | |
| 128 | rapp_cat_api_get_services 200 EMPTY |
| 129 | |
| 130 | rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app" |
| 131 | |
| 132 | rapp_cat_api_get_services 200 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app" |
| 133 | |
| 134 | #Check the number of services |
| 135 | rc_equal json:services 1 |
| 136 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 137 | a1_a1pms_api_get_status 200 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 138 | |
| 139 | #### Test Policy Management Service #### |
| 140 | |
| 141 | # Print the A1 version for STD 1.1.X |
| 142 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 143 | do |
| 144 | sim_print "a1-sim-std-"$i interface |
| 145 | done |
| 146 | |
| 147 | # Print the A1 version for STD 2.0.X |
| 148 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 149 | do |
| 150 | sim_print "a1-sim-std2-"$i interface |
| 151 | done |
| 152 | |
| 153 | # Print the A1 version for OSC 2.1.X |
| 154 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 155 | do |
| 156 | sim_print "a1-sim-osc-"$i interface |
| 157 | done |
| 158 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 159 | # Check the number of policies in STD and STD2 |
| 160 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 161 | do |
| 162 | sim_equal "a1-sim-std-"$i num_instances 0 |
| 163 | sim_equal "a1-sim-std2-"$i num_instances 0 |
| 164 | done |
| 165 | |
| 166 | # Check the number of policies in OSC |
| 167 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 168 | do |
| 169 | sim_equal "a1-sim-osc-"$i num_instances 0 |
| 170 | done |
| 171 | |
| 172 | #Check the number of schemas |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 173 | a1pms_equal json:policy-types 1 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 174 | |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 175 | # Load the polictypes in STD 2 |
| 176 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 177 | do |
| 178 | sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS_0_2_0 testdata/STD2/sim_qos.json |
| 179 | sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json |
| 180 | done |
| 181 | |
| 182 | # Load the polictypes in OSC |
| 183 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 184 | do |
| 185 | sim_put_policy_type 201 "a1-sim-osc-"$i 1 testdata/OSC/sim_1.json |
| 186 | sim_put_policy_type 201 "a1-sim-osc-"$i 2 testdata/OSC/sim_2.json |
| 187 | done |
| 188 | |
| 189 | # Check that all rics are synced in |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 190 | a1pms_equal json:rics 6 300 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 191 | |
| 192 | #Check the number of schemas and the individual schemas |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 193 | a1pms_equal json:policy-types 5 300 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 194 | |
| 195 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 196 | do |
| 197 | ricid=$((3+$i)) |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 198 | a1pms_equal json:policy-types?ric_id=ric$ricid 1 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 199 | done |
| 200 | |
| 201 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 202 | do |
| 203 | ricid=$((5+$i)) |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 204 | a1pms_equal json:policy-types?ric_id=ric$ricid 2 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 205 | done |
| 206 | |
| 207 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 208 | do |
| 209 | ricid=$((1+$i)) |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 210 | a1pms_equal json:policy-types?ric_id=ric$ricid 2 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 211 | done |
| 212 | |
| 213 | #Check the schemas in STD 2 |
| 214 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 215 | do |
| 216 | ricid=$((5+$i)) |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 217 | a1_a1pms_api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-a1pms-modified.json |
| 218 | a1_a1pms_api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-a1pms-modified.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 219 | done |
| 220 | |
| 221 | # Check the schemas in OSC |
| 222 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 223 | do |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 224 | a1_a1pms_api_get_policy_type 200 1 testdata/OSC/1-a1pms-modified.json |
| 225 | a1_a1pms_api_get_policy_type 200 2 testdata/OSC/2-a1pms-modified.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 226 | done |
| 227 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 228 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 229 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 230 | a1pms_equal json:policy-types 5 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 231 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 232 | a1pms_equal json:policies 0 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 233 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 234 | a1pms_equal json:policy-instances 0 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 235 | else |
| 236 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 237 | a1pms_equal json:policy_schemas 5 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 238 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 239 | a1pms_equal json:policy_types 5 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 240 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 241 | a1pms_equal json:policies 0 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 242 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 243 | a1pms_equal json:policy_ids 0 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 244 | fi |
| 245 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 246 | a1pms_api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_APP_PATH_0/ER-app" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 247 | |
| 248 | # Create policies in STD |
| 249 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 250 | do |
| 251 | ricid=$((3+$i)) |
| 252 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 253 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid NOTYPE $((1100+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"std2" testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 254 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 255 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid NOTYPE $((1200+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"std2" testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 256 | done |
| 257 | |
| 258 | #Create policies in STD 2 |
| 259 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 260 | do |
| 261 | ricid=$((5+$i)) |
| 262 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 263 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid STD_QOS_0_2_0 $((2100+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"std2" testdata/STD2/pi_qos_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 264 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 265 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid STD_QOS2_0.1.0 $((2200+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"std2" testdata/STD2/pi_qos2_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 266 | done |
| 267 | |
| 268 | # Create policies in OSC |
| 269 | for ((i=0; i<$OSC_NUM_RICS; i++)) |
| 270 | do |
| 271 | ricid=$((1+$i)) |
| 272 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 273 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid 1 $((3100+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"osc" testdata/OSC/pi1_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 274 | generate_policy_uuid |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 275 | a1pms_api_put_policy 201 "Emergency-response-app" ric$ricid 2 $((3200+$i)) NOTRANSIENT $CR_SERVICE_APP_PATH_0/"osc" testdata/OSC/pi2_template.json 1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 276 | done |
| 277 | |
| 278 | |
| 279 | # Check the number of policies in STD and STD2 |
| 280 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 281 | do |
| 282 | sim_equal "a1-sim-std-"$i num_instances 2 |
| 283 | sim_equal "a1-sim-std2-"$i num_instances 2 |
| 284 | done |
| 285 | |
| 286 | # Check the number of policies in OSC |
| 287 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 288 | do |
| 289 | sim_equal "a1-sim-osc-"$i num_instances 2 |
| 290 | done |
| 291 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 292 | stop_a1pms |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 293 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 294 | start_stopped_a1pms |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 295 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 296 | # Check A1PMS state after restart |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 297 | |
| 298 | sleep_wait 200 |
| 299 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 300 | if [ "$A1PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 301 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 302 | a1pms_equal json:policy-types 5 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 303 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 304 | a1pms_equal json:policies 12 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 305 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 306 | a1pms_equal json:policy-instances 12 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 307 | else |
| 308 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 309 | a1pms_equal json:policy_schemas 5 120 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 310 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 311 | a1pms_equal json:policy_types 5 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 312 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 313 | a1pms_equal json:policies 12 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 314 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 315 | a1pms_equal json:policy_ids 12 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 316 | fi |
| 317 | |
| 318 | # Check the number of policies in STD and STD2 |
| 319 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 320 | do |
| 321 | sim_equal "a1-sim-std-"$i num_instances 2 |
| 322 | sim_equal "a1-sim-std2-"$i num_instances 2 |
| 323 | done |
| 324 | |
| 325 | # Check the number of policies in OSC |
| 326 | for ((i=0; i<$STD_NUM_RICS; i++)) |
| 327 | do |
| 328 | sim_equal "a1-sim-osc-"$i num_instances 2 |
| 329 | done |
| 330 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 331 | cr_api_reset 0 # Reset CR to count new events |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 332 | |
| 333 | echo "ADD EVENT/STATUS CHECK" |
| 334 | echo "ADD MR CHECK" |
| 335 | |
| 336 | FLAT_A1_EI="1" |
| 337 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 338 | ics_api_admin_reset |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 339 | |
| 340 | CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK" |
| 341 | CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK" |
| 342 | TARGET1="$RIC_SIM_HTTPX://a1-sim-std2-0.a1-sim:$RIC_SIM_PORT/datadelivery" |
| 343 | TARGET2="$RIC_SIM_HTTPX://a1-sim-std2-1.a1-sim:$RIC_SIM_PORT/datadelivery" |
| 344 | |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 345 | STATUS1="$CR_SERVICE_APP_PATH_0/job1-status" |
| 346 | STATUS2="$CR_SERVICE_APP_PATH_0/job2-status" |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 347 | |
| 348 | prodstub_arm_producer 200 prod-a |
| 349 | prodstub_arm_type 200 prod-a type1 |
| 350 | prodstub_arm_job_create 200 prod-a job1 |
| 351 | prodstub_arm_job_create 200 prod-a job2 |
| 352 | |
| 353 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 354 | ### ics status |
| 355 | ics_api_service_status 200 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 356 | |
| 357 | ## Setup prod-a |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 358 | if [ $ICS_VERSION == "V1-1" ]; then |
| 359 | ics_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 360 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 361 | ics_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 362 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 363 | ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json |
| 364 | ics_api_edp_get_type_2 200 type1 |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 365 | |
| 366 | ics_api_edp_get_type_ids 200 type1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 367 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 368 | ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
| 369 | ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 370 | fi |
| 371 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 372 | ics_api_edp_get_producer_status 200 prod-a ENABLED |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 373 | |
| 374 | |
| 375 | ## Create a job for prod-a |
| 376 | ## job1 - prod-a |
| 377 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 378 | ics_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 379 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 380 | ics_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 381 | fi |
| 382 | |
| 383 | # Check the job data in the producer |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 384 | if [ $ICS_VERSION == "V1-1" ]; then |
| 385 | prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 386 | else |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 387 | if [[ "$ICS_FEATURE3LEVEL" == *"INFO-TYPES"* ]]; then |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 388 | prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 389 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 390 | prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 391 | fi |
| 392 | fi |
| 393 | |
| 394 | ## Create a second job for prod-a |
| 395 | ## job2 - prod-a |
| 396 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 397 | ics_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 398 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 399 | ics_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 400 | fi |
| 401 | |
| 402 | # Check the job data in the producer |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 403 | if [ $ICS_VERSION == "V1-1" ]; then |
| 404 | prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 405 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 406 | if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then |
| 407 | prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 408 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 409 | prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 410 | fi |
| 411 | fi |
| 412 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 413 | # Dmaap mediator and adapter |
| 414 | start_dmaapadp NOPROXY $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_CONFIG_FILE $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_DATA_FILE |
| 415 | |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 416 | start_dmaapmed NOPROXY $SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_HOST_DATA_FILE |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 417 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 418 | ics_equal json:data-producer/v1/info-producers 3 120 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 419 | |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 420 | ics_equal json:data-producer/v1/info-types 4 30 |
| 421 | |
| 422 | ics_api_idc_get_type_ids 200 ExampleInformationType ExampleInformationTypeKafka STD_Fault_Messages type1 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 423 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 424 | ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a DmaapGenericInfoProducer DMaaP_Mediator_Producer |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 425 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 426 | NUM_JOBS=1 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 427 | |
| 428 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 429 | do |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 430 | ics_api_idc_put_job 201 jobx$i STD_Fault_Messages $CR_SERVICE_MR_PATH_0/jobx-data$i info-ownerx$i $CR_SERVICE_MR_PATH_0/job_status_info-ownerx$i testdata/dmaap-adapter/job-template.json |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 431 | done |
| 432 | |
| 433 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 434 | do |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 435 | ics_api_idc_put_job 201 joby$i ExampleInformationType $CR_SERVICE_MR_PATH_0/joby-data$i info-ownery$i $CR_SERVICE_MR_PATH_0/job_status_info-ownery$i testdata/dmaap-adapter/job-template.json |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 436 | ics_api_idc_put_job 201 jobz$i ExampleInformationTypeKafka $CR_SERVICE_MR_PATH_0/jobz-data$i info-ownerz$i $CR_SERVICE_MR_PATH_0/job_status_info-ownerz$i testdata/dmaap-adapter/job-template-1-kafka.json |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 437 | done |
| 438 | |
| 439 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 440 | do |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 441 | ics_api_a1_get_job_status 200 jobx$i ENABLED 30 |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 442 | ics_api_a1_get_job_status 200 joby$i ENABLED 30 |
| 443 | ics_api_a1_get_job_status 200 jobz$i ENABLED 30 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 444 | done |
| 445 | |
BjornMagnussonXA | 8fbb226 | 2022-01-24 15:20:15 +0100 | [diff] [blame] | 446 | sleep_wait 30 # Wait for mediator to listening to kafka |
| 447 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 448 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-0"}' |
| 449 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}' |
| 450 | mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-2"}' |
| 451 | mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}' |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 452 | kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------4' |
| 453 | kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------6' |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 454 | |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 455 | |
| 456 | cr_equal 0 received_callbacks $(($NUM_JOBS*2*3)) 200 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 457 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 458 | do |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 459 | cr_equal 0 received_callbacks?id=jobx-data$i 2 |
| 460 | cr_equal 0 received_callbacks?id=joby-data$i 2 |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 461 | cr_equal 0 received_callbacks?id=jobz-data$i 2 |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 462 | done |
| 463 | |
| 464 | for ((i=1; i<=$NUM_JOBS; i++)) |
| 465 | do |
BjornMagnussonXA | 79e3700 | 2021-11-22 13:36:04 +0100 | [diff] [blame] | 466 | cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-0"}' |
| 467 | cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-2"}' |
| 468 | cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-1"}' |
| 469 | cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-3"}' |
BjornMagnussonXA | dfdca18 | 2021-12-10 10:43:32 +0100 | [diff] [blame] | 470 | cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------4' |
| 471 | cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------6' |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 472 | done |
| 473 | |
| 474 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 475 | stop_ics |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 476 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 477 | start_stopped_ics |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 478 | |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 479 | # Check ICS status after restart |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 480 | |
| 481 | if [ -z "$FLAT_A1_EI" ]; then |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 482 | ics_api_a1_get_job_status 200 type1 job1 DISABLED |
| 483 | ics_api_a1_get_job_status 200 type1 job2 DISABLED |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 484 | else |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 485 | ics_api_a1_get_job_status 200 job1 DISABLED |
| 486 | ics_api_a1_get_job_status 200 job2 DISABLED |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 487 | fi |
| 488 | |
BjornMagnussonXA | d2aeca8 | 2022-03-07 11:04:55 +0100 | [diff] [blame^] | 489 | check_a1pms_logs |
BjornMagnussonXA | 007b645 | 2021-11-29 08:03:38 +0100 | [diff] [blame] | 490 | check_ics_logs |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 491 | check_sdnc_logs |
| 492 | |
| 493 | #### TEST COMPLETE #### |
| 494 | |
| 495 | store_logs END |
| 496 | |
| 497 | print_result |