blob: dcbe7b3a232d0ece6f1e691f4e2ff345842bb108 [file] [log] [blame]
BjornMagnussonXAfec823b2021-08-03 14:14:05 +02001#!/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
BjornMagnussonXA663566c2021-11-08 10:25:07 +010020TC_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
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010022# There should be 2 simulator of each A1 interface version started
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020023
24#App names to include in the test when running docker, space separated list
25DOCKER_INCLUDED_IMAGES="" # Not used - KUBE only test script
26
27#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010028KUBE_INCLUDED_IMAGES=" MR DMAAPMR CR PRODSTUB KUBEPROXY KAFKAPC"
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020029#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
BjornMagnussonXA007b6452021-11-29 08:03:38 +010030KUBE_PRESTARTED_IMAGES=" PA RICSIM CP ICS RC SDNC DMAAPMED DMAAPADP"
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020031
32#Supported test environment profiles
33SUPPORTED_PROFILES="ORAN-E-RELEASE"
34#Supported run modes
35SUPPORTED_RUNMODES="KUBE"
36
37. ../common/testcase_common.sh $@
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020038
39setup_testenvironment
40
41#### TEST BEGIN ####
42
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010043use_mr_https
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020044use_cr_https
45use_agent_rest_https
46use_sdnc_https
47use_simulator_https
BjornMagnussonXA007b6452021-11-29 08:03:38 +010048use_ics_rest_https
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020049use_prod_stub_https
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010050use_dmaapmed_https
BjornMagnussonXA663566c2021-11-08 10:25:07 +010051
BjornMagnussonXA007b6452021-11-29 08:03:38 +010052if [ $ICS_VERSION == "V1-1" ]; then
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020053 use_rapp_catalogue_http # https not yet supported
54else
55 ########################################use_rapp_catalogue_https
56 use_rapp_catalogue_http
57fi
58
59echo -e "$RED CHECK WHY RC HTTPS DOES NOT WORK $ERED"
60
61###############################use_control_panel_https
62use_control_panel_http
63
64if [ "$PMS_VERSION" == "V1" ]; then
65 echo "PMS VERSION 2 (V2) is required"
66 exit 1
67fi
68
69clean_environment
70
BjornMagnussonXA007b6452021-11-29 08:03:38 +010071ics_kube_pvc_reset
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020072
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010073pms_kube_pvc_reset
74
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020075start_kube_proxy
76
77STD_NUM_RICS=2
78OSC_NUM_RICS=2
79
80start_ric_simulators a1-sim-osc $STD_NUM_RICS OSC_2.1.0
81echo " RIC MAPPING a1-sim-osc-0 : ric1"
82echo " RIC MAPPING a1-sim-osc-1 : ric2"
83
84start_ric_simulators a1-sim-std $STD_NUM_RICS STD_1.1.3
85echo " RIC MAPPING a1-sim-std-0 : ric3"
86echo " RIC MAPPING a1-sim-std-1 : ric4"
87
88start_ric_simulators a1-sim-std2 $STD_NUM_RICS STD_2.0.0
89echo " RIC MAPPING a1-sim-std2-0 : ric5"
90echo " RIC MAPPING a1-sim-std2-1 : ric6"
91
BjornMagnussonXAdfdca182021-12-10 10:43:32 +010092start_mr "$MR_READ_TOPIC" "/events" "users/policy-agent" \
93 "$MR_WRITE_TOPIC" "/events" "users/mr-stub" \
94 "unauthenticated.dmaapmed.json" "/events" "dmaapmediatorproducer/STD_Fault_Messages" \
95 "unauthenticated.dmaapadp.json" "/events" "dmaapadapterproducer/msgs"
96
97start_kafkapc
98
99kafkapc_api_create_topic 201 "unauthenticated.dmaapadp_kafka.text" "text/plain"
100
101kafkapc_api_start_sending 200 "unauthenticated.dmaapadp_kafka.text"
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200102
103start_control_panel
104
105start_sdnc
106
107start_policy_agent
108
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100109start_cr 1
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200110
111start_prod_stub
112
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100113start_ics NOPROXY
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200114
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100115set_ics_trace
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200116
117start_rapp_catalogue
118
119set_agent_trace
120
121#### Test RAPP Catalogue ####
122
123rapp_cat_api_get_services 200 EMPTY
124
125rapp_cat_api_put_service 201 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
126
127rapp_cat_api_get_services 200 "Emergency-response-app" v1 "Emergency-response-app" "Emergency-response-app"
128
129#Check the number of services
130rc_equal json:services 1
131
132api_get_status 200
133
134#### Test Policy Management Service ####
135
136# Print the A1 version for STD 1.1.X
137for ((i=0; i<$STD_NUM_RICS; i++))
138do
139 sim_print "a1-sim-std-"$i interface
140done
141
142# Print the A1 version for STD 2.0.X
143for ((i=0; i<$STD_NUM_RICS; i++))
144do
145 sim_print "a1-sim-std2-"$i interface
146done
147
148# Print the A1 version for OSC 2.1.X
149for ((i=0; i<$OSC_NUM_RICS; i++))
150do
151 sim_print "a1-sim-osc-"$i interface
152done
153
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100154# Check the number of policies in STD and STD2
155for ((i=0; i<$STD_NUM_RICS; i++))
156do
157 sim_equal "a1-sim-std-"$i num_instances 0
158 sim_equal "a1-sim-std2-"$i num_instances 0
159done
160
161# Check the number of policies in OSC
162for ((i=0; i<$STD_NUM_RICS; i++))
163do
164 sim_equal "a1-sim-osc-"$i num_instances 0
165done
166
167#Check the number of schemas
168api_equal json:policy-types 1
169
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200170# Load the polictypes in STD 2
171for ((i=0; i<$STD_NUM_RICS; i++))
172do
173 sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS_0_2_0 testdata/STD2/sim_qos.json
174 sim_put_policy_type 201 "a1-sim-std2-"$i STD_QOS2_0.1.0 testdata/STD2/sim_qos2.json
175done
176
177# Load the polictypes in OSC
178for ((i=0; i<$OSC_NUM_RICS; i++))
179do
180 sim_put_policy_type 201 "a1-sim-osc-"$i 1 testdata/OSC/sim_1.json
181 sim_put_policy_type 201 "a1-sim-osc-"$i 2 testdata/OSC/sim_2.json
182done
183
184# Check that all rics are synced in
185api_equal json:rics 6 300
186
187#Check the number of schemas and the individual schemas
188api_equal json:policy-types 5 300
189
190for ((i=0; i<$STD_NUM_RICS; i++))
191do
192 ricid=$((3+$i))
193 api_equal json:policy-types?ric_id=ric$ricid 1 120
194done
195
196for ((i=0; i<$STD_NUM_RICS; i++))
197do
198 ricid=$((5+$i))
199 api_equal json:policy-types?ric_id=ric$ricid 2 120
200done
201
202for ((i=0; i<$OSC_NUM_RICS; i++))
203do
204 ricid=$((1+$i))
205 api_equal json:policy-types?ric_id=ric$ricid 2 120
206done
207
208#Check the schemas in STD 2
209for ((i=0; i<$OSC_NUM_RICS; i++))
210do
211 ricid=$((5+$i))
212 api_get_policy_type 200 STD_QOS_0_2_0 testdata/STD2/qos-agent-modified.json
213 api_get_policy_type 200 STD_QOS2_0.1.0 testdata/STD2/qos2-agent-modified.json
214done
215
216# Check the schemas in OSC
217for ((i=0; i<$OSC_NUM_RICS; i++))
218do
219 api_get_policy_type 200 1 testdata/OSC/1-agent-modified.json
220 api_get_policy_type 200 2 testdata/OSC/2-agent-modified.json
221done
222
223if [ "$PMS_VERSION" == "V2" ]; then
224
225 api_equal json:policy-types 5 120
226
227 api_equal json:policies 0
228
229 api_equal json:policy-instances 0
230else
231
232 api_equal json:policy_schemas 5 120
233
234 api_equal json:policy_types 5
235
236 api_equal json:policies 0
237
238 api_equal json:policy_ids 0
239fi
240
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100241api_put_service 201 "Emergency-response-app" 0 "$CR_SERVICE_APP_PATH_0/ER-app"
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200242
243# Create policies in STD
244for ((i=0; i<$STD_NUM_RICS; i++))
245do
246 ricid=$((3+$i))
247 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100248 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200249 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100250 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200251done
252
253#Create policies in STD 2
254for ((i=0; i<$STD_NUM_RICS; i++))
255do
256 ricid=$((5+$i))
257 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100258 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200259 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100260 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200261done
262
263# Create policies in OSC
264for ((i=0; i<$OSC_NUM_RICS; i++))
265do
266 ricid=$((1+$i))
267 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100268 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200269 generate_policy_uuid
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100270 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
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200271done
272
273
274# Check the number of policies in STD and STD2
275for ((i=0; i<$STD_NUM_RICS; i++))
276do
277 sim_equal "a1-sim-std-"$i num_instances 2
278 sim_equal "a1-sim-std2-"$i num_instances 2
279done
280
281# Check the number of policies in OSC
282for ((i=0; i<$STD_NUM_RICS; i++))
283do
284 sim_equal "a1-sim-osc-"$i num_instances 2
285done
286
287stop_policy_agent
288
289start_stopped_policy_agent
290
291# Check PMS state after restart
292
293sleep_wait 200
294
295if [ "$PMS_VERSION" == "V2" ]; then
296
297 api_equal json:policy-types 5 120
298
299 api_equal json:policies 12
300
301 api_equal json:policy-instances 12
302else
303
304 api_equal json:policy_schemas 5 120
305
306 api_equal json:policy_types 5
307
308 api_equal json:policies 12
309
310 api_equal json:policy_ids 12
311fi
312
313# Check the number of policies in STD and STD2
314for ((i=0; i<$STD_NUM_RICS; i++))
315do
316 sim_equal "a1-sim-std-"$i num_instances 2
317 sim_equal "a1-sim-std2-"$i num_instances 2
318done
319
320# Check the number of policies in OSC
321for ((i=0; i<$STD_NUM_RICS; i++))
322do
323 sim_equal "a1-sim-osc-"$i num_instances 2
324done
325
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100326cr_api_reset 0 # Reset CR to count new events
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200327
328echo "ADD EVENT/STATUS CHECK"
329echo "ADD MR CHECK"
330
331FLAT_A1_EI="1"
332
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100333ics_api_admin_reset
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200334
335CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
336CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
337TARGET1="$RIC_SIM_HTTPX://a1-sim-std2-0.a1-sim:$RIC_SIM_PORT/datadelivery"
338TARGET2="$RIC_SIM_HTTPX://a1-sim-std2-1.a1-sim:$RIC_SIM_PORT/datadelivery"
339
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100340STATUS1="$CR_SERVICE_APP_PATH_0/job1-status"
341STATUS2="$CR_SERVICE_APP_PATH_0/job2-status"
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200342
343prodstub_arm_producer 200 prod-a
344prodstub_arm_type 200 prod-a type1
345prodstub_arm_job_create 200 prod-a job1
346prodstub_arm_job_create 200 prod-a job2
347
348
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100349### ics status
350ics_api_service_status 200
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200351
352## Setup prod-a
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100353if [ $ICS_VERSION == "V1-1" ]; then
354 ics_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200355
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100356 ics_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200357else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100358 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
359 ics_api_edp_get_type_2 200 type1
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100360 ics_api_edp_get_type_ids 200 STD_Fault_Messages ExampleInformationTypeKafka ExampleInformationType type1
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200361
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100362 ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
363 ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200364fi
365
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100366ics_api_edp_get_producer_status 200 prod-a ENABLED
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200367
368
369## Create a job for prod-a
370## job1 - prod-a
371if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100372 ics_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200373else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100374 ics_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200375fi
376
377# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100378if [ $ICS_VERSION == "V1-1" ]; then
379 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200380else
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100381 if [[ "$ICS_FEATURE3LEVEL" == *"INFO-TYPES"* ]]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100382 prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200383 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100384 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200385 fi
386fi
387
388## Create a second job for prod-a
389## job2 - prod-a
390if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100391 ics_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200392else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100393 ics_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200394fi
395
396# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100397if [ $ICS_VERSION == "V1-1" ]; then
398 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200399else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100400 if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
401 prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200402 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100403 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200404 fi
405fi
406
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100407# Dmaap mediator and adapter
408start_dmaapadp NOPROXY $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_CONFIG_FILE $SIM_GROUP/$DMAAP_ADP_COMPOSE_DIR/$DMAAP_ADP_DATA_FILE
409
410start_dmaapmed NOPROXY $SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_DATA_FILE
411
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100412ics_equal json:data-producer/v1/info-producers 3 120
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100413
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100414ics_api_idc_get_type_ids 200 ExampleInformationType ExampleInformationTypeKafka STD_Fault_Messages type-1
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100415
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100416ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a DmaapGenericInfoProducer DMaaP_Mediator_Producer
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100417
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100418NUM_JOBS=1
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100419
420for ((i=1; i<=$NUM_JOBS; i++))
421do
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100422 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
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100423done
424
425for ((i=1; i<=$NUM_JOBS; i++))
426do
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100427 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
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100428 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
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100429done
430
431for ((i=1; i<=$NUM_JOBS; i++))
432do
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100433 ics_api_a1_get_job_status 200 jobx$i ENABLED 30
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100434 ics_api_a1_get_job_status 200 joby$i ENABLED 30
435 ics_api_a1_get_job_status 200 jobz$i ENABLED 30
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100436done
437
438mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-0"}'
439mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}'
440mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-2"}'
441mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}'
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100442kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------4'
443kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------6'
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100444
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100445
446cr_equal 0 received_callbacks $(($NUM_JOBS*2*3)) 200
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100447for ((i=1; i<=$NUM_JOBS; i++))
448do
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100449 cr_equal 0 received_callbacks?id=jobx-data$i 2
450 cr_equal 0 received_callbacks?id=joby-data$i 2
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100451 cr_equal 0 received_callbacks?id=jobz-data$i 2
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100452done
453
454for ((i=1; i<=$NUM_JOBS; i++))
455do
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100456 cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-0"}'
457 cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-2"}'
458 cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-1"}'
459 cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-3"}'
BjornMagnussonXAdfdca182021-12-10 10:43:32 +0100460 cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------4'
461 cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------6'
BjornMagnussonXA663566c2021-11-08 10:25:07 +0100462done
463
464
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100465stop_ics
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200466
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100467start_stopped_ics
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200468
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100469# Check ICS status after restart
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200470
471if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100472 ics_api_a1_get_job_status 200 type1 job1 DISABLED
473 ics_api_a1_get_job_status 200 type1 job2 DISABLED
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200474else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100475 ics_api_a1_get_job_status 200 job1 DISABLED
476 ics_api_a1_get_job_status 200 job2 DISABLED
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200477fi
478
479check_policy_agent_logs
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100480check_ics_logs
BjornMagnussonXAfec823b2021-08-03 14:14:05 +0200481check_sdnc_logs
482
483#### TEST COMPLETE ####
484
485store_logs END
486
487print_result