blob: cf172a06a173b8559e3032b52801b7ef0841f138 [file] [log] [blame]
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001#!/bin/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
20
BjornMagnussonXA007b6452021-11-29 08:03:38 +010021TC_ONELINE_DESCR="ICS full interfaces walkthrough"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020022
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010023#App names to include in the test when running docker, space separated list
BjornMagnussonXA007b6452021-11-29 08:03:38 +010024DOCKER_INCLUDED_IMAGES="ICS PRODSTUB CR RICSIM CP HTTPPROXY NGW KUBEPROXY"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010025
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010026#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXA007b6452021-11-29 08:03:38 +010027KUBE_INCLUDED_IMAGES="PRODSTUB CR ICS RICSIM CP HTTPPROXY KUBEPROXY NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010028#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010029KUBE_PRESTARTED_IMAGES=""
30
31#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
32#the image is not configured in the supplied env_file
33#Used for images not applicable to all supported profile
34CONDITIONALLY_IGNORED_IMAGES="NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010035
36#Supported test environment profiles
BjornMagnussonXAfec823b2021-08-03 14:14:05 +020037SUPPORTED_PROFILES="ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010038#Supported run modes
39SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020040
BjornMagnussonXA79e37002021-11-22 13:36:04 +010041. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010042
43setup_testenvironment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020044
45#### TEST BEGIN ####
46
BjornMagnussonXA4207b832020-11-03 09:52:49 +010047FLAT_A1_EI="1"
48
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010049clean_environment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020050
BjornMagnussonXA663566c2021-11-08 10:25:07 +010051start_kube_proxy
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010052
BjornMagnussonXA007b6452021-11-29 08:03:38 +010053use_ics_rest_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020054
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010055use_prod_stub_https
56
57use_simulator_https
58
59use_cr_https
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020060
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010061start_http_proxy
BjornMagnussonXAc963b732021-01-20 14:24:13 +010062
BjornMagnussonXA007b6452021-11-29 08:03:38 +010063start_ics NOPROXY $SIM_GROUP/$ICS_COMPOSE_DIR/$ICS_CONFIG_FILE #Change NOPROXY to PROXY to run with http proxy
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010064
65if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +010066 ics_api_admin_reset
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010067fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020068
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +020069start_prod_stub
70
BjornMagnussonXA007b6452021-11-29 08:03:38 +010071set_ics_debug
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020072
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010073start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
74
75if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
76 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
77fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010078
79if [ "$PMS_VERSION" == "V2" ]; then
80 start_ric_simulators ricsim_g3 4 STD_2.0.0
81fi
82
BjornMagnussonXA79e37002021-11-22 13:36:04 +010083start_cr 1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010084
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010085CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
86CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020087#Targets for ei jobs
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010088TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
89TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
90TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
91TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
92TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
93
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +020094#Targets for info jobs
95TARGET101="http://localhost:80/target" # Dummy target, no target for info data in this env...
96TARGET102="http://localhost:80/target" # Dummy target, no target for info data in this env...
97TARGET103="http://localhost:80/target" # Dummy target, no target for info data in this env...
98TARGET108="http://localhost:80/target" # Dummy target, no target for info data in this env...
99TARGET110="http://localhost:80/target" # Dummy target, no target for info data in this env...
100TARGET150="http://localhost:80/target" # Dummy target, no target for info data in this env...
101TARGET160="http://localhost:80/target" # Dummy target, no target for info data in this env...
102
103#Status callbacks for eijobs
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100104STATUS1="$CR_SERVICE_APP_PATH_0/job1-status"
105STATUS2="$CR_SERVICE_APP_PATH_0/job2-status"
106STATUS3="$CR_SERVICE_APP_PATH_0/job3-status"
107STATUS8="$CR_SERVICE_APP_PATH_0/job8-status"
108STATUS10="$CR_SERVICE_APP_PATH_0/job10-status"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100109
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200110#Status callbacks for infojobs
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100111INFOSTATUS101="$CR_SERVICE_APP_PATH_0/info-job101-status"
112INFOSTATUS102="$CR_SERVICE_APP_PATH_0/info-job102-status"
113INFOSTATUS103="$CR_SERVICE_APP_PATH_0/info-job103-status"
114INFOSTATUS108="$CR_SERVICE_APP_PATH_0/info-job108-status"
115INFOSTATUS110="$CR_SERVICE_APP_PATH_0/info-job110-status"
116INFOSTATUS150="$CR_SERVICE_APP_PATH_0/info-job150-status"
117INFOSTATUS160="$CR_SERVICE_APP_PATH_0/info-job160-status"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200118
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100119if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200120 #Type registration status callbacks
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100121 TYPESTATUS1="$CR_SERVICE_APP_PATH_0/type-status1"
122 TYPESTATUS2="$CR_SERVICE_APP_PATH_0/type-status2"
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200123
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100124 ics_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200125
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100126 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200127
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100128 ics_api_idc_get_subscription_ids 200 owner1 subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200129
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100130 ics_api_idc_get_subscription_ids 200 test EMPTY
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200131
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100132 ics_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200133
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100134 ics_api_idc_get_subscription 404 test
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200135
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100136 ics_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200137
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100138 ics_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200139
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100140 ics_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200141
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100142 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200143
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100144 ics_api_idc_get_subscription_ids 200 owner1 subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200145
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100146 ics_api_idc_get_subscription_ids 200 owner2 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200147
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100148 ics_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
149 ics_api_idc_get_subscription 200 subscription-id-2 owner2 $TYPESTATUS2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200150
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100151 ics_api_idc_delete_subscription 204 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200152
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100153 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200154
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100155 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200156
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100157 cr_equal 0 received_callbacks 1 30
158 cr_equal 0 received_callbacks?id=type-status1 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100159 cr_api_check_all_ics_subscription_events 200 0 type-status1 type1 testdata/ics/ei-type-1.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200160
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100161 ics_api_edp_delete_type_2 204 type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200162
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100163 cr_equal 0 received_callbacks 2 30
164 cr_equal 0 received_callbacks?id=type-status1 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100165 cr_api_check_all_ics_subscription_events 200 0 type-status1 type1 testdata/ics/ei-type-1.json DEREGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200166
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100167 ics_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
168 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200169
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100170 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200171
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100172 cr_equal 0 received_callbacks 4 30
173 cr_equal 0 received_callbacks?id=type-status1 3
174 cr_equal 0 received_callbacks?id=type-status2 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100175 cr_api_check_all_ics_subscription_events 200 0 type-status1 type1 testdata/ics/ei-type-1.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200176
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100177 ics_api_idc_delete_subscription 204 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200178
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100179 ics_api_edp_delete_type_2 204 type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200180
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100181 cr_equal 0 received_callbacks 5 30
182 cr_equal 0 received_callbacks?id=type-status1 4
183 cr_equal 0 received_callbacks?id=type-status2 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100184 cr_api_check_all_ics_subscription_events 200 0 type-status1 type1 testdata/ics/ei-type-1.json DEREGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200185
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100186 cr_api_reset 0
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200187fi
188
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100189### Setup prodstub sim to accept calls for producers, types and jobs
190## prod-a type1
191## prod-b type1 and type2
192## prod-c no-type
193## prod-d type4
194## prod-e type6
195## prod-f type6
196
197## job1 -> prod-a
198## job2 -> prod-a
199## job3 -> prod-b
200## job4 -> prod-a
201## job6 -> prod-b
202## job8 -> prod-d
203## job10 -> prod-e and prod-f
204
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200205prodstub_arm_producer 200 prod-a
206prodstub_arm_producer 200 prod-b
207prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200208prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100209prodstub_arm_producer 200 prod-e
210prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200211
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200212prodstub_arm_type 200 prod-a type1
213prodstub_arm_type 200 prod-b type2
214prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100215prodstub_arm_type 200 prod-d type4
216prodstub_arm_type 200 prod-e type6
217prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200218
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200219prodstub_disarm_type 200 prod-b type3
220prodstub_arm_type 200 prod-b type1
221prodstub_disarm_type 200 prod-b type1
222
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100223
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200224prodstub_arm_job_create 200 prod-a job1
225prodstub_arm_job_create 200 prod-a job2
226prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200227
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200228prodstub_arm_job_delete 200 prod-a job1
229prodstub_arm_job_delete 200 prod-a job2
230prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200231
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200232prodstub_arm_job_create 200 prod-b job4
233prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200234
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200235prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200236
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100237prodstub_arm_job_create 200 prod-d job8
238
239prodstub_arm_job_create 200 prod-e job10
240prodstub_arm_job_create 200 prod-f job10
241
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100242### ics status
243ics_api_service_status 200
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200244
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100245cr_equal 0 received_callbacks 0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100246
247### Initial tests - no config made
248### GET: type ids, types, producer ids, producers, job ids, jobs
249### DELETE: jobs
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100250ics_api_a1_get_type_ids 200 EMPTY
251ics_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200252
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100253ics_api_edp_get_type_ids 200 EMPTY
254if [ $ICS_VERSION == "V1-1" ]; then
255 ics_api_edp_get_type 404 test-type
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100256else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100257 ics_api_edp_get_type_2 404 test-type
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100258fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200259
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100260if [ $ICS_VERSION == "V1-1" ]; then
261 ics_api_edp_get_producer_ids 200 EMPTY
262 ics_api_edp_get_producer 404 test-prod
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100263else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100264 ics_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
265 ics_api_edp_get_producer_2 404 test-prod
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100266fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100267ics_api_edp_get_producer_status 404 test-prod
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200268
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100269ics_api_edp_delete_producer 404 test-prod
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200270
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100271if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100272 ics_api_a1_get_job_ids 404 test-type NOWNER
273 ics_api_a1_get_job_ids 404 test-type test-owner
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200274
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100275 ics_api_a1_get_job 404 test-type test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200276
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100277 ics_api_a1_get_job_status 404 test-type test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100278else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100279 ics_api_a1_get_job_ids 200 test-type NOWNER EMPTY
280 ics_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200281
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100282 ics_api_a1_get_job 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100283
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100284 ics_api_a1_get_job_status 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100285fi
286
287if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100288 ics_api_a1_delete_job 404 test-type test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100289else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100290 ics_api_a1_delete_job 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100291fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200292
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100293if [ $ICS_VERSION == "V1-1" ]; then
294 ics_api_edp_get_producer_jobs 404 test-prod
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100295else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100296 ics_api_edp_get_producer_jobs_2 404 test-prod
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100297fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200298
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100299if [ $ICS_VERSION == "V1-2" ]; then
300 ics_api_edp_get_type_2 404 test-type
301 ics_api_edp_delete_type_2 404 test-type
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100302fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200303
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100304### Setup of producer/job and testing apis ###
305
306## Setup prod-a
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100307if [ $ICS_VERSION == "V1-1" ]; then
308 ics_api_edp_put_producer 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
309 ics_api_edp_put_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100310else
311 #V1-2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100312 ics_api_edp_get_type_ids 200 EMPTY
313 ics_api_edp_get_type_2 404 type1
314 ics_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100315
316 # Create type, delete and create again
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100317 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
318 ics_api_edp_get_type_2 200 type1
319 ics_api_edp_get_type_ids 200 type1
320 ics_api_edp_delete_type_2 204 type1
321 ics_api_edp_get_type_2 404 type1
322 ics_api_edp_get_type_ids 200 EMPTY
323 if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
324 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200325 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100326 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200327 fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100328 ics_api_edp_get_type_ids 200 type1
329 if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
330 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200331 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100332 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200333 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100334
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100335 ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
336 ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200337
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100338 if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100339 cr_equal 0 received_callbacks 3 30
340 cr_equal 0 received_callbacks?id=type-status1 3
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100341 cr_api_check_all_ics_subscription_events 200 0 type-status1 type1 testdata/ics/ei-type-1.json REGISTERED type1 testdata/ics/ei-type-1.json DEREGISTERED type1 testdata/ics/ei-type-1.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200342 else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100343 cr_equal 0 received_callbacks 0
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200344 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100345fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100346
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200347
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100348ics_api_a1_get_type_ids 200 type1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100349if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100350 ics_api_a1_get_type 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100351else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100352 ics_api_a1_get_type 200 type1 testdata/ics/empty-type.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100353fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200354
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100355ics_api_edp_get_type_ids 200 type1
356if [ $ICS_VERSION == "V1-1" ]; then
357 ics_api_edp_get_type 200 type1 testdata/ics/ei-type-1.json prod-a
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100358else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100359 if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
360 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200361 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100362 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200363 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100364fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200365
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100366if [ $ICS_VERSION == "V1-1" ]; then
367 ics_api_edp_get_producer_ids 200 prod-a
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100368else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100369 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a
370 ics_api_edp_get_producer_ids_2 200 type1 prod-a
371 ics_api_edp_get_producer_ids_2 200 type2 EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100372fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100373
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100374if [ $ICS_VERSION == "V1-1" ]; then
375 ics_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100376else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100377 ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100378fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200379
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100380ics_api_edp_get_producer_status 200 prod-a ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200381
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100382ics_api_a1_get_job_ids 200 type1 NOWNER EMPTY
383ics_api_a1_get_job_ids 200 type1 test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200384
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100385if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100386 ics_api_a1_get_job 404 type1 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200387
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100388 ics_api_a1_get_job_status 404 type1 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100389else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100390 ics_api_a1_get_job 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100391
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100392 ics_api_a1_get_job_status 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100393fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100394if [ $ICS_VERSION == "V1-1" ]; then
395 ics_api_edp_get_producer_jobs 200 prod-a EMPTY
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100396else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100397 ics_api_edp_get_producer_jobs_2 200 prod-a EMPTY
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100398fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200399
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100400## Create a job for prod-a
401## job1 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100402if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100403 ics_api_a1_put_job 201 type1 job1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100404else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100405 ics_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100406fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200407
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100408# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100409if [ $ICS_VERSION == "V1-1" ]; then
410 prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100411else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100412 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
413 prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200414 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100415 prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200416 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100417fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200418
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100419ics_api_a1_get_job_ids 200 type1 NOWNER job1
420ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100421
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100422if [ ! -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100423 ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100424fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200425
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100426if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100427 ics_api_a1_get_job 200 type1 job1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200428
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100429 ics_api_a1_get_job_status 200 type1 job1 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100430else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100431 ics_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100432
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100433 ics_api_a1_get_job_status 200 job1 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100434fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200435
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100436prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200437
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100438if [ $ICS_VERSION == "V1-1" ]; then
439 ics_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100440else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100441 ics_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100442fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200443
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100444## Create a second job for prod-a
445## job2 - prod-a
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100446if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100447 ics_api_a1_put_job 201 type1 job2 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100448else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100449 ics_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100450fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200451
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100452# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100453if [ $ICS_VERSION == "V1-1" ]; then
454 prodstub_check_jobdata 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100455else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100456 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
457 prodstub_check_jobdata_2 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200458 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100459 prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200460 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100461fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100462ics_api_a1_get_job_ids 200 type1 NOWNER job1 job2
463ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
464ics_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100465if [ ! -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100466 ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100467fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200468
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100469if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100470 ics_api_a1_get_job 200 type1 job2 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200471
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100472 ics_api_a1_get_job_status 200 type1 job2 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100473else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100474 ics_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100475
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100476 ics_api_a1_get_job_status 200 job2 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100477fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200478
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100479prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200480
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100481if [ $ICS_VERSION == "V1-1" ]; then
482 ics_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100483else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100484 ics_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100485fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200486
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100487## Setup prod-b
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100488if [ $ICS_VERSION == "V1-1" ]; then
489 ics_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ics/ei-type-2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100490else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100491 ics_api_edp_put_type_2 201 type2 testdata/ics/ei-type-2.json
492 ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
493 if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100494 cr_equal 0 received_callbacks 4 30
495 cr_equal 0 received_callbacks?id=type-status1 4
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100496 cr_api_check_all_ics_subscription_events 200 0 type-status1 type2 testdata/ics/ei-type-2.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200497 else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100498 cr_equal 0 received_callbacks 0
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200499 fi
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100500fi
501
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200502
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100503ics_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100504if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100505 ics_api_a1_get_type 200 type1 testdata/ics/ei-type-1.json
506 ics_api_a1_get_type 200 type2 testdata/ics/ei-type-2.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100507else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100508 ics_api_a1_get_type 200 type1 testdata/ics/empty-type.json
509 ics_api_a1_get_type 200 type2 testdata/ics/empty-type.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100510fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200511
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100512ics_api_edp_get_type_ids 200 type1 type2
513if [ $ICS_VERSION == "V1-1" ]; then
514 ics_api_edp_get_type 200 type1 testdata/ics/ei-type-1.json prod-a
515 ics_api_edp_get_type 200 type2 testdata/ics/ei-type-2.json prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100516else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100517 if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
518 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200519 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100520 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA83a750f2021-09-21 20:39:58 +0200521 fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100522 ics_api_edp_get_type_2 200 type2 testdata/ics/ei-type-2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100523fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200524
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100525if [ $ICS_VERSION == "V1-1" ]; then
526 ics_api_edp_get_producer_ids 200 prod-a prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100527else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100528 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100529fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100530
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100531if [ $ICS_VERSION == "V1-1" ]; then
532 ics_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
533 ics_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ics/ei-type-2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100534else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100535 ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
536 ics_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100537fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200538
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100539ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200540
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100541## Create job for prod-b
542## job3 - prod-b
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100543if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100544 ics_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100545else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100546 ics_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100547fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200548
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100549prodstub_equal create/prod-b/job3 1
550
551# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100552if [ $ICS_VERSION == "V1-1" ]; then
553 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100554else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100555 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
556 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200557 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100558 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200559 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100560fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200561
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100562ics_api_a1_get_job_ids 200 type1 NOWNER job1 job2
563ics_api_a1_get_job_ids 200 type2 NOWNER job3
564ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
565ics_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
566ics_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200567
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100568if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100569 ics_api_a1_get_job 200 type2 job3 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200570
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100571 ics_api_a1_get_job_status 200 type2 job3 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100572else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100573 ics_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100574
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100575 ics_api_a1_get_job_status 200 job3 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100576fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200577
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100578if [ $ICS_VERSION == "V1-1" ]; then
579 ics_api_edp_get_producer_jobs 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
580 ics_api_edp_get_producer_jobs 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100581else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100582 ics_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
583 ics_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100584fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200585
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100586## Setup prod-c (no types)
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100587if [ $ICS_VERSION == "V1-1" ]; then
588 ics_api_edp_put_producer 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100589else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100590 ics_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100591fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100592
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100593if [ $ICS_VERSION == "V1-1" ]; then
594 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100595else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100596 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100597fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200598
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100599if [ $ICS_VERSION == "V1-1" ]; then
600 ics_api_edp_get_producer 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1 testdata/ics/ei-type-1.json
601 ics_api_edp_get_producer 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ics/ei-type-2.json
602 ics_api_edp_get_producer 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100603else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100604 ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
605 ics_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
606 ics_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100607fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200608
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100609ics_api_edp_get_producer_status 200 prod-c ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200610
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100611
612## Delete job3 and prod-b and re-create if different order
613
614# Delete job then producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100615ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
616if [ $ICS_VERSION == "V1-1" ]; then
617 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100618else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100619 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100620fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100621
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100622if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100623 ics_api_a1_delete_job 204 type2 job3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100624else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100625 ics_api_a1_delete_job 204 job3
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100626fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200627
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100628ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
629if [ $ICS_VERSION == "V1-1" ]; then
630 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100631else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100632 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100633fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100634
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100635ics_api_edp_delete_producer 204 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200636
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100637ics_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200638
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100639ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
640if [ $ICS_VERSION == "V1-1" ]; then
641 ics_api_edp_get_producer_ids 200 prod-a prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100642else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100643 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100644fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200645
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100646prodstub_equal delete/prod-b/job3 1
647
648if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100649 ics_api_a1_put_job 404 type2 job3 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100650else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100651 if [ $ICS_VERSION == "V1-1" ]; then
652 ics_api_a1_put_job 404 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100653 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100654 ics_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
655 ics_api_a1_get_job_status 200 job3 DISABLED
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100656 fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100657fi
658
659# Put producer then job
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100660if [ $ICS_VERSION == "V1-1" ]; then
661 ics_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ics/ei-type-2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100662else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100663 ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100664fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100665
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100666ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100667
668if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100669 ics_api_a1_put_job 201 type2 job3 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
670 ics_api_a1_get_job_status 200 type2 job3 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100671else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100672 if [ $ICS_VERSION == "V1-1" ]; then
673 ics_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100674 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100675 ics_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100676 fi
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100677 ics_api_a1_get_job_status 200 job3 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100678fi
679
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100680if [ $ICS_VERSION == "V1-1" ]; then
681 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100682else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100683 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
684 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200685 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100686 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200687 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100688fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100689
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100690ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
691if [ $ICS_VERSION == "V1-1" ]; then
692 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100693else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100694 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100695fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100696
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100697if [ $ICS_VERSION == "V1-1" ]; then
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100698 prodstub_equal create/prod-b/job3 2
699else
700 prodstub_equal create/prod-b/job3 3
701fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100702prodstub_equal delete/prod-b/job3 1
703
704# Delete only the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100705ics_api_edp_delete_producer 204 prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100706
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100707ics_api_edp_get_producer_status 404 prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100708
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100709ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
710if [ $ICS_VERSION == "V1-1" ]; then
711 ics_api_edp_get_producer_ids 200 prod-a prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100712else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100713 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100714fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100715
716if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100717 ics_api_a1_get_job_status 200 type2 job3 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100718else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100719 ics_api_a1_get_job_status 200 job3 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100720fi
721
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100722if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100723 cr_equal 0 received_callbacks 5 30
724 cr_equal 0 received_callbacks?id=type-status1 4
725 cr_equal 0 received_callbacks?id=job3-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100726 cr_api_check_all_ics_events 200 0 job3-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200727else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100728 cr_equal 0 received_callbacks 1 30
729 cr_equal 0 received_callbacks?id=job3-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100730 cr_api_check_all_ics_events 200 0 job3-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200731fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100732
733# Re-create the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100734if [ $ICS_VERSION == "V1-1" ]; then
735 ics_api_edp_put_producer 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2 testdata/ics/ei-type-2.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100736else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100737 ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100738fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100739
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100740ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100741
742if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100743 ics_api_a1_get_job_status 200 type2 job3 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100744else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100745 ics_api_a1_get_job_status 200 job3 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100746fi
747
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100748if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100749 cr_equal 0 received_callbacks 6 30
750 cr_equal 0 received_callbacks?id=type-status1 4
751 cr_equal 0 received_callbacks?id=job3-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100752 cr_api_check_all_ics_events 200 0 job3-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200753else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100754 cr_equal 0 received_callbacks 2 30
755 cr_equal 0 received_callbacks?id=job3-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100756 cr_api_check_all_ics_events 200 0 job3-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200757fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100758
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100759if [ $ICS_VERSION == "V1-1" ]; then
760 prodstub_check_jobdata 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100761else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100762 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
763 prodstub_check_jobdata_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200764 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100765 prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200766 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100767fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100768
769## Setup prod-d
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100770if [ $ICS_VERSION == "V1-1" ]; then
771 ics_api_edp_put_producer 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ics/ei-type-4.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100772else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100773 ics_api_edp_put_type_2 201 type4 testdata/ics/ei-type-4.json
774 ics_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100775fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200776
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100777if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100778 cr_equal 0 received_callbacks 7 30
779 cr_equal 0 received_callbacks?id=type-status1 5
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100780 cr_api_check_all_ics_subscription_events 200 0 type-status1 type4 testdata/ics/ei-type-4.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200781fi
782
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100783ics_api_a1_get_job_ids 200 type4 NOWNER EMPTY
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200784
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100785if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100786 ics_api_a1_put_job 201 type4 job8 $TARGET8 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100787else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100788 ics_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ics/job-template.json
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100789fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100790
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100791if [ $ICS_VERSION == "V1-1" ]; then
792 prodstub_check_jobdata 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100793else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100794 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
795 prodstub_check_jobdata_2 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200796 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100797 prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200798 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100799fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100800
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200801prodstub_equal create/prod-d/job8 1
802prodstub_equal delete/prod-d/job8 0
803
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100804ics_api_a1_get_job_ids 200 type4 NOWNER job8
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200805
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100806if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100807 ics_api_a1_get_job_status 200 type4 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100808else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100809 ics_api_a1_get_job_status 200 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100810fi
811
812# Re-PUT the producer with zero types
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100813if [ $ICS_VERSION == "V1-1" ]; then
814 ics_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100815else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100816 ics_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100817fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200818
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100819if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100820 ics_api_a1_get_job_ids 404 type4 NOWNER
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100821else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100822 ics_api_a1_get_job_ids 200 type4 NOWNER job8
823 ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100824fi
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200825
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100826if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100827 ics_api_a1_get_job_status 200 type4 job8 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100828else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100829 ics_api_a1_get_job_status 200 job8 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100830fi
831
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100832if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100833 cr_equal 0 received_callbacks 8 30
834 cr_equal 0 received_callbacks?id=type-status1 5
835 cr_equal 0 received_callbacks?id=job8-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100836 cr_api_check_all_ics_events 200 0 job8-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200837else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100838 cr_equal 0 received_callbacks 3 30
839 cr_equal 0 received_callbacks?id=job8-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100840 cr_api_check_all_ics_events 200 0 job8-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200841fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100842
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200843prodstub_equal create/prod-d/job8 1
844prodstub_equal delete/prod-d/job8 0
845
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100846## Re-setup prod-d
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100847if [ $ICS_VERSION == "V1-1" ]; then
848 ics_api_edp_put_producer 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4 testdata/ics/ei-type-4.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100849else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100850 ics_api_edp_put_type_2 200 type4 testdata/ics/ei-type-4.json
851 ics_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100852fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100853
854if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100855 ics_api_a1_get_job_ids 404 type4 NOWNER
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100856else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100857 ics_api_a1_get_job_ids 200 type4 NOWNER job8
858 ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100859fi
860
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100861if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100862 ics_api_a1_get_job_status 200 type4 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100863else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100864 ics_api_a1_get_job_status 200 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100865fi
866
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100867ics_api_edp_get_producer_status 200 prod-a ENABLED
868ics_api_edp_get_producer_status 200 prod-b ENABLED
869ics_api_edp_get_producer_status 200 prod-c ENABLED
870ics_api_edp_get_producer_status 200 prod-d ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100871
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100872if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100873 cr_equal 0 received_callbacks 10 30
874 cr_equal 0 received_callbacks?id=type-status1 6
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100875 cr_api_check_all_ics_subscription_events 200 0 type-status1 type4 testdata/ics/ei-type-4.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200876
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100877 cr_equal 0 received_callbacks?id=job8-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100878 cr_api_check_all_ics_events 200 0 job8-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200879else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100880 cr_equal 0 received_callbacks 4 30
881 cr_equal 0 received_callbacks?id=job8-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100882 cr_api_check_all_ics_events 200 0 job8-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200883fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100884
885prodstub_equal create/prod-d/job8 2
886prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100887
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100888## Setup prod-e
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100889if [ $ICS_VERSION == "V1-1" ]; then
890 ics_api_edp_put_producer 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6 testdata/ics/ei-type-6.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100891else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100892 ics_api_edp_put_type_2 201 type6 testdata/ics/ei-type-6.json
893 ics_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100894fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100895
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100896if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100897 cr_equal 0 received_callbacks 11 30
898 cr_equal 0 received_callbacks?id=type-status1 7
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100899 cr_api_check_all_ics_subscription_events 200 0 type-status1 type6 testdata/ics/ei-type-6.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200900fi
901
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100902ics_api_a1_get_job_ids 200 type6 NOWNER EMPTY
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100903
904if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100905 ics_api_a1_put_job 201 type6 job10 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100906else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100907 ics_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100908fi
909
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100910if [ $ICS_VERSION == "V1-1" ]; then
911 prodstub_check_jobdata 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100912else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100913 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
914 prodstub_check_jobdata_2 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200915 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100916 prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200917 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100918fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100919
920prodstub_equal create/prod-e/job10 1
921prodstub_equal delete/prod-e/job10 0
922
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100923ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100924
925if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100926 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100927else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100928 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100929fi
930
931## Setup prod-f
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100932if [ $ICS_VERSION == "V1-1" ]; then
933 ics_api_edp_put_producer 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6 testdata/ics/ei-type-6.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100934else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100935 ics_api_edp_put_type_2 200 type6 testdata/ics/ei-type-6.json
936 ics_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100937fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100938
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100939if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100940 cr_equal 0 received_callbacks 12 30
941 cr_equal 0 received_callbacks?id=type-status1 8
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100942 cr_api_check_all_ics_subscription_events 200 0 type-status1 type6 testdata/ics/ei-type-6.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200943fi
944
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100945ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100946
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100947if [ $ICS_VERSION == "V1-1" ]; then
948 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100949else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100950 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
951 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200952 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100953 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +0200954 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +0100955fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100956
957prodstub_equal create/prod-f/job10 1
958prodstub_equal delete/prod-f/job10 0
959
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100960ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100961
962if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100963 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100964else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100965 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100966fi
967
968## Status updates prod-a and jobs
969
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100970if [ $ICS_VERSION == "V1-1" ]; then
971 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100972else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100973 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100974fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100975
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100976ics_api_edp_get_producer_status 200 prod-a ENABLED
977ics_api_edp_get_producer_status 200 prod-b ENABLED
978ics_api_edp_get_producer_status 200 prod-c ENABLED
979ics_api_edp_get_producer_status 200 prod-d ENABLED
980ics_api_edp_get_producer_status 200 prod-e ENABLED
981ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100982
983# Arm producer prod-a for supervision failure
984prodstub_arm_producer 200 prod-a 400
985
986# Wait for producer prod-a to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100987ics_api_edp_get_producer_status 200 prod-a DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100988
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100989if [ $ICS_VERSION == "V1-1" ]; then
990 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100991else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100992 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100993fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100994
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100995ics_api_edp_get_producer_status 200 prod-a DISABLED
996ics_api_edp_get_producer_status 200 prod-b ENABLED
997ics_api_edp_get_producer_status 200 prod-c ENABLED
998ics_api_edp_get_producer_status 200 prod-d ENABLED
999ics_api_edp_get_producer_status 200 prod-e ENABLED
1000ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001001
1002
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001003if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001004 ics_api_a1_get_job_status 200 type1 job1 ENABLED
1005 ics_api_a1_get_job_status 200 type1 job2 ENABLED
1006 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1007 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1008 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001009else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001010 ics_api_a1_get_job_status 200 job1 ENABLED
1011 ics_api_a1_get_job_status 200 job2 ENABLED
1012 ics_api_a1_get_job_status 200 job3 ENABLED
1013 ics_api_a1_get_job_status 200 job8 ENABLED
1014 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001015fi
BjornMagnussonXA4207b832020-11-03 09:52:49 +01001016
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001017# Arm producer prod-a for supervision
1018prodstub_arm_producer 200 prod-a 200
1019
1020# Wait for producer prod-a to go enabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001021ics_api_edp_get_producer_status 200 prod-a ENABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001022
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001023if [ $ICS_VERSION == "V1-1" ]; then
1024 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001025else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001026 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001027fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001028
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001029ics_api_edp_get_producer_status 200 prod-a ENABLED
1030ics_api_edp_get_producer_status 200 prod-b ENABLED
1031ics_api_edp_get_producer_status 200 prod-c ENABLED
1032ics_api_edp_get_producer_status 200 prod-d ENABLED
1033ics_api_edp_get_producer_status 200 prod-e ENABLED
1034ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001035
1036if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001037 ics_api_a1_get_job_status 200 type1 job1 ENABLED
1038 ics_api_a1_get_job_status 200 type1 job2 ENABLED
1039 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1040 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1041 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001042else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001043 ics_api_a1_get_job_status 200 job1 ENABLED
1044 ics_api_a1_get_job_status 200 job2 ENABLED
1045 ics_api_a1_get_job_status 200 job3 ENABLED
1046 ics_api_a1_get_job_status 200 job8 ENABLED
1047 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001048fi
1049
1050# Arm producer prod-a for supervision failure
1051prodstub_arm_producer 200 prod-a 400
1052
1053# Wait for producer prod-a to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001054ics_api_edp_get_producer_status 200 prod-a DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001055
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001056if [ $ICS_VERSION == "V1-1" ]; then
1057 ics_api_edp_get_producer_ids 200 prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001058else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001059 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001060fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001061
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001062ics_api_edp_get_producer_status 200 prod-a DISABLED
1063ics_api_edp_get_producer_status 200 prod-b ENABLED
1064ics_api_edp_get_producer_status 200 prod-c ENABLED
1065ics_api_edp_get_producer_status 200 prod-d ENABLED
1066ics_api_edp_get_producer_status 200 prod-e ENABLED
1067ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001068
1069if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001070 ics_api_a1_get_job_status 200 type1 job1 ENABLED
1071 ics_api_a1_get_job_status 200 type1 job2 ENABLED
1072 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1073 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1074 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001075else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001076 ics_api_a1_get_job_status 200 job1 ENABLED
1077 ics_api_a1_get_job_status 200 job2 ENABLED
1078 ics_api_a1_get_job_status 200 job3 ENABLED
1079 ics_api_a1_get_job_status 200 job8 ENABLED
1080 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001081fi
1082
1083# Wait for producer prod-a to be removed
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001084if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1085 ics_equal json:data-producer/v1/info-producers 5 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001086else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001087 ics_equal json:ei-producer/v1/eiproducers 5 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001088fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001089
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001090if [ $ICS_VERSION == "V1-1" ]; then
1091 ics_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001092else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001093 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001094fi
1095
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001096
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001097ics_api_edp_get_producer_status 404 prod-a
1098ics_api_edp_get_producer_status 200 prod-b ENABLED
1099ics_api_edp_get_producer_status 200 prod-c ENABLED
1100ics_api_edp_get_producer_status 200 prod-d ENABLED
1101ics_api_edp_get_producer_status 200 prod-e ENABLED
1102ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001103
1104if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001105 ics_api_a1_get_job_status 200 type1 job1 DISABLED
1106 ics_api_a1_get_job_status 200 type1 job2 DISABLED
1107 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1108 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1109 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001110else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001111 ics_api_a1_get_job_status 200 job1 DISABLED
1112 ics_api_a1_get_job_status 200 job2 DISABLED
1113 ics_api_a1_get_job_status 200 job3 ENABLED
1114 ics_api_a1_get_job_status 200 job8 ENABLED
1115 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001116fi
1117
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001118if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001119 cr_equal 0 received_callbacks 14 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001120else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001121 cr_equal 0 received_callbacks 6 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001122fi
1123
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001124cr_equal 0 received_callbacks?id=job1-status 1
1125cr_equal 0 received_callbacks?id=job2-status 1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001126
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001127cr_api_check_all_ics_events 200 0 job1-status DISABLED
1128cr_api_check_all_ics_events 200 0 job2-status DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001129
1130
1131# Arm producer prod-e for supervision failure
1132prodstub_arm_producer 200 prod-e 400
1133
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001134ics_api_edp_get_producer_status 200 prod-e DISABLED 1000
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001135
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001136if [ $ICS_VERSION == "V1-1" ]; then
1137 ics_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001138else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001139 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001140fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001141
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001142ics_api_edp_get_producer_status 404 prod-a
1143ics_api_edp_get_producer_status 200 prod-b ENABLED
1144ics_api_edp_get_producer_status 200 prod-c ENABLED
1145ics_api_edp_get_producer_status 200 prod-d ENABLED
1146ics_api_edp_get_producer_status 200 prod-e DISABLED
1147ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001148
1149if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001150 ics_api_a1_get_job_status 200 type1 job1 DISABLED
1151 ics_api_a1_get_job_status 200 type1 job2 DISABLED
1152 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1153 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1154 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001155else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001156 ics_api_a1_get_job_status 200 job1 DISABLED
1157 ics_api_a1_get_job_status 200 job2 DISABLED
1158 ics_api_a1_get_job_status 200 job3 ENABLED
1159 ics_api_a1_get_job_status 200 job8 ENABLED
1160 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001161fi
1162
1163#Disable create for job10 in prod-e
1164prodstub_arm_job_create 200 prod-e job10 400
1165
1166#Update tjob 10 - only prod-f will be updated
1167if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001168 ics_api_a1_put_job 200 type6 job10 $TARGET10 ricsim_g3_4 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001169else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001170 ics_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001171fi
1172#Reset producer and job responses
1173prodstub_arm_producer 200 prod-e 200
1174prodstub_arm_job_create 200 prod-e job10 200
1175
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001176ics_api_edp_get_producer_status 200 prod-e ENABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001177
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001178if [ $ICS_VERSION == "V1-1" ]; then
1179 ics_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001180else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001181 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001182fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001183
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001184#Wait for job to be updated
1185sleep_wait 120
1186
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001187if [ $ICS_VERSION == "V1-1" ]; then
1188 prodstub_check_jobdata 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template2.json
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001189else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001190 if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
1191 prodstub_check_jobdata_2 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001192 else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001193 prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template2.json
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001194 fi
BjornMagnussonXAc963b732021-01-20 14:24:13 +01001195fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001196
1197prodstub_arm_producer 200 prod-f 400
1198
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001199ics_api_edp_get_producer_status 200 prod-f DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001200
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001201if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1202 ics_equal json:data-producer/v1/info-producers 4 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001203else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001204 ics_equal json:ei-producer/v1/eiproducers 4 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001205fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001206
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001207if [ $ICS_VERSION == "V1-1" ]; then
1208 ics_api_edp_get_producer_ids 200 prod-b prod-c prod-d prod-e
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001209else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001210 ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
BjornMagnussonXA27db02f2021-01-19 08:13:00 +01001211fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001212
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001213ics_api_edp_get_producer_status 404 prod-a
1214ics_api_edp_get_producer_status 200 prod-b ENABLED
1215ics_api_edp_get_producer_status 200 prod-c ENABLED
1216ics_api_edp_get_producer_status 200 prod-d ENABLED
1217ics_api_edp_get_producer_status 200 prod-e ENABLED
1218ics_api_edp_get_producer_status 404 prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001219
1220if [ -z "$FLAT_A1_EI" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001221 ics_api_a1_get_job_status 200 type1 job1 DISABLED
1222 ics_api_a1_get_job_status 200 type1 job2 DISABLED
1223 ics_api_a1_get_job_status 200 type2 job3 ENABLED
1224 ics_api_a1_get_job_status 200 type4 job8 ENABLED
1225 ics_api_a1_get_job_status 200 type6 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001226else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001227 ics_api_a1_get_job_status 200 job1 DISABLED
1228 ics_api_a1_get_job_status 200 job2 DISABLED
1229 ics_api_a1_get_job_status 200 job3 ENABLED
1230 ics_api_a1_get_job_status 200 job8 ENABLED
1231 ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +01001232fi
1233
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001234if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001235 cr_equal 0 received_callbacks 14 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001236else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001237 cr_equal 0 received_callbacks 6 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001238fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +02001239
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001240
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001241if [[ "$ICS_FEATURE_LEVEL" != *"INFO-TYPES"* ]]; then
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001242
1243 # End test if info types is not impl in tested version
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001244 check_ics_logs
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001245
1246 store_logs END
1247
1248 #### TEST COMPLETE ####
1249
1250 print_result
1251
1252 auto_clean_environment
1253fi
1254
1255
1256############################################
1257# Test of info types
1258############################################
1259
1260### Setup prodstub sim to accept calls for producers, info types and jobs
1261## prod-ia type101
1262## prod-ib type101 and type102
1263## prod-ic no-type
1264## prod-id type104
1265## prod-ie type106
1266## prod-if type106
1267## prod-ig type150 (configured later)
1268## prod-ig type160 (configured later)
1269
1270## job101 -> prod-ia
1271## job102 -> prod-ia
1272## job103 -> prod-ib
1273## job104 -> prod-ia
1274## job106 -> prod-ib
1275## job108 -> prod-id
1276## job110 -> prod-ie and prod-if
1277## job150 -> prod-ig (configured later)
1278
1279prodstub_arm_producer 200 prod-ia
1280prodstub_arm_producer 200 prod-ib
1281prodstub_arm_producer 200 prod-ic
1282prodstub_arm_producer 200 prod-id
1283prodstub_arm_producer 200 prod-ie
1284prodstub_arm_producer 200 prod-if
1285
1286prodstub_arm_type 200 prod-ia type101
1287prodstub_arm_type 200 prod-ib type102
1288prodstub_arm_type 200 prod-ib type103
1289prodstub_arm_type 200 prod-id type104
1290prodstub_arm_type 200 prod-ie type106
1291prodstub_arm_type 200 prod-if type106
1292
1293prodstub_disarm_type 200 prod-ib type103
1294prodstub_arm_type 200 prod-ib type101
1295prodstub_disarm_type 200 prod-ib type101
1296
1297
1298prodstub_arm_job_create 200 prod-ia job101
1299prodstub_arm_job_create 200 prod-ia job102
1300prodstub_arm_job_create 200 prod-ib job103
1301
1302prodstub_arm_job_delete 200 prod-ia job101
1303prodstub_arm_job_delete 200 prod-ia job102
1304prodstub_arm_job_delete 200 prod-ib job103
1305
1306prodstub_arm_job_create 200 prod-ib job104
1307prodstub_arm_job_create 200 prod-ia job104
1308
1309prodstub_arm_job_create 200 prod-ib job106
1310
1311prodstub_arm_job_create 200 prod-id job108
1312
1313prodstub_arm_job_create 200 prod-ie job110
1314prodstub_arm_job_create 200 prod-if job110
1315
1316
1317# NOTE: types, jobs and producers are still present related to eitypes
1318
1319
1320### Initial tests - no config made
1321### GET: type ids, types, producer ids, producers, job ids, jobs
1322### DELETE: jobs
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001323ics_api_idc_get_type_ids 200 type1 type2 type4 type6
1324ics_api_idc_get_type 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001325
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001326ics_api_edp_get_type_ids 200 type1 type2 type4 type6
1327ics_api_edp_get_type_2 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001328
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001329ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
1330ics_api_edp_get_producer_2 404 test-prod
1331ics_api_edp_get_producer_status 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001332
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001333ics_api_edp_delete_producer 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001334
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001335ics_api_idc_get_job_ids 200 test-type NOWNER EMPTY
1336ics_api_idc_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001337
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001338ics_api_idc_get_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001339
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001340ics_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001341
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001342ics_api_idc_delete_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001343
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001344ics_api_edp_get_producer_jobs_2 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001345
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001346ics_api_edp_get_type_2 404 test-type
1347ics_api_edp_delete_type_2 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001348
1349### Setup of producer/job and testing apis ###
1350
1351## Setup prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001352ics_api_edp_get_type_ids 200 type1 type2 type4 type6
1353ics_api_edp_get_type_2 404 type101
1354ics_api_edp_put_producer_2 404 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001355
1356# Create type, delete and create again
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001357ics_api_edp_put_type_2 201 type101 testdata/ics/info-type-1.json
1358ics_api_edp_get_type_2 200 type101
1359ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1360ics_api_edp_delete_type_2 204 type101
1361ics_api_edp_get_type_2 404 type101
1362ics_api_edp_get_type_ids 200 type1 type2 type4 type6
1363ics_api_edp_put_type_2 201 type101 testdata/ics/info-type-1.json
1364ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1365ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001366
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001367ics_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1368ics_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001369
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001370if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1" ]]; then
1371 ics_api_edp_delete_type_2 409 type101
1372else
1373 ics_api_edp_delete_type_2 406 type101
1374fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001375
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001376if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001377 cr_equal 0 received_callbacks 17 30
1378 cr_equal 0 received_callbacks?id=type-status1 11
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001379 cr_api_check_all_ics_subscription_events 200 0 type-status1 type101 testdata/ics/info-type-1.json REGISTERED type101 testdata/ics/info-type-1.json DEREGISTERED type101 testdata/ics/info-type-1.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001380else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001381 cr_equal 0 received_callbacks 6
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001382fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001383
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001384ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1385ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001386
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001387ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-b prod-c prod-d prod-e
1388ics_api_edp_get_producer_ids_2 200 type101 prod-ia
1389ics_api_edp_get_producer_ids_2 200 type102 EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001390
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001391ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001392
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001393ics_api_edp_get_producer_status 200 prod-ia ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001394
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001395ics_api_idc_get_job_ids 200 type101 NOWNER EMPTY
1396ics_api_idc_get_job_ids 200 type101 test-owner EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001397
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001398ics_api_idc_get_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001399
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001400ics_api_idc_get_job_status2 404 test-job
1401ics_api_edp_get_producer_jobs_2 200 prod-ia EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001402
1403## Create a job for prod-ia
1404## job101 - prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001405ics_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001406
1407# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001408prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001409
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001410ics_api_idc_get_job_ids 200 type101 NOWNER job101
1411ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001412
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001413ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001414
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001415ics_api_idc_get_job 200 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001416
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001417ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001418
1419prodstub_equal create/prod-ia/job101 1
1420
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001421ics_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001422
1423## Create a second job for prod-ia
1424## job102 - prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001425ics_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001426
1427# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001428prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ics/job-template.json
1429ics_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1430ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
1431ics_api_idc_get_job_ids 200 type101 info-owner-2 job102
1432ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001433
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001434ics_api_idc_get_job 200 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001435
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001436ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001437
1438prodstub_equal create/prod-ia/job102 1
1439
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001440ics_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ics/job-template.json job102 type101 $TARGET102 info-owner-2 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001441
1442
1443## Setup prod-ib
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001444ics_api_edp_put_type_2 201 type102 testdata/ics/info-type-2.json
1445ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001446
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001447if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001448 cr_equal 0 received_callbacks 18 30
1449 cr_equal 0 received_callbacks?id=type-status1 12
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001450 cr_api_check_all_ics_subscription_events 200 0 type-status1 type102 testdata/ics/info-type-2.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001451else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001452 cr_equal 0 received_callbacks 6
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001453fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001454
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001455ics_api_idc_get_type_ids 200 type101 type102 type1 type2 type4 type6
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001456
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001457if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1458 ics_api_idc_get_type 200 type101 testdata/ics/info-type-1.json ENABLED 1
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001459
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001460 ics_api_idc_get_type 200 type102 testdata/ics/info-type-2.json ENABLED 1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001461else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001462 ics_api_idc_get_type 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001463
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001464 ics_api_idc_get_type 200 type102 testdata/ics/info-type-2.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001465fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001466
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001467ics_api_edp_get_type_ids 200 type101 type102 type1 type2 type4 type6
1468ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
1469ics_api_edp_get_type_2 200 type102 testdata/ics/info-type-2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001470
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001471ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001472
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001473ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1474ics_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001475
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001476ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001477
1478## Create job for prod-ib
1479## job103 - prod-ib
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001480ics_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001481
1482prodstub_equal create/prod-ib/job103 1
1483
1484# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001485prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001486
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001487ics_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1488ics_api_idc_get_job_ids 200 type102 NOWNER job103
1489ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
1490ics_api_idc_get_job_ids 200 type101 info-owner-2 job102
1491ics_api_idc_get_job_ids 200 type102 info-owner-3 job103
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001492
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001493ics_api_idc_get_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001494
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001495ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001496
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001497ics_api_edp_get_producer_jobs_2 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ics/job-template.json job102 type101 $TARGET102 info-owner-2 testdata/ics/job-template.json
1498ics_api_edp_get_producer_jobs_2 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001499
1500## Setup prod-ic (no types)
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001501ics_api_edp_put_producer_2 201 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic NOTYPE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001502
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001503ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001504
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001505ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1506ics_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1507ics_api_edp_get_producer_2 200 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001508
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001509ics_api_edp_get_producer_status 200 prod-ic ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001510
1511
1512## Delete job103 and prod-ib and re-create if different order
1513
1514# Delete job then producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001515ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1516ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001517
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001518ics_api_idc_delete_job 204 job103
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001519
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001520ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1521ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001522
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001523ics_api_edp_delete_producer 204 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001524
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001525ics_api_edp_get_producer_status 404 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001526
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001527ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1528ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001529
1530prodstub_equal delete/prod-ib/job103 1
1531
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001532ics_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json VALIDATE
1533ics_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001534
1535# Put producer then job
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001536ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001537
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001538ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001539
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001540ics_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template2.json VALIDATE
1541ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001542
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001543prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001544
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001545ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1546ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001547
1548prodstub_equal create/prod-ib/job103 3
1549prodstub_equal delete/prod-ib/job103 1
1550
1551# Delete only the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001552ics_api_edp_delete_producer 204 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001553
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001554ics_api_edp_get_producer_status 404 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001555
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001556ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1557ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ic prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001558
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001559ics_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001560
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001561if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001562 cr_equal 0 received_callbacks 19 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001563
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001564 cr_equal 0 received_callbacks?id=info-job103-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001565 cr_api_check_all_ics_events 200 0 info-job103-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001566else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001567 cr_equal 0 received_callbacks 7 30
1568 cr_equal 0 received_callbacks?id=info-job103-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001569 cr_api_check_all_ics_events 200 0 info-job103-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001570fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001571
1572# Re-create the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001573ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001574
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001575ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001576
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001577ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001578
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001579if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001580 cr_equal 0 received_callbacks 20 30
1581 cr_equal 0 received_callbacks?id=info-job103-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001582 cr_api_check_all_ics_events 200 0 info-job103-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001583else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001584 cr_equal 0 received_callbacks 8 30
1585 cr_equal 0 received_callbacks?id=info-job103-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001586 cr_api_check_all_ics_events 200 0 info-job103-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001587fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001588
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001589prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001590
1591## Setup prod-id
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001592ics_api_edp_put_type_2 201 type104 testdata/ics/info-type-4.json
1593ics_api_edp_put_producer_2 201 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001594
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001595ics_api_idc_get_job_ids 200 type104 NOWNER EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001596
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001597ics_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001598
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001599prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001600
1601prodstub_equal create/prod-id/job108 1
1602prodstub_equal delete/prod-id/job108 0
1603
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001604ics_api_idc_get_job_ids 200 type104 NOWNER job108
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001605
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001606ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001607
1608# Re-PUT the producer with zero types
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001609ics_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id NOTYPE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001610
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001611ics_api_idc_get_job_ids 200 type104 NOWNER job108
1612ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001613
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001614ics_api_idc_get_job_status2 200 job108 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001615
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001616if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001617 cr_equal 0 received_callbacks 22 30
1618 cr_equal 0 received_callbacks?id=type-status1 13
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001619 cr_api_check_all_ics_subscription_events 200 0 type-status1 type104 testdata/ics/info-type-4.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001620
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001621 cr_equal 0 received_callbacks?id=info-job108-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001622 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001623else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001624 cr_equal 0 received_callbacks 9 30
1625 cr_equal 0 received_callbacks?id=info-job108-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001626 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001627fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001628
1629prodstub_equal create/prod-id/job108 1
1630prodstub_equal delete/prod-id/job108 0
1631
1632## Re-setup prod-id
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001633ics_api_edp_put_type_2 200 type104 testdata/ics/info-type-4.json
1634ics_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001635
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001636
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001637ics_api_idc_get_job_ids 200 type104 NOWNER job108
1638ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001639
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001640ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001641
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001642ics_api_edp_get_producer_status 200 prod-ia ENABLED
1643ics_api_edp_get_producer_status 200 prod-ib ENABLED
1644ics_api_edp_get_producer_status 200 prod-ic ENABLED
1645ics_api_edp_get_producer_status 200 prod-id ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001646
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001647if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001648 cr_equal 0 received_callbacks 24 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001649
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001650 cr_equal 0 received_callbacks?id=type-status1 14
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001651 cr_api_check_all_ics_subscription_events 200 0 type-status1 type104 testdata/ics/info-type-4.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001652
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001653 cr_equal 0 received_callbacks?id=info-job108-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001654 cr_api_check_all_ics_events 200 0 info-job108-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001655else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001656 cr_equal 0 received_callbacks 10 30
1657 cr_equal 0 received_callbacks?id=info-job108-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001658 cr_api_check_all_ics_events 200 0 info-job108-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001659fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001660
1661prodstub_equal create/prod-id/job108 2
1662prodstub_equal delete/prod-id/job108 0
1663
1664
1665## Setup prod-ie
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001666ics_api_edp_put_type_2 201 type106 testdata/ics/info-type-6.json
1667ics_api_edp_put_producer_2 201 prod-ie $CB_JOB/prod-ie $CB_SV/prod-ie type106
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001668
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001669ics_api_idc_get_job_ids 200 type106 NOWNER EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001670
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001671ics_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001672
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001673prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001674
1675prodstub_equal create/prod-ie/job110 1
1676prodstub_equal delete/prod-ie/job110 0
1677
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001678ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001679
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001680ics_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001681
1682## Setup prod-if
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001683ics_api_edp_put_type_2 200 type106 testdata/ics/info-type-6.json
1684ics_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001685
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001686if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001687 cr_equal 0 received_callbacks 26 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001688
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001689 cr_equal 0 received_callbacks?id=type-status1 16
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001690 cr_api_check_all_ics_subscription_events 200 0 type-status1 type106 testdata/ics/info-type-6.json REGISTERED type106 testdata/ics/info-type-6.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001691fi
1692
1693
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001694ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001695
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001696prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001697
1698prodstub_equal create/prod-if/job110 1
1699prodstub_equal delete/prod-if/job110 0
1700
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001701ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001702
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001703ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001704
1705## Status updates prod-ia and jobs
1706
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001707ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001708
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001709ics_api_edp_get_producer_status 200 prod-ia ENABLED
1710ics_api_edp_get_producer_status 200 prod-ib ENABLED
1711ics_api_edp_get_producer_status 200 prod-ic ENABLED
1712ics_api_edp_get_producer_status 200 prod-id ENABLED
1713ics_api_edp_get_producer_status 200 prod-ie ENABLED
1714ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001715
1716# Arm producer prod-ia for supervision failure
1717prodstub_arm_producer 200 prod-ia 400
1718
1719# Wait for producer prod-ia to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001720ics_api_edp_get_producer_status 200 prod-ia DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001721
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001722ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001723
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001724ics_api_edp_get_producer_status 200 prod-ia DISABLED
1725ics_api_edp_get_producer_status 200 prod-ib ENABLED
1726ics_api_edp_get_producer_status 200 prod-ic ENABLED
1727ics_api_edp_get_producer_status 200 prod-id ENABLED
1728ics_api_edp_get_producer_status 200 prod-ie ENABLED
1729ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001730
1731
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001732ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1733ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1734ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1735ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1736ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001737
1738# Arm producer prod-ia for supervision
1739prodstub_arm_producer 200 prod-ia 200
1740
1741# Wait for producer prod-ia to go enabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001742ics_api_edp_get_producer_status 200 prod-ia ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001743
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001744ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001745
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001746ics_api_edp_get_producer_status 200 prod-ia ENABLED
1747ics_api_edp_get_producer_status 200 prod-ib ENABLED
1748ics_api_edp_get_producer_status 200 prod-ic ENABLED
1749ics_api_edp_get_producer_status 200 prod-id ENABLED
1750ics_api_edp_get_producer_status 200 prod-ie ENABLED
1751ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001752
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001753ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1754ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1755ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1756ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1757ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001758
1759# Arm producer prod-ia for supervision failure
1760prodstub_arm_producer 200 prod-ia 400
1761
1762# Wait for producer prod-ia to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001763ics_api_edp_get_producer_status 200 prod-ia DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001764
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001765ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001766
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001767ics_api_edp_get_producer_status 200 prod-ia DISABLED
1768ics_api_edp_get_producer_status 200 prod-ib ENABLED
1769ics_api_edp_get_producer_status 200 prod-ic ENABLED
1770ics_api_edp_get_producer_status 200 prod-id ENABLED
1771ics_api_edp_get_producer_status 200 prod-ie ENABLED
1772ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001773
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001774ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1775ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1776ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1777ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1778ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001779
1780# Wait for producer prod-ia to be removed
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001781if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1782 ics_equal json:data-producer/v1/info-producers 9 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001783else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001784 ics_equal json:ei-producer/v1/eiproducers 9 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001785fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001786
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001787ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001788
1789
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001790ics_api_edp_get_producer_status 404 prod-ia
1791ics_api_edp_get_producer_status 200 prod-ib ENABLED
1792ics_api_edp_get_producer_status 200 prod-ic ENABLED
1793ics_api_edp_get_producer_status 200 prod-id ENABLED
1794ics_api_edp_get_producer_status 200 prod-ie ENABLED
1795ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001796
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001797ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1798ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1799ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1800ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1801ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001802
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001803
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001804if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001805 cr_equal 0 received_callbacks 28 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001806
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001807 cr_equal 0 received_callbacks?id=info-job101-status 1
1808 cr_equal 0 received_callbacks?id=info-job102-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001809 cr_api_check_all_ics_events 200 0 info-job101-status DISABLED
1810 cr_api_check_all_ics_events 200 0 info-job102-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001811else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001812 cr_equal 0 received_callbacks 12 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001813
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001814 cr_equal 0 received_callbacks?id=info-job101-status 1
1815 cr_equal 0 received_callbacks?id=info-job102-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001816 cr_api_check_all_ics_events 200 0 info-job101-status DISABLED
1817 cr_api_check_all_ics_events 200 0 info-job102-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001818fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001819
1820
1821# Arm producer prod-ie for supervision failure
1822prodstub_arm_producer 200 prod-ie 400
1823
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001824ics_api_edp_get_producer_status 200 prod-ie DISABLED 1000
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001825
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001826ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001827
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001828ics_api_edp_get_producer_status 404 prod-ia
1829ics_api_edp_get_producer_status 200 prod-ib ENABLED
1830ics_api_edp_get_producer_status 200 prod-ic ENABLED
1831ics_api_edp_get_producer_status 200 prod-id ENABLED
1832ics_api_edp_get_producer_status 200 prod-ie DISABLED
1833ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001834
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001835ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1836ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1837ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1838ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1839ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001840
1841#Disable create for job110 in prod-ie
1842prodstub_arm_job_create 200 prod-ie job110 400
1843
1844#Update tjob 10 - only prod-if will be updated
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001845ics_api_idc_put_job 200 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ics/job-template2.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001846#Reset producer and job responses
1847prodstub_arm_producer 200 prod-ie 200
1848prodstub_arm_job_create 200 prod-ie job110 200
1849
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001850ics_api_edp_get_producer_status 200 prod-ie ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001851
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001852ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-if prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001853
1854#Wait for job to be updated
1855sleep_wait 120
1856
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001857prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001858
1859prodstub_arm_producer 200 prod-if 400
1860
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001861ics_api_edp_get_producer_status 200 prod-if DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001862
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001863if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
1864 ics_equal json:data-producer/v1/info-producers 8 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001865else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001866 ics_equal json:ei-producer/v1/eiproducers 8 1000
BjornMagnussonXAce4b14c2021-05-11 15:40:03 +02001867fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001868
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001869ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ib prod-ic prod-id prod-ie prod-b prod-c prod-d prod-e
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001870
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001871ics_api_edp_get_producer_status 404 prod-ia
1872ics_api_edp_get_producer_status 200 prod-ib ENABLED
1873ics_api_edp_get_producer_status 200 prod-ic ENABLED
1874ics_api_edp_get_producer_status 200 prod-id ENABLED
1875ics_api_edp_get_producer_status 200 prod-ie ENABLED
1876ics_api_edp_get_producer_status 404 prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001877
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001878ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1879ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1880ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1881ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1882ics_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001883
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001884if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001885 cr_equal 0 received_callbacks 28
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001886else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001887 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001888fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001889### Test of pre and post validation
1890
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001891ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1892ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
1893ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001894
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001895ics_api_idc_get_job_status2 404 job150
1896ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001897
1898prodstub_arm_producer 200 prod-ig
1899prodstub_arm_job_create 200 prod-ig job150
1900prodstub_arm_job_create 200 prod-ig job160
1901
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001902ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1903ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001904
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001905ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001906
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001907ics_api_idc_get_job_status2 404 job150
1908ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001909
1910prodstub_arm_type 200 prod-ig type160
1911
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001912ics_api_edp_put_type_2 201 type160 testdata/ics/info-type-60.json
1913ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001914
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001915ics_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1916ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
1917ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001918
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001919ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001920
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001921ics_api_idc_get_job_status2 404 job150
1922ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001923
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001924prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001925
1926prodstub_equal create/prod-ig/job160 1
1927prodstub_equal delete/prod-ig/job160 0
1928
1929prodstub_arm_type 200 prod-ig type150
1930
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001931ics_api_edp_put_type_2 201 type150 testdata/ics/info-type-50.json
1932ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160 type150
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001933
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001934if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001935 cr_equal 0 received_callbacks 30 30
1936 cr_equal 0 received_callbacks?id=type-status1 18
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001937 cr_api_check_all_ics_subscription_events 200 0 type-status1 type160 testdata/ics/info-type-60.json REGISTERED type150 testdata/ics/info-type-50.json REGISTERED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001938else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001939 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001940fi
1941
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001942ics_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1943ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001944
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001945ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001946
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001947ics_api_idc_get_job_status2 404 job150
1948ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001949
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001950ics_api_idc_put_job 201 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001951
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001952ics_api_idc_get_job_status2 200 job150 ENABLED 1 prod-ig 60
1953ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001954
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001955if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001956 cr_equal 0 received_callbacks 30 30
1957 cr_equal 0 received_callbacks?id=type-status1 18
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001958else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001959 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001960fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001961
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001962# Test job deletion at type delete
1963
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001964if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001965
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001966 if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1" ]]; then
1967 ics_api_edp_delete_type_2 409 type104
1968 else
1969 ics_api_edp_delete_type_2 406 type104
1970 fi
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001971
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001972 ics_api_edp_delete_producer 204 prod-id
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001973
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001974 ics_api_edp_delete_type_2 204 type104
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001975
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001976 cr_equal 0 received_callbacks 32 30
1977 cr_equal 0 received_callbacks?id=info-job108-status 3
1978 cr_equal 0 received_callbacks?id=type-status1 19
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001979 cr_api_check_all_ics_subscription_events 200 0 type-status1 type104 testdata/ics/info-type-4.json DEREGISTERED
1980 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001981
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001982 ics_api_edp_get_producer 404 prod-id
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001983
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001984 ics_api_idc_get_job 404 job-108
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001985
1986else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001987 cr_equal 0 received_callbacks 12
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001988fi
1989
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001990check_ics_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001991
1992store_logs END
1993
1994#### TEST COMPLETE ####
1995
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001996print_result
1997
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001998auto_clean_environment