blob: 5abaee597b5ebdedf2ece24093915c075721c137 [file] [log] [blame]
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001#!/bin/bash
2
3# ============LICENSE_START===============================================
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +02004# Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02005# ========================================================================
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
BjornMagnussonXA145762b2022-03-22 10:35:10 +010021TC_ONELINE_DESCR="ICS full interfaces walkthrough - with or without istio enabled"
22
BjornMagnussonXAf81090f2022-08-24 09:17:44 +020023USE_ISTIO=0
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020024
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010025#App names to include in the test when running docker, space separated list
BjornMagnussonXA007b6452021-11-29 08:03:38 +010026DOCKER_INCLUDED_IMAGES="ICS PRODSTUB CR RICSIM CP HTTPPROXY NGW KUBEPROXY"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010027
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010028#App names to include in the test when running kubernetes, space separated list
BjornMagnussonXA145762b2022-03-22 10:35:10 +010029if [ $USE_ISTIO -eq 0 ]; then
30 KUBE_INCLUDED_IMAGES="PRODSTUB CR ICS RICSIM CP HTTPPROXY KUBEPROXY NGW"
31else
32 KUBE_INCLUDED_IMAGES="PRODSTUB CR ICS RICSIM CP HTTPPROXY KUBEPROXY NGW KEYCLOAK ISTIO AUTHSIDECAR"
33fi
BjornMagnussonXAd54225b2023-04-19 14:03:49 +020034#Pre-started app (not started by script) to include in the test when running kubernetes, space separated list
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010035KUBE_PRESTARTED_IMAGES=""
36
37#Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
38#the image is not configured in the supplied env_file
39#Used for images not applicable to all supported profile
40CONDITIONALLY_IGNORED_IMAGES="NGW"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010041
42#Supported test environment profiles
BjornMagnussonXAf83c3622023-02-28 10:05:51 +010043SUPPORTED_PROFILES="ONAP-JAKARTA ONAP-KOHN ONAP-LONDON ORAN-F-RELEASE ORAN-G-RELEASE ORAN-H-RELEASE"
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010044#Supported run modes
45SUPPORTED_RUNMODES="DOCKER KUBE"
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020046
BjornMagnussonXA79e37002021-11-22 13:36:04 +010047. ../common/testcase_common.sh $@
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010048
49setup_testenvironment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020050
51#### TEST BEGIN ####
52
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +010053clean_environment
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020054
BjornMagnussonXA8fbc6362022-04-19 09:39:22 +020055if [ $RUNMODE != "KUBE" ]; then
56 USE_ISTIO=0
57 echo "ISTIO not supported by docker - setting USE-ISTIO=0"
58fi
59
BjornMagnussonXA145762b2022-03-22 10:35:10 +010060if [ $USE_ISTIO -eq 1 ]; then
61 echo -e $RED"#########################################"$ERED
62 echo -e $RED"# Work around istio jwks cache"$ERED
63 echo -e $RED"# Cycle istiod down and up to clear cache"$ERED
64 echo ""
65 __kube_scale deployment istiod istio-system 0
66 __kube_scale deployment istiod istio-system 1
67 echo -e $RED"# Cycle istiod done"
68 echo -e $RED"#########################################"$ERED
BjornMagnussonXAcd938442022-05-11 10:01:24 +020069 echo ""
BjornMagnussonXA145762b2022-03-22 10:35:10 +010070
71 istio_enable_istio_namespace $KUBE_SIM_NAMESPACE
72 istio_enable_istio_namespace $KUBE_NONRTRIC_NAMESPACE
BjornMagnussonXA8fbc6362022-04-19 09:39:22 +020073 istio_enable_istio_namespace $KUBE_A1SIM_NAMESPACE
BjornMagnussonXA145762b2022-03-22 10:35:10 +010074fi
75
BjornMagnussonXA663566c2021-11-08 10:25:07 +010076start_kube_proxy
BjornMagnussonXA145762b2022-03-22 10:35:10 +010077set_kubeproxy_debug
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010078
BjornMagnussonXA145762b2022-03-22 10:35:10 +010079if [ $USE_ISTIO -eq 1 ]; then
80 use_ics_rest_http
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020081
BjornMagnussonXA145762b2022-03-22 10:35:10 +010082 use_prod_stub_http
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010083
BjornMagnussonXA145762b2022-03-22 10:35:10 +010084 use_simulator_http
BjornMagnussonXA7b36db62020-11-23 10:57:57 +010085
BjornMagnussonXA145762b2022-03-22 10:35:10 +010086 use_cr_http
87else
88 use_ics_rest_https
89
90 use_prod_stub_https
91
92 use_simulator_https
93
94 use_cr_https
95fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +020096
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +010097start_http_proxy
BjornMagnussonXAc963b732021-01-20 14:24:13 +010098
BjornMagnussonXA145762b2022-03-22 10:35:10 +010099if [ $USE_ISTIO -eq 1 ]; then
100 start_keycloak
101
102 keycloak_api_obtain_admin_token
103
104 keycloak_api_create_realm nrtrealm true 60
105 keycloak_api_create_confidential_client nrtrealm icsc
106 keycloak_api_generate_client_secret nrtrealm icsc
107 keycloak_api_get_client_secret nrtrealm icsc
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200108 keycloak_api_create_client_roles nrtrealm icsc nrtrole
109 keycloak_api_map_client_roles nrtrealm icsc nrtrole
BjornMagnussonXA145762b2022-03-22 10:35:10 +0100110
111 keycloak_api_get_client_token nrtrealm icsc
112
113 CLIENT_TOKEN=$(keycloak_api_read_client_token nrtrealm icsc)
114 echo "CLIENT_TOKEN: "$CLIENT_TOKEN
115
116 ICS_SEC=$(keycloak_api_read_client_secret nrtrealm icsc)
117 echo "ICS_SEC: "$ICS_SEC
118
119 istio_req_auth_by_jwks $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
120 istio_auth_policy_by_issuer $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
121
122 istio_req_auth_by_jwksuri $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200123 istio_auth_policy_by_realm $PROD_STUB_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm icsc nrtrole
BjornMagnussonXA145762b2022-03-22 10:35:10 +0100124
125 istio_req_auth_by_jwks $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY "$KUBE_PROXY_ISTIO_JWKS_KEYS"
126 istio_auth_policy_by_issuer $CR_APP_NAME $KUBE_SIM_NAMESPACE KUBEPROXY
127
128 istio_req_auth_by_jwksuri $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200129 istio_auth_policy_by_realm $CR_APP_NAME $KUBE_SIM_NAMESPACE nrtrealm icsc nrtrole
BjornMagnussonXA145762b2022-03-22 10:35:10 +0100130
131 ics_configure_sec nrtrealm icsc $ICS_SEC
132
133fi
134
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100135start_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 +0100136
137if [ $RUNMODE == "KUBE" ]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100138 ics_api_admin_reset
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100139fi
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200140
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200141start_prod_stub
142
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100143set_ics_debug
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200144
BjornMagnussonXAbe9a07f2021-02-25 10:51:46 +0100145start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE
146
147if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then
148 start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE
149fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100150
BjornMagnussonXAf83c3622023-02-28 10:05:51 +0100151start_ric_simulators ricsim_g3 4 STD_2.0.0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100152
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100153start_cr 1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100154
BjornMagnussonXAcd938442022-05-11 10:01:24 +0200155if [ $USE_ISTIO -eq 1 ]; then
156 echo "Sleep 120 to let istio settle - enabling istio on workloads may cause initial dns disturbances - temporary unavailable dns names"
157 sleep 120
158fi
159
BjornMagnussonXAe0b665e2021-01-08 22:19:18 +0100160CB_JOB="$PROD_STUB_SERVICE_PATH$PROD_STUB_JOB_CALLBACK"
161CB_SV="$PROD_STUB_SERVICE_PATH$PROD_STUB_SUPERVISION_CALLBACK"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200162#Targets for ei jobs
BjornMagnussonXA145762b2022-03-22 10:35:10 +0100163if [ $RUNMODE == "KUBE" ]; then
164 TARGET1="$RIC_SIM_HTTPX://ricsim-g3-1.ricsim-g3.$KUBE_A1SIM_NAMESPACE:$RIC_SIM_PORT/datadelivery"
165 TARGET2="$RIC_SIM_HTTPX://ricsim-g3-2.ricsim-g3.$KUBE_A1SIM_NAMESPACE:$RIC_SIM_PORT/datadelivery"
166 TARGET3="$RIC_SIM_HTTPX://ricsim-g3-3.ricsim-g3.$KUBE_A1SIM_NAMESPACE:$RIC_SIM_PORT/datadelivery"
167 TARGET8="$RIC_SIM_HTTPX://ricsim-g3-4.ricsim-g3.$KUBE_A1SIM_NAMESPACE:$RIC_SIM_PORT/datadelivery"
168 TARGET10="$RIC_SIM_HTTPX://ricsim-g3-4.ricsim-g3.$KUBE_A1SIM_NAMESPACE:$RIC_SIM_PORT/datadelivery"
169else
170 TARGET1="$RIC_SIM_HTTPX://ricsim_g3_1:$RIC_SIM_PORT/datadelivery"
171 TARGET2="$RIC_SIM_HTTPX://ricsim_g3_2:$RIC_SIM_PORT/datadelivery"
172 TARGET3="$RIC_SIM_HTTPX://ricsim_g3_3:$RIC_SIM_PORT/datadelivery"
173 TARGET8="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
174 TARGET10="$RIC_SIM_HTTPX://ricsim_g3_4:$RIC_SIM_PORT/datadelivery"
175fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100176
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200177#Targets for info jobs
178TARGET101="http://localhost:80/target" # Dummy target, no target for info data in this env...
179TARGET102="http://localhost:80/target" # Dummy target, no target for info data in this env...
180TARGET103="http://localhost:80/target" # Dummy target, no target for info data in this env...
181TARGET108="http://localhost:80/target" # Dummy target, no target for info data in this env...
182TARGET110="http://localhost:80/target" # Dummy target, no target for info data in this env...
183TARGET150="http://localhost:80/target" # Dummy target, no target for info data in this env...
184TARGET160="http://localhost:80/target" # Dummy target, no target for info data in this env...
185
186#Status callbacks for eijobs
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100187STATUS1="$CR_SERVICE_APP_PATH_0/job1-status"
188STATUS2="$CR_SERVICE_APP_PATH_0/job2-status"
189STATUS3="$CR_SERVICE_APP_PATH_0/job3-status"
190STATUS8="$CR_SERVICE_APP_PATH_0/job8-status"
191STATUS10="$CR_SERVICE_APP_PATH_0/job10-status"
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100192
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200193#Status callbacks for infojobs
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100194INFOSTATUS101="$CR_SERVICE_APP_PATH_0/info-job101-status"
195INFOSTATUS102="$CR_SERVICE_APP_PATH_0/info-job102-status"
196INFOSTATUS103="$CR_SERVICE_APP_PATH_0/info-job103-status"
197INFOSTATUS108="$CR_SERVICE_APP_PATH_0/info-job108-status"
198INFOSTATUS110="$CR_SERVICE_APP_PATH_0/info-job110-status"
199INFOSTATUS150="$CR_SERVICE_APP_PATH_0/info-job150-status"
200INFOSTATUS160="$CR_SERVICE_APP_PATH_0/info-job160-status"
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200201
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100202if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200203 #Type registration status callbacks
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100204 TYPESTATUS1="$CR_SERVICE_APP_PATH_0/type-status1"
205 TYPESTATUS2="$CR_SERVICE_APP_PATH_0/type-status2"
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200206
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100207 ics_api_idc_put_subscription 201 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200208
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100209 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200210
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100211 ics_api_idc_get_subscription_ids 200 owner1 subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200212
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100213 ics_api_idc_get_subscription_ids 200 test EMPTY
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200214
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100215 ics_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200216
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100217 ics_api_idc_get_subscription 404 test
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200218
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100219 ics_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200220
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100221 ics_api_idc_put_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200222
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100223 ics_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200224
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100225 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200226
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100227 ics_api_idc_get_subscription_ids 200 owner1 subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200228
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100229 ics_api_idc_get_subscription_ids 200 owner2 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200230
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100231 ics_api_idc_get_subscription 200 subscription-id-1 owner1 $TYPESTATUS1
232 ics_api_idc_get_subscription 200 subscription-id-2 owner2 $TYPESTATUS2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200233
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100234 ics_api_idc_delete_subscription 204 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200235
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100236 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200237
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100238 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200239
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100240 cr_equal 0 received_callbacks 1 30
241 cr_equal 0 received_callbacks?id=type-status1 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100242 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 +0200243
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100244 ics_api_edp_delete_type_2 204 type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200245
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100246 cr_equal 0 received_callbacks 2 30
247 cr_equal 0 received_callbacks?id=type-status1 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100248 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 +0200249
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100250 ics_api_idc_put_subscription 201 subscription-id-2 owner2 $TYPESTATUS2
251 ics_api_idc_get_subscription_ids 200 NOOWNER subscription-id-1 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200252
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100253 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200254
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100255 cr_equal 0 received_callbacks 4 30
256 cr_equal 0 received_callbacks?id=type-status1 3
257 cr_equal 0 received_callbacks?id=type-status2 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100258 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 +0200259
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100260 ics_api_idc_delete_subscription 204 subscription-id-2
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200261
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100262 ics_api_edp_delete_type_2 204 type1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200263
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100264 cr_equal 0 received_callbacks 5 30
265 cr_equal 0 received_callbacks?id=type-status1 4
266 cr_equal 0 received_callbacks?id=type-status2 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100267 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 +0200268
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100269 cr_api_reset 0
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200270fi
271
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100272### Setup prodstub sim to accept calls for producers, types and jobs
273## prod-a type1
274## prod-b type1 and type2
275## prod-c no-type
276## prod-d type4
277## prod-e type6
278## prod-f type6
279
280## job1 -> prod-a
281## job2 -> prod-a
282## job3 -> prod-b
283## job4 -> prod-a
284## job6 -> prod-b
285## job8 -> prod-d
286## job10 -> prod-e and prod-f
287
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200288prodstub_arm_producer 200 prod-a
289prodstub_arm_producer 200 prod-b
290prodstub_arm_producer 200 prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200291prodstub_arm_producer 200 prod-d
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100292prodstub_arm_producer 200 prod-e
293prodstub_arm_producer 200 prod-f
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200294
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200295prodstub_arm_type 200 prod-a type1
296prodstub_arm_type 200 prod-b type2
297prodstub_arm_type 200 prod-b type3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100298prodstub_arm_type 200 prod-d type4
299prodstub_arm_type 200 prod-e type6
300prodstub_arm_type 200 prod-f type6
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200301
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200302prodstub_disarm_type 200 prod-b type3
303prodstub_arm_type 200 prod-b type1
304prodstub_disarm_type 200 prod-b type1
305
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100306
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200307prodstub_arm_job_create 200 prod-a job1
308prodstub_arm_job_create 200 prod-a job2
309prodstub_arm_job_create 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200310
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200311prodstub_arm_job_delete 200 prod-a job1
312prodstub_arm_job_delete 200 prod-a job2
313prodstub_arm_job_delete 200 prod-b job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200314
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200315prodstub_arm_job_create 200 prod-b job4
316prodstub_arm_job_create 200 prod-a job4
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200317
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200318prodstub_arm_job_create 200 prod-b job6
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200319
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100320prodstub_arm_job_create 200 prod-d job8
321
322prodstub_arm_job_create 200 prod-e job10
323prodstub_arm_job_create 200 prod-f job10
324
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100325### ics status
326ics_api_service_status 200
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200327
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100328cr_equal 0 received_callbacks 0
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100329
330### Initial tests - no config made
331### GET: type ids, types, producer ids, producers, job ids, jobs
332### DELETE: jobs
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100333ics_api_a1_get_type_ids 200 EMPTY
334ics_api_a1_get_type 404 test-type
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +0200335
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100336ics_api_edp_get_type_ids 200 EMPTY
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200337ics_api_edp_get_type_2 404 test-type
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200338
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200339ics_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
340ics_api_edp_get_producer_2 404 test-prod
341
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100342ics_api_edp_get_producer_status 404 test-prod
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200343
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100344ics_api_edp_delete_producer 404 test-prod
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200345
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200346ics_api_a1_get_job_ids 200 test-type NOWNER EMPTY
347ics_api_a1_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200348
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200349ics_api_a1_get_job 404 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200350
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200351ics_api_a1_get_job_status 404 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200352
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200353ics_api_a1_delete_job 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100354
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200355ics_api_edp_get_producer_ids_2 200 NOTYPE EMPTY
356ics_api_edp_get_producer_2 404 test-prod
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100357
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200358ics_api_edp_get_type_2 404 test-type
359ics_api_edp_delete_type_2 404 test-type
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100361### Setup of producer/job and testing apis ###
362
363## Setup prod-a
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200364ics_api_edp_get_type_ids 200 EMPTY
365ics_api_edp_get_type_2 404 type1
366ics_api_edp_put_producer_2 404 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
367
368# Create type, delete and create again
369ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
370ics_api_edp_get_type_2 200 type1
371ics_api_edp_get_type_ids 200 type1
372ics_api_edp_delete_type_2 204 type1
373ics_api_edp_get_type_2 404 type1
374ics_api_edp_get_type_ids 200 EMPTY
375if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
376 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100377else
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100378 ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200379fi
380ics_api_edp_get_type_ids 200 type1
381if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
382 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
383else
384 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100385fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100386
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200387ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
388ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
389
390if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
391 cr_equal 0 received_callbacks 3 30
392 cr_equal 0 received_callbacks?id=type-status1 3
393 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
394else
395 cr_equal 0 received_callbacks 0
396fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200397
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100398ics_api_a1_get_type_ids 200 type1
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200399ics_api_a1_get_type 200 type1 testdata/ics/empty-type.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200400
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100401ics_api_edp_get_type_ids 200 type1
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200402if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
403 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100404else
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200405 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100406fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200407
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200408ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a
409ics_api_edp_get_producer_ids_2 200 type1 prod-a
410ics_api_edp_get_producer_ids_2 200 type2 EMPTY
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100411
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200412ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200413
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100414ics_api_edp_get_producer_status 200 prod-a ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200415
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100416ics_api_a1_get_job_ids 200 type1 NOWNER EMPTY
417ics_api_a1_get_job_ids 200 type1 test-owner EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200418
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200419ics_api_a1_get_job 404 test-job
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200420
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200421ics_api_a1_get_job_status 404 test-job
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100422
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200423ics_api_edp_get_producer_jobs_2 200 prod-a EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200424
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100425## Create a job for prod-a
426## job1 - prod-a
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200427ics_api_a1_put_job 201 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200428
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100429# Check the job data in the producer
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200430prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200431
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100432ics_api_a1_get_job_ids 200 type1 NOWNER job1
433ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100434
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200435ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200436
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200437ics_api_a1_get_job 200 job1 type1 $TARGET1 ricsim_g3_1 $STATUS1 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200438
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200439ics_api_a1_get_job_status 200 job1 ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200440
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100441prodstub_equal create/prod-a/job1 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200442
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200443ics_api_edp_get_producer_jobs_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
444
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200445
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100446## Create a second job for prod-a
447## job2 - prod-a
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200448ics_api_a1_put_job 201 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200449
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100450# Check the job data in the producer
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200451prodstub_check_jobdata_3 200 prod-a job2 type1 $TARGET2 ricsim_g3_2 testdata/ics/job-template.json
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100452ics_api_a1_get_job_ids 200 type1 NOWNER job1 job2
453ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
454ics_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200455ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200456
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200457ics_api_a1_get_job 200 job2 type1 $TARGET2 ricsim_g3_2 $STATUS2 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200458
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200459ics_api_a1_get_job_status 200 job2 ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200460
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100461prodstub_equal create/prod-a/job2 1
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200462
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200463ics_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
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200464
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100465## Setup prod-b
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200466ics_api_edp_put_type_2 201 type2 testdata/ics/ei-type-2.json
467ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
468if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
469 cr_equal 0 received_callbacks 4 30
470 cr_equal 0 received_callbacks?id=type-status1 4
471 cr_api_check_all_ics_subscription_events 200 0 type-status1 type2 testdata/ics/ei-type-2.json REGISTERED
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100472else
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200473 cr_equal 0 received_callbacks 0
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100474fi
475
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200476
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100477ics_api_a1_get_type_ids 200 type1 type2
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200478
479ics_api_a1_get_type 200 type1 testdata/ics/empty-type.json
480ics_api_a1_get_type 200 type2 testdata/ics/empty-type.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200481
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100482ics_api_edp_get_type_ids 200 type1 type2
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200483if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPE-INFO"* ]]; then
484 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json testdata/ics/info-type-info.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100485else
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200486 ics_api_edp_get_type_2 200 type1 testdata/ics/ei-type-1.json
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100487fi
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200488ics_api_edp_get_type_2 200 type2 testdata/ics/ei-type-2.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200489
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200490ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100491
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200492ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
493ics_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200494
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100495ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200496
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100497## Create job for prod-b
498## job3 - prod-b
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200499ics_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200500
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100501prodstub_equal create/prod-b/job3 1
502
503# Check the job data in the producer
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200504prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200505
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100506ics_api_a1_get_job_ids 200 type1 NOWNER job1 job2
507ics_api_a1_get_job_ids 200 type2 NOWNER job3
508ics_api_a1_get_job_ids 200 type1 ricsim_g3_1 job1
509ics_api_a1_get_job_ids 200 type1 ricsim_g3_2 job2
510ics_api_a1_get_job_ids 200 type2 ricsim_g3_3 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200511
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200512ics_api_a1_get_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200513
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200514ics_api_a1_get_job_status 200 job3 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100515
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200516ics_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
517ics_api_edp_get_producer_jobs_2 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template.json
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200518
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200519
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100520## Setup prod-c (no types)
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200521ics_api_edp_put_producer_2 201 prod-c $CB_JOB/prod-c $CB_SV/prod-c NOTYPE
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100522
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200523ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200524
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200525ics_api_edp_get_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
526ics_api_edp_get_producer_2 200 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
527ics_api_edp_get_producer_2 200 prod-c $CB_JOB/prod-c $CB_SV/prod-c EMPTY
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200528
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100529ics_api_edp_get_producer_status 200 prod-c ENABLED
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200530
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100531
532## Delete job3 and prod-b and re-create if different order
533
534# Delete job then producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100535ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200536ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100537
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200538ics_api_a1_delete_job 204 job3
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200539
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100540ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200541ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100542
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100543ics_api_edp_delete_producer 204 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200544
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100545ics_api_edp_get_producer_status 404 prod-b
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200546
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100547ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200548ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200549
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100550prodstub_equal delete/prod-b/job3 1
551
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200552ics_api_a1_put_job 201 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template.json
553ics_api_a1_get_job_status 200 job3 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100554
555# Put producer then job
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200556ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100557
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100558ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100559
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200560 ics_api_a1_put_job 200 job3 type2 $TARGET3 ricsim_g3_3 $STATUS3 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100561
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200562ics_api_a1_get_job_status 200 job3 ENABLED
563
564prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100565
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100566ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200567ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100568
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200569prodstub_equal create/prod-b/job3 3
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100570prodstub_equal delete/prod-b/job3 1
571
572# Delete only the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100573ics_api_edp_delete_producer 204 prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100574
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100575ics_api_edp_get_producer_status 404 prod-b
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100576
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100577ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200578ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-c
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100579
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200580ics_api_a1_get_job_status 200 job3 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100581
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100582if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100583 cr_equal 0 received_callbacks 5 30
584 cr_equal 0 received_callbacks?id=type-status1 4
585 cr_equal 0 received_callbacks?id=job3-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100586 cr_api_check_all_ics_events 200 0 job3-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200587else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100588 cr_equal 0 received_callbacks 1 30
589 cr_equal 0 received_callbacks?id=job3-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100590 cr_api_check_all_ics_events 200 0 job3-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200591fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100592
593# Re-create the producer
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200594ics_api_edp_put_producer_2 201 prod-b $CB_JOB/prod-b $CB_SV/prod-b type2
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100595
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100596ics_api_edp_get_producer_status 200 prod-b ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100597
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200598ics_api_a1_get_job_status 200 job3 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100599
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100600if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100601 cr_equal 0 received_callbacks 6 30
602 cr_equal 0 received_callbacks?id=type-status1 4
603 cr_equal 0 received_callbacks?id=job3-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100604 cr_api_check_all_ics_events 200 0 job3-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200605else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100606 cr_equal 0 received_callbacks 2 30
607 cr_equal 0 received_callbacks?id=job3-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100608 cr_api_check_all_ics_events 200 0 job3-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200609fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100610
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200611prodstub_check_jobdata_3 200 prod-b job3 type2 $TARGET3 ricsim_g3_3 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100612
613## Setup prod-d
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200614ics_api_edp_put_type_2 201 type4 testdata/ics/ei-type-4.json
615ics_api_edp_put_producer_2 201 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200616
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100617if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100618 cr_equal 0 received_callbacks 7 30
619 cr_equal 0 received_callbacks?id=type-status1 5
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100620 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 +0200621fi
622
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100623ics_api_a1_get_job_ids 200 type4 NOWNER EMPTY
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200624
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200625ics_api_a1_put_job 201 job8 type4 $TARGET8 ricsim_g3_4 $STATUS8 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100626
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200627prodstub_check_jobdata_3 200 prod-d job8 type4 $TARGET8 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100628
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200629prodstub_equal create/prod-d/job8 1
630prodstub_equal delete/prod-d/job8 0
631
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100632ics_api_a1_get_job_ids 200 type4 NOWNER job8
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200633
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200634ics_api_a1_get_job_status 200 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100635
636# Re-PUT the producer with zero types
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200637ics_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d NOTYPE
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200638
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200639ics_api_a1_get_job_ids 200 type4 NOWNER job8
640ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200641
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200642ics_api_a1_get_job_status 200 job8 DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100643
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100644if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100645 cr_equal 0 received_callbacks 8 30
646 cr_equal 0 received_callbacks?id=type-status1 5
647 cr_equal 0 received_callbacks?id=job8-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100648 cr_api_check_all_ics_events 200 0 job8-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200649else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100650 cr_equal 0 received_callbacks 3 30
651 cr_equal 0 received_callbacks?id=job8-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100652 cr_api_check_all_ics_events 200 0 job8-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200653fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100654
BjornMagnussonXA39ad50e2020-10-22 09:55:25 +0200655prodstub_equal create/prod-d/job8 1
656prodstub_equal delete/prod-d/job8 0
657
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100658## Re-setup prod-d
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200659ics_api_edp_put_type_2 200 type4 testdata/ics/ei-type-4.json
660ics_api_edp_put_producer_2 200 prod-d $CB_JOB/prod-d $CB_SV/prod-d type4
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100661
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200662ics_api_a1_get_job_ids 200 type4 NOWNER job8
663ics_api_a1_get_job_ids 200 NOTYPE NOWNER job1 job2 job3 job8
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100664
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200665ics_api_a1_get_job_status 200 job8 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100666
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100667ics_api_edp_get_producer_status 200 prod-a ENABLED
668ics_api_edp_get_producer_status 200 prod-b ENABLED
669ics_api_edp_get_producer_status 200 prod-c ENABLED
670ics_api_edp_get_producer_status 200 prod-d ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100671
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100672if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100673 cr_equal 0 received_callbacks 10 30
674 cr_equal 0 received_callbacks?id=type-status1 6
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100675 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 +0200676
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100677 cr_equal 0 received_callbacks?id=job8-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100678 cr_api_check_all_ics_events 200 0 job8-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200679else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100680 cr_equal 0 received_callbacks 4 30
681 cr_equal 0 received_callbacks?id=job8-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100682 cr_api_check_all_ics_events 200 0 job8-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200683fi
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100684
685prodstub_equal create/prod-d/job8 2
686prodstub_equal delete/prod-d/job8 0
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100687
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100688## Setup prod-e
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200689ics_api_edp_put_type_2 201 type6 testdata/ics/ei-type-6.json
690ics_api_edp_put_producer_2 201 prod-e $CB_JOB/prod-e $CB_SV/prod-e type6
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100691
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100692if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100693 cr_equal 0 received_callbacks 11 30
694 cr_equal 0 received_callbacks?id=type-status1 7
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100695 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 +0200696fi
697
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100698ics_api_a1_get_job_ids 200 type6 NOWNER EMPTY
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100699
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200700ics_api_a1_put_job 201 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100701
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200702prodstub_check_jobdata_3 200 prod-e job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100703
704prodstub_equal create/prod-e/job10 1
705prodstub_equal delete/prod-e/job10 0
706
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100707ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100708
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200709ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100710
711## Setup prod-f
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200712ics_api_edp_put_type_2 200 type6 testdata/ics/ei-type-6.json
713ics_api_edp_put_producer_2 201 prod-f $CB_JOB/prod-f $CB_SV/prod-f type6
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100714
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100715if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100716 cr_equal 0 received_callbacks 12 30
717 cr_equal 0 received_callbacks?id=type-status1 8
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100718 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 +0200719fi
720
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100721ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100722
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200723prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100724
725prodstub_equal create/prod-f/job10 1
726prodstub_equal delete/prod-f/job10 0
727
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100728ics_api_a1_get_job_ids 200 type6 NOWNER job10
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100729
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200730ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100731
732## Status updates prod-a and jobs
733
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200734ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100735
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100736ics_api_edp_get_producer_status 200 prod-a ENABLED
737ics_api_edp_get_producer_status 200 prod-b ENABLED
738ics_api_edp_get_producer_status 200 prod-c ENABLED
739ics_api_edp_get_producer_status 200 prod-d ENABLED
740ics_api_edp_get_producer_status 200 prod-e ENABLED
741ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100742
743# Arm producer prod-a for supervision failure
744prodstub_arm_producer 200 prod-a 400
745
746# Wait for producer prod-a to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100747ics_api_edp_get_producer_status 200 prod-a DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100748
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200749ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100750
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100751ics_api_edp_get_producer_status 200 prod-a DISABLED
752ics_api_edp_get_producer_status 200 prod-b ENABLED
753ics_api_edp_get_producer_status 200 prod-c ENABLED
754ics_api_edp_get_producer_status 200 prod-d ENABLED
755ics_api_edp_get_producer_status 200 prod-e ENABLED
756ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100757
758
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200759ics_api_a1_get_job_status 200 job1 ENABLED
760ics_api_a1_get_job_status 200 job2 ENABLED
761ics_api_a1_get_job_status 200 job3 ENABLED
762ics_api_a1_get_job_status 200 job8 ENABLED
763ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA4207b832020-11-03 09:52:49 +0100764
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100765# Arm producer prod-a for supervision
766prodstub_arm_producer 200 prod-a 200
767
768# Wait for producer prod-a to go enabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100769ics_api_edp_get_producer_status 200 prod-a ENABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100770
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200771ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100772
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100773ics_api_edp_get_producer_status 200 prod-a ENABLED
774ics_api_edp_get_producer_status 200 prod-b ENABLED
775ics_api_edp_get_producer_status 200 prod-c ENABLED
776ics_api_edp_get_producer_status 200 prod-d ENABLED
777ics_api_edp_get_producer_status 200 prod-e ENABLED
778ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100779
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200780ics_api_a1_get_job_status 200 job1 ENABLED
781ics_api_a1_get_job_status 200 job2 ENABLED
782ics_api_a1_get_job_status 200 job3 ENABLED
783ics_api_a1_get_job_status 200 job8 ENABLED
784ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100785
786# Arm producer prod-a for supervision failure
787prodstub_arm_producer 200 prod-a 400
788
789# Wait for producer prod-a to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100790ics_api_edp_get_producer_status 200 prod-a DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100791
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200792ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100793
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100794ics_api_edp_get_producer_status 200 prod-a DISABLED
795ics_api_edp_get_producer_status 200 prod-b ENABLED
796ics_api_edp_get_producer_status 200 prod-c ENABLED
797ics_api_edp_get_producer_status 200 prod-d ENABLED
798ics_api_edp_get_producer_status 200 prod-e ENABLED
799ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100800
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200801ics_api_a1_get_job_status 200 job1 ENABLED
802ics_api_a1_get_job_status 200 job2 ENABLED
803ics_api_a1_get_job_status 200 job3 ENABLED
804ics_api_a1_get_job_status 200 job8 ENABLED
805ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100806
807# Wait for producer prod-a to be removed
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200808ics_equal json:data-producer/v1/info-producers 5 1000
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100809
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200810ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100811
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100812
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100813ics_api_edp_get_producer_status 404 prod-a
814ics_api_edp_get_producer_status 200 prod-b ENABLED
815ics_api_edp_get_producer_status 200 prod-c ENABLED
816ics_api_edp_get_producer_status 200 prod-d ENABLED
817ics_api_edp_get_producer_status 200 prod-e ENABLED
818ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100819
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200820ics_api_a1_get_job_status 200 job1 DISABLED
821ics_api_a1_get_job_status 200 job2 DISABLED
822ics_api_a1_get_job_status 200 job3 ENABLED
823ics_api_a1_get_job_status 200 job8 ENABLED
824ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100825
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100826if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100827 cr_equal 0 received_callbacks 14 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200828else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100829 cr_equal 0 received_callbacks 6 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200830fi
831
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100832cr_equal 0 received_callbacks?id=job1-status 1
833cr_equal 0 received_callbacks?id=job2-status 1
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100834
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100835cr_api_check_all_ics_events 200 0 job1-status DISABLED
836cr_api_check_all_ics_events 200 0 job2-status DISABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100837
838
839# Arm producer prod-e for supervision failure
840prodstub_arm_producer 200 prod-e 400
841
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100842ics_api_edp_get_producer_status 200 prod-e DISABLED 1000
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100843
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200844ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100845
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100846ics_api_edp_get_producer_status 404 prod-a
847ics_api_edp_get_producer_status 200 prod-b ENABLED
848ics_api_edp_get_producer_status 200 prod-c ENABLED
849ics_api_edp_get_producer_status 200 prod-d ENABLED
850ics_api_edp_get_producer_status 200 prod-e DISABLED
851ics_api_edp_get_producer_status 200 prod-f ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100852
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200853ics_api_a1_get_job_status 200 job1 DISABLED
854ics_api_a1_get_job_status 200 job2 DISABLED
855ics_api_a1_get_job_status 200 job3 ENABLED
856ics_api_a1_get_job_status 200 job8 ENABLED
857ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100858
859#Disable create for job10 in prod-e
860prodstub_arm_job_create 200 prod-e job10 400
861
862#Update tjob 10 - only prod-f will be updated
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200863ics_api_a1_put_job 200 job10 type6 $TARGET10 ricsim_g3_4 $STATUS10 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100864#Reset producer and job responses
865prodstub_arm_producer 200 prod-e 200
866prodstub_arm_job_create 200 prod-e job10 200
867
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100868ics_api_edp_get_producer_status 200 prod-e ENABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100869
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200870ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100871
BjornMagnussonXA27db02f2021-01-19 08:13:00 +0100872#Wait for job to be updated
873sleep_wait 120
874
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200875prodstub_check_jobdata_3 200 prod-f job10 type6 $TARGET10 ricsim_g3_4 testdata/ics/job-template2.json
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100876
877prodstub_arm_producer 200 prod-f 400
878
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100879ics_api_edp_get_producer_status 200 prod-f DISABLED 360
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100880
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200881ics_equal json:data-producer/v1/info-producers 4 1000
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100882
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200883ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100884
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100885ics_api_edp_get_producer_status 404 prod-a
886ics_api_edp_get_producer_status 200 prod-b ENABLED
887ics_api_edp_get_producer_status 200 prod-c ENABLED
888ics_api_edp_get_producer_status 200 prod-d ENABLED
889ics_api_edp_get_producer_status 200 prod-e ENABLED
890ics_api_edp_get_producer_status 404 prod-f
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100891
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +0200892ics_api_a1_get_job_status 200 job1 DISABLED
893ics_api_a1_get_job_status 200 job2 DISABLED
894ics_api_a1_get_job_status 200 job3 ENABLED
895ics_api_a1_get_job_status 200 job8 ENABLED
896ics_api_a1_get_job_status 200 job10 ENABLED
BjornMagnussonXA7b36db62020-11-23 10:57:57 +0100897
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100898if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100899 cr_equal 0 received_callbacks 14 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200900else
BjornMagnussonXA79e37002021-11-22 13:36:04 +0100901 cr_equal 0 received_callbacks 6 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +0200902fi
BjornMagnussonXAf38e1e82020-10-11 23:05:02 +0200903
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200904
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200905############################################
906# Test of info types
907############################################
908
909### Setup prodstub sim to accept calls for producers, info types and jobs
910## prod-ia type101
911## prod-ib type101 and type102
912## prod-ic no-type
913## prod-id type104
914## prod-ie type106
915## prod-if type106
916## prod-ig type150 (configured later)
917## prod-ig type160 (configured later)
918
919## job101 -> prod-ia
920## job102 -> prod-ia
921## job103 -> prod-ib
922## job104 -> prod-ia
923## job106 -> prod-ib
924## job108 -> prod-id
925## job110 -> prod-ie and prod-if
926## job150 -> prod-ig (configured later)
927
928prodstub_arm_producer 200 prod-ia
929prodstub_arm_producer 200 prod-ib
930prodstub_arm_producer 200 prod-ic
931prodstub_arm_producer 200 prod-id
932prodstub_arm_producer 200 prod-ie
933prodstub_arm_producer 200 prod-if
934
935prodstub_arm_type 200 prod-ia type101
936prodstub_arm_type 200 prod-ib type102
937prodstub_arm_type 200 prod-ib type103
938prodstub_arm_type 200 prod-id type104
939prodstub_arm_type 200 prod-ie type106
940prodstub_arm_type 200 prod-if type106
941
942prodstub_disarm_type 200 prod-ib type103
943prodstub_arm_type 200 prod-ib type101
944prodstub_disarm_type 200 prod-ib type101
945
946
947prodstub_arm_job_create 200 prod-ia job101
948prodstub_arm_job_create 200 prod-ia job102
949prodstub_arm_job_create 200 prod-ib job103
950
951prodstub_arm_job_delete 200 prod-ia job101
952prodstub_arm_job_delete 200 prod-ia job102
953prodstub_arm_job_delete 200 prod-ib job103
954
955prodstub_arm_job_create 200 prod-ib job104
956prodstub_arm_job_create 200 prod-ia job104
957
958prodstub_arm_job_create 200 prod-ib job106
959
960prodstub_arm_job_create 200 prod-id job108
961
962prodstub_arm_job_create 200 prod-ie job110
963prodstub_arm_job_create 200 prod-if job110
964
965
966# NOTE: types, jobs and producers are still present related to eitypes
967
968
969### Initial tests - no config made
970### GET: type ids, types, producer ids, producers, job ids, jobs
971### DELETE: jobs
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100972ics_api_idc_get_type_ids 200 type1 type2 type4 type6
973ics_api_idc_get_type 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200974
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100975ics_api_edp_get_type_ids 200 type1 type2 type4 type6
976ics_api_edp_get_type_2 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200977
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100978ics_api_edp_get_producer_ids_2 200 NOTYPE prod-b prod-c prod-d prod-e
979ics_api_edp_get_producer_2 404 test-prod
980ics_api_edp_get_producer_status 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200981
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100982ics_api_edp_delete_producer 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200983
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100984ics_api_idc_get_job_ids 200 test-type NOWNER EMPTY
985ics_api_idc_get_job_ids 200 test-type test-owner EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200986
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100987ics_api_idc_get_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200988
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100989ics_api_idc_get_job_status2 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200990
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100991ics_api_idc_delete_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200992
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100993ics_api_edp_get_producer_jobs_2 404 test-prod
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200994
BjornMagnussonXA007b6452021-11-29 08:03:38 +0100995ics_api_edp_get_type_2 404 test-type
996ics_api_edp_delete_type_2 404 test-type
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +0200997
998### Setup of producer/job and testing apis ###
999
1000## Setup prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001001ics_api_edp_get_type_ids 200 type1 type2 type4 type6
1002ics_api_edp_get_type_2 404 type101
1003ics_api_edp_put_producer_2 404 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001004
1005# Create type, delete and create again
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001006ics_api_edp_put_type_2 201 type101 testdata/ics/info-type-1.json
1007ics_api_edp_get_type_2 200 type101
1008ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1009ics_api_edp_delete_type_2 204 type101
1010ics_api_edp_get_type_2 404 type101
1011ics_api_edp_get_type_ids 200 type1 type2 type4 type6
1012ics_api_edp_put_type_2 201 type101 testdata/ics/info-type-1.json
1013ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1014ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001015
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001016ics_api_edp_put_producer_2 201 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1017ics_api_edp_put_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001018
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001019if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1"* ]]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001020 ics_api_edp_delete_type_2 409 type101
1021else
1022 ics_api_edp_delete_type_2 406 type101
1023fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001024
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001025if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001026 cr_equal 0 received_callbacks 17 30
1027 cr_equal 0 received_callbacks?id=type-status1 11
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001028 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 +02001029else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001030 cr_equal 0 received_callbacks 6
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001031fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001032
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001033ics_api_edp_get_type_ids 200 type101 type1 type2 type4 type6
1034ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001035
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001036ics_api_edp_get_producer_ids_2 200 NOTYPE prod-ia prod-b prod-c prod-d prod-e
1037ics_api_edp_get_producer_ids_2 200 type101 prod-ia
1038ics_api_edp_get_producer_ids_2 200 type102 EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001039
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001040ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001041
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001042ics_api_edp_get_producer_status 200 prod-ia ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001043
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001044ics_api_idc_get_job_ids 200 type101 NOWNER EMPTY
1045ics_api_idc_get_job_ids 200 type101 test-owner EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001046
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001047ics_api_idc_get_job 404 test-job
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001048
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001049ics_api_idc_get_job_status2 404 test-job
1050ics_api_edp_get_producer_jobs_2 200 prod-ia EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001051
1052## Create a job for prod-ia
1053## job101 - prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001054ics_api_idc_put_job 201 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001055
1056# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001057prodstub_check_jobdata_3 200 prod-ia job101 type101 $TARGET101 info-owner-1 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001058
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001059ics_api_idc_get_job_ids 200 type101 NOWNER job101
1060ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001061
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001062ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001063
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001064ics_api_idc_get_job 200 job101 type101 $TARGET101 info-owner-1 $INFOSTATUS101 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001065
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001066ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001067
1068prodstub_equal create/prod-ia/job101 1
1069
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001070ics_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 +02001071
1072## Create a second job for prod-ia
1073## job102 - prod-ia
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001074ics_api_idc_put_job 201 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001075
1076# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001077prodstub_check_jobdata_3 200 prod-ia job102 type101 $TARGET102 info-owner-2 testdata/ics/job-template.json
1078ics_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1079ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
1080ics_api_idc_get_job_ids 200 type101 info-owner-2 job102
1081ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001082
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001083ics_api_idc_get_job 200 job102 type101 $TARGET102 info-owner-2 $INFOSTATUS102 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001084
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001085ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001086
1087prodstub_equal create/prod-ia/job102 1
1088
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001089ics_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 +02001090
1091
1092## Setup prod-ib
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001093ics_api_edp_put_type_2 201 type102 testdata/ics/info-type-2.json
1094ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001095
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001096if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001097 cr_equal 0 received_callbacks 18 30
1098 cr_equal 0 received_callbacks?id=type-status1 12
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001099 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 +02001100else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001101 cr_equal 0 received_callbacks 6
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001102fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001103
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001104ics_api_idc_get_type_ids 200 type101 type102 type1 type2 type4 type6
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001105
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001106if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
1107 ics_api_idc_get_type 200 type101 testdata/ics/info-type-1.json ENABLED 1
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001108
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001109 ics_api_idc_get_type 200 type102 testdata/ics/info-type-2.json ENABLED 1
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001110else
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001111 ics_api_idc_get_type 200 type101 testdata/ics/info-type-1.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001112
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001113 ics_api_idc_get_type 200 type102 testdata/ics/info-type-2.json
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001114fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001115
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001116ics_api_edp_get_type_ids 200 type101 type102 type1 type2 type4 type6
1117ics_api_edp_get_type_2 200 type101 testdata/ics/info-type-1.json
1118ics_api_edp_get_type_2 200 type102 testdata/ics/info-type-2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001119
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001120ics_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 +02001121
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001122ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1123ics_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001124
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001125ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001126
1127## Create job for prod-ib
1128## job103 - prod-ib
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001129ics_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001130
1131prodstub_equal create/prod-ib/job103 1
1132
1133# Check the job data in the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001134prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001135
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001136ics_api_idc_get_job_ids 200 type101 NOWNER job101 job102
1137ics_api_idc_get_job_ids 200 type102 NOWNER job103
1138ics_api_idc_get_job_ids 200 type101 info-owner-1 job101
1139ics_api_idc_get_job_ids 200 type101 info-owner-2 job102
1140ics_api_idc_get_job_ids 200 type102 info-owner-3 job103
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001141
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001142ics_api_idc_get_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001143
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001144ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001145
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001146ics_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
1147ics_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 +02001148
1149## Setup prod-ic (no types)
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001150ics_api_edp_put_producer_2 201 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic NOTYPE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001151
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001152ics_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 +02001153
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001154ics_api_edp_get_producer_2 200 prod-ia $CB_JOB/prod-ia $CB_SV/prod-ia type101
1155ics_api_edp_get_producer_2 200 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
1156ics_api_edp_get_producer_2 200 prod-ic $CB_JOB/prod-ic $CB_SV/prod-ic EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001157
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001158ics_api_edp_get_producer_status 200 prod-ic ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001159
1160
1161## Delete job103 and prod-ib and re-create if different order
1162
1163# Delete job then producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001164ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1165ics_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 +02001166
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001167ics_api_idc_delete_job 204 job103
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001168
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001169ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1170ics_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 +02001171
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001172ics_api_edp_delete_producer 204 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001173
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001174ics_api_edp_get_producer_status 404 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001175
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001176ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job1 job2 job3 job8 job10
1177ics_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 +02001178
1179prodstub_equal delete/prod-ib/job103 1
1180
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001181ics_api_idc_put_job 201 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template.json VALIDATE
1182ics_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001183
1184# Put producer then job
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001185ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001186
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001187ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001188
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001189ics_api_idc_put_job 200 job103 type102 $TARGET103 info-owner-3 $INFOSTATUS103 testdata/ics/job-template2.json VALIDATE
1190ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001191
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001192prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001193
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001194ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1195ics_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 +02001196
1197prodstub_equal create/prod-ib/job103 3
1198prodstub_equal delete/prod-ib/job103 1
1199
1200# Delete only the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001201ics_api_edp_delete_producer 204 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001202
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001203ics_api_edp_get_producer_status 404 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001204
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001205ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job1 job2 job3 job8 job10
1206ics_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 +02001207
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001208ics_api_idc_get_job_status2 200 job103 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001209
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001210if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001211 cr_equal 0 received_callbacks 19 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001212
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001213 cr_equal 0 received_callbacks?id=info-job103-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001214 cr_api_check_all_ics_events 200 0 info-job103-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001215else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001216 cr_equal 0 received_callbacks 7 30
1217 cr_equal 0 received_callbacks?id=info-job103-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001218 cr_api_check_all_ics_events 200 0 info-job103-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001219fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001220
1221# Re-create the producer
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001222ics_api_edp_put_producer_2 201 prod-ib $CB_JOB/prod-ib $CB_SV/prod-ib type102
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001223
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001224ics_api_edp_get_producer_status 200 prod-ib ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001225
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001226ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001227
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001228if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001229 cr_equal 0 received_callbacks 20 30
1230 cr_equal 0 received_callbacks?id=info-job103-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001231 cr_api_check_all_ics_events 200 0 info-job103-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001232else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001233 cr_equal 0 received_callbacks 8 30
1234 cr_equal 0 received_callbacks?id=info-job103-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001235 cr_api_check_all_ics_events 200 0 info-job103-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001236fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001237
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001238prodstub_check_jobdata_3 200 prod-ib job103 type102 $TARGET103 info-owner-3 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001239
1240## Setup prod-id
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001241ics_api_edp_put_type_2 201 type104 testdata/ics/info-type-4.json
1242ics_api_edp_put_producer_2 201 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001243
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001244ics_api_idc_get_job_ids 200 type104 NOWNER EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001245
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001246ics_api_idc_put_job 201 job108 type104 $TARGET108 info-owner-4 $INFOSTATUS108 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001247
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001248prodstub_check_jobdata_3 200 prod-id job108 type104 $TARGET108 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001249
1250prodstub_equal create/prod-id/job108 1
1251prodstub_equal delete/prod-id/job108 0
1252
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001253ics_api_idc_get_job_ids 200 type104 NOWNER job108
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001254
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001255ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001256
1257# Re-PUT the producer with zero types
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001258ics_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id NOTYPE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001259
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001260ics_api_idc_get_job_ids 200 type104 NOWNER job108
1261ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001262
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001263ics_api_idc_get_job_status2 200 job108 DISABLED EMPTYPROD
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001264
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001265if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001266 cr_equal 0 received_callbacks 22 30
1267 cr_equal 0 received_callbacks?id=type-status1 13
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001268 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 +02001269
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001270 cr_equal 0 received_callbacks?id=info-job108-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001271 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001272else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001273 cr_equal 0 received_callbacks 9 30
1274 cr_equal 0 received_callbacks?id=info-job108-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001275 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001276fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001277
1278prodstub_equal create/prod-id/job108 1
1279prodstub_equal delete/prod-id/job108 0
1280
1281## Re-setup prod-id
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001282ics_api_edp_put_type_2 200 type104 testdata/ics/info-type-4.json
1283ics_api_edp_put_producer_2 200 prod-id $CB_JOB/prod-id $CB_SV/prod-id type104
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001284
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001285
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001286ics_api_idc_get_job_ids 200 type104 NOWNER job108
1287ics_api_idc_get_job_ids 200 NOTYPE NOWNER job101 job102 job103 job108 job1 job2 job3 job8 job10
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001288
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001289ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001290
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001291ics_api_edp_get_producer_status 200 prod-ia ENABLED
1292ics_api_edp_get_producer_status 200 prod-ib ENABLED
1293ics_api_edp_get_producer_status 200 prod-ic ENABLED
1294ics_api_edp_get_producer_status 200 prod-id ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001295
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001296if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001297 cr_equal 0 received_callbacks 24 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001298
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001299 cr_equal 0 received_callbacks?id=type-status1 14
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001300 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 +02001301
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001302 cr_equal 0 received_callbacks?id=info-job108-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001303 cr_api_check_all_ics_events 200 0 info-job108-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001304else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001305 cr_equal 0 received_callbacks 10 30
1306 cr_equal 0 received_callbacks?id=info-job108-status 2
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001307 cr_api_check_all_ics_events 200 0 info-job108-status ENABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001308fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001309
1310prodstub_equal create/prod-id/job108 2
1311prodstub_equal delete/prod-id/job108 0
1312
1313
1314## Setup prod-ie
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001315ics_api_edp_put_type_2 201 type106 testdata/ics/info-type-6.json
1316ics_api_edp_put_producer_2 201 prod-ie $CB_JOB/prod-ie $CB_SV/prod-ie type106
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001317
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001318ics_api_idc_get_job_ids 200 type106 NOWNER EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001319
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001320ics_api_idc_put_job 201 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001321
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001322prodstub_check_jobdata_3 200 prod-ie job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001323
1324prodstub_equal create/prod-ie/job110 1
1325prodstub_equal delete/prod-ie/job110 0
1326
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001327ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001328
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001329ics_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001330
1331## Setup prod-if
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001332ics_api_edp_put_type_2 200 type106 testdata/ics/info-type-6.json
1333ics_api_edp_put_producer_2 201 prod-if $CB_JOB/prod-if $CB_SV/prod-if type106
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001334
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001335if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001336 cr_equal 0 received_callbacks 26 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001337
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001338 cr_equal 0 received_callbacks?id=type-status1 16
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001339 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 +02001340fi
1341
1342
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001343ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001344
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001345prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001346
1347prodstub_equal create/prod-if/job110 1
1348prodstub_equal delete/prod-if/job110 0
1349
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001350ics_api_idc_get_job_ids 200 type106 NOWNER job110
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001351
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001352ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001353
1354## Status updates prod-ia and jobs
1355
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001356ics_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 +02001357
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001358ics_api_edp_get_producer_status 200 prod-ia ENABLED
1359ics_api_edp_get_producer_status 200 prod-ib ENABLED
1360ics_api_edp_get_producer_status 200 prod-ic ENABLED
1361ics_api_edp_get_producer_status 200 prod-id ENABLED
1362ics_api_edp_get_producer_status 200 prod-ie ENABLED
1363ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001364
1365# Arm producer prod-ia for supervision failure
1366prodstub_arm_producer 200 prod-ia 400
1367
1368# Wait for producer prod-ia to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001369ics_api_edp_get_producer_status 200 prod-ia DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001370
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001371ics_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 +02001372
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001373ics_api_edp_get_producer_status 200 prod-ia DISABLED
1374ics_api_edp_get_producer_status 200 prod-ib ENABLED
1375ics_api_edp_get_producer_status 200 prod-ic ENABLED
1376ics_api_edp_get_producer_status 200 prod-id ENABLED
1377ics_api_edp_get_producer_status 200 prod-ie ENABLED
1378ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001379
1380
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001381ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1382ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1383ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1384ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1385ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001386
1387# Arm producer prod-ia for supervision
1388prodstub_arm_producer 200 prod-ia 200
1389
1390# Wait for producer prod-ia to go enabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001391ics_api_edp_get_producer_status 200 prod-ia ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001392
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001393ics_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 +02001394
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001395ics_api_edp_get_producer_status 200 prod-ia ENABLED
1396ics_api_edp_get_producer_status 200 prod-ib ENABLED
1397ics_api_edp_get_producer_status 200 prod-ic ENABLED
1398ics_api_edp_get_producer_status 200 prod-id ENABLED
1399ics_api_edp_get_producer_status 200 prod-ie ENABLED
1400ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001401
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001402ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1403ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1404ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1405ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1406ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001407
1408# Arm producer prod-ia for supervision failure
1409prodstub_arm_producer 200 prod-ia 400
1410
1411# Wait for producer prod-ia to go disabled
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001412ics_api_edp_get_producer_status 200 prod-ia DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001413
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001414ics_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 +02001415
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001416ics_api_edp_get_producer_status 200 prod-ia DISABLED
1417ics_api_edp_get_producer_status 200 prod-ib ENABLED
1418ics_api_edp_get_producer_status 200 prod-ic ENABLED
1419ics_api_edp_get_producer_status 200 prod-id ENABLED
1420ics_api_edp_get_producer_status 200 prod-ie ENABLED
1421ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001422
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001423ics_api_idc_get_job_status2 200 job101 ENABLED 1 prod-ia
1424ics_api_idc_get_job_status2 200 job102 ENABLED 1 prod-ia
1425ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1426ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1427ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001428
1429# Wait for producer prod-ia to be removed
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +02001430ics_equal json:data-producer/v1/info-producers 9 1000
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001431
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001432ics_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 +02001433
1434
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001435ics_api_edp_get_producer_status 404 prod-ia
1436ics_api_edp_get_producer_status 200 prod-ib ENABLED
1437ics_api_edp_get_producer_status 200 prod-ic ENABLED
1438ics_api_edp_get_producer_status 200 prod-id ENABLED
1439ics_api_edp_get_producer_status 200 prod-ie ENABLED
1440ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001441
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001442ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1443ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1444ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1445ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1446ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001447
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001448
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001449if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001450 cr_equal 0 received_callbacks 28 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001451
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001452 cr_equal 0 received_callbacks?id=info-job101-status 1
1453 cr_equal 0 received_callbacks?id=info-job102-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001454 cr_api_check_all_ics_events 200 0 info-job101-status DISABLED
1455 cr_api_check_all_ics_events 200 0 info-job102-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001456else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001457 cr_equal 0 received_callbacks 12 30
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001458
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001459 cr_equal 0 received_callbacks?id=info-job101-status 1
1460 cr_equal 0 received_callbacks?id=info-job102-status 1
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001461 cr_api_check_all_ics_events 200 0 info-job101-status DISABLED
1462 cr_api_check_all_ics_events 200 0 info-job102-status DISABLED
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001463fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001464
1465
1466# Arm producer prod-ie for supervision failure
1467prodstub_arm_producer 200 prod-ie 400
1468
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001469ics_api_edp_get_producer_status 200 prod-ie DISABLED 1000
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001470
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001471ics_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 +02001472
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001473ics_api_edp_get_producer_status 404 prod-ia
1474ics_api_edp_get_producer_status 200 prod-ib ENABLED
1475ics_api_edp_get_producer_status 200 prod-ic ENABLED
1476ics_api_edp_get_producer_status 200 prod-id ENABLED
1477ics_api_edp_get_producer_status 200 prod-ie DISABLED
1478ics_api_edp_get_producer_status 200 prod-if ENABLED
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001479
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001480ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1481ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1482ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1483ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1484ics_api_idc_get_job_status2 200 job110 ENABLED 2 prod-ie prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001485
1486#Disable create for job110 in prod-ie
1487prodstub_arm_job_create 200 prod-ie job110 400
1488
1489#Update tjob 10 - only prod-if will be updated
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001490ics_api_idc_put_job 200 job110 type106 $TARGET110 info-owner-4 $INFOSTATUS110 testdata/ics/job-template2.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001491#Reset producer and job responses
1492prodstub_arm_producer 200 prod-ie 200
1493prodstub_arm_job_create 200 prod-ie job110 200
1494
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001495ics_api_edp_get_producer_status 200 prod-ie ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001496
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001497ics_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 +02001498
1499#Wait for job to be updated
1500sleep_wait 120
1501
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001502prodstub_check_jobdata_3 200 prod-if job110 type106 $TARGET110 info-owner-4 testdata/ics/job-template2.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001503
1504prodstub_arm_producer 200 prod-if 400
1505
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001506ics_api_edp_get_producer_status 200 prod-if DISABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001507
BjornMagnussonXA7d7cb5f2023-04-11 10:32:56 +02001508ics_equal json:data-producer/v1/info-producers 8 1000
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001509
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001510ics_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 +02001511
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001512ics_api_edp_get_producer_status 404 prod-ia
1513ics_api_edp_get_producer_status 200 prod-ib ENABLED
1514ics_api_edp_get_producer_status 200 prod-ic ENABLED
1515ics_api_edp_get_producer_status 200 prod-id ENABLED
1516ics_api_edp_get_producer_status 200 prod-ie ENABLED
1517ics_api_edp_get_producer_status 404 prod-if
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001518
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001519ics_api_idc_get_job_status2 200 job101 DISABLED EMPTYPROD
1520ics_api_idc_get_job_status2 200 job102 DISABLED EMPTYPROD
1521ics_api_idc_get_job_status2 200 job103 ENABLED 1 prod-ib
1522ics_api_idc_get_job_status2 200 job108 ENABLED 1 prod-id
1523ics_api_idc_get_job_status2 200 job110 ENABLED 1 prod-ie
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001524
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001525if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001526 cr_equal 0 received_callbacks 28
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001527else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001528 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001529fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001530### Test of pre and post validation
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001531if [[ "$ICS_FEATURE_LEVEL" != *"DEFAULT_TYPE_VALIDATION"* ]]; then
1532 ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1533 ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
1534 ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001535
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001536
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001537 ics_api_idc_get_job_status2 404 job150
1538 ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001539
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001540 prodstub_arm_producer 200 prod-ig
1541 prodstub_arm_job_create 200 prod-ig job150
1542 prodstub_arm_job_create 200 prod-ig job160
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001543
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001544 ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1545 ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001546
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001547 ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001548
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001549 ics_api_idc_get_job_status2 404 job150
1550 ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
1551else
1552 ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106
1553 ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
1554
1555 ics_api_idc_get_job_status2 404 job150
1556
1557 prodstub_arm_producer 200 prod-ig
1558 prodstub_arm_job_create 200 prod-ig job150
1559 prodstub_arm_job_create 200 prod-ig job160
1560
1561 ics_api_edp_put_producer_2 201 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig NOTYPE
1562 ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
1563
1564 ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig EMPTY
1565
1566 ics_api_idc_get_job_status2 404 job150
1567 #ics_api_idc_get_job_status2 200 job160 DISABLED EMPTYPROD 60
1568fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001569
1570prodstub_arm_type 200 prod-ig type160
1571
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001572ics_api_edp_put_type_2 201 type160 testdata/ics/info-type-60.json
1573ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001574
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001575ics_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
1576ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
1577ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001578
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001579ics_api_idc_put_job 404 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001580
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001581ics_api_idc_get_job_status2 404 job150
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001582if [[ "$ICS_FEATURE_LEVEL" != *"DEFAULT_TYPE_VALIDATION"* ]]; then
1583 ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig 60
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001584
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001585 prodstub_check_jobdata_3 200 prod-ig job160 type160 $TARGET160 info-owner-1 testdata/ics/job-template.json
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001586
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001587 prodstub_equal create/prod-ig/job160 1
1588 prodstub_equal delete/prod-ig/job160 0
1589fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001590
1591prodstub_arm_type 200 prod-ig type150
1592
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001593ics_api_edp_put_type_2 201 type150 testdata/ics/info-type-50.json
1594ics_api_idc_get_type_ids 200 type1 type2 type4 type6 type101 type102 type104 type106 type160 type150
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001595
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001596if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001597 cr_equal 0 received_callbacks 30 30
1598 cr_equal 0 received_callbacks?id=type-status1 18
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001599 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 +02001600else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001601 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001602fi
1603
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001604ics_api_edp_put_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
1605ics_api_edp_get_producer_status 200 prod-ig ENABLED 360
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001606
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001607ics_api_edp_get_producer_2 200 prod-ig $CB_JOB/prod-ig $CB_SV/prod-ig type160 type150
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001608
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001609if [[ "$ICS_FEATURE_LEVEL" == *"DEFAULT_TYPE_VALIDATION"* ]]; then
1610 ics_api_idc_put_job 201 job160 type160 $TARGET160 info-owner-1 $INFOSTATUS160 testdata/ics/job-template.json
1611fi
1612
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001613ics_api_idc_get_job_status2 404 job150
1614ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001615
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001616ics_api_idc_put_job 201 job150 type150 $TARGET150 info-owner-1 $INFOSTATUS150 testdata/ics/job-template.json VALIDATE
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001617
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001618ics_api_idc_get_job_status2 200 job150 ENABLED 1 prod-ig 60
1619ics_api_idc_get_job_status2 200 job160 ENABLED 1 prod-ig
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001620
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001621if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001622 cr_equal 0 received_callbacks 30 30
1623 cr_equal 0 received_callbacks?id=type-status1 18
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001624else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001625 cr_equal 0 received_callbacks 12
BjornMagnussonXA3cc0b582021-08-30 10:46:41 +02001626fi
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001627
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001628# Test job deletion at type delete
1629
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001630if [[ "$ICS_FEATURE_LEVEL" == *"TYPE-SUBSCRIPTIONS"* ]]; then
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001631
BjornMagnussonXAcd938442022-05-11 10:01:24 +02001632 if [[ "$ICS_FEATURE_LEVEL" == *"RESP_CODE_CHANGE_1"* ]]; then
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001633 ics_api_edp_delete_type_2 409 type104
1634 else
1635 ics_api_edp_delete_type_2 406 type104
1636 fi
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001637
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001638 ics_api_edp_delete_producer 204 prod-id
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001639
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001640 ics_api_edp_delete_type_2 204 type104
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001641
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001642 cr_equal 0 received_callbacks 32 30
1643 cr_equal 0 received_callbacks?id=info-job108-status 3
1644 cr_equal 0 received_callbacks?id=type-status1 19
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001645 cr_api_check_all_ics_subscription_events 200 0 type-status1 type104 testdata/ics/info-type-4.json DEREGISTERED
1646 cr_api_check_all_ics_events 200 0 info-job108-status DISABLED
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001647
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001648 ics_api_edp_get_producer 404 prod-id
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001649
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001650 ics_api_idc_get_job 404 job-108
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001651
1652else
BjornMagnussonXA79e37002021-11-22 13:36:04 +01001653 cr_equal 0 received_callbacks 12
BjornMagnussonXA83a750f2021-09-21 20:39:58 +02001654fi
1655
BjornMagnussonXA007b6452021-11-29 08:03:38 +01001656check_ics_logs
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001657
1658store_logs END
1659
1660#### TEST COMPLETE ####
1661
BjornMagnussonXAbf3700b2020-10-05 08:39:40 +02001662print_result
1663
BjornMagnussonXA9d8fafb2021-05-10 11:11:49 +02001664auto_clean_environment