BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 1 | #!/bin/bash |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2020 Nordix Foundation. All rights reserved. |
| 5 | # ======================================================================== |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END================================================= |
| 18 | # |
| 19 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 20 | TC_ONELINE_DESCR="Basic use case, register service, create/update policy, delete policy, de-register service using both STD and OSC interface while mixing REST and Dmaap" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 21 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 22 | #App names to include in the test when running docker, space separated list |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 23 | DOCKER_INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM NGW KUBEPROXY" |
BjornMagnussonXA | bbd2e9d | 2020-05-27 21:24:06 +0200 | [diff] [blame] | 24 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 25 | #App names to include in the test when running kubernetes, space separated list |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 26 | KUBE_INCLUDED_IMAGES=" MR CR PA RICSIM CP KUBEPROXY NGW" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 27 | #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list |
| 28 | KUBE_PRESTARTED_IMAGES="" |
| 29 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 30 | #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if |
| 31 | #the image is not configured in the supplied env_file |
| 32 | #Used for images not applicable to all supported profile |
| 33 | CONDITIONALLY_IGNORED_IMAGES="NGW" |
| 34 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 35 | #Supported test environment profiles |
BjornMagnussonXA | fec823b | 2021-08-03 14:14:05 +0200 | [diff] [blame] | 36 | SUPPORTED_PROFILES="ONAP-GUILIN ONAP-HONOLULU ONAP-ISTANBUL ORAN-CHERRY ORAN-D-RELEASE ORAN-E-RELEASE" |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 37 | #Supported run modes |
| 38 | SUPPORTED_RUNMODES="DOCKER KUBE" |
BjornMagnussonXA | 49f0e5a | 2020-11-08 22:41:39 +0100 | [diff] [blame] | 39 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 40 | . ../common/testcase_common.sh $@ |
| 41 | . ../common/agent_api_functions.sh |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 42 | . ../common/consul_cbs_functions.sh |
| 43 | . ../common/control_panel_api_functions.sh |
| 44 | . ../common/controller_api_functions.sh |
| 45 | . ../common/cr_api_functions.sh |
| 46 | . ../common/mr_api_functions.sh |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 47 | . ../common/ricsimulator_api_functions.sh |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 48 | . ../common/kube_proxy_api_functions.sh |
| 49 | . ../common/gateway_api_functions.sh |
| 50 | |
| 51 | setup_testenvironment |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 52 | |
| 53 | #### TEST BEGIN #### |
| 54 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 55 | generate_policy_uuid |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 56 | |
BjornMagnussonXA | bf3700b | 2020-10-05 08:39:40 +0200 | [diff] [blame] | 57 | use_simulator_http |
| 58 | use_mr_http |
| 59 | use_agent_rest_http |
| 60 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 61 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 62 | clean_environment |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 63 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 64 | start_kube_proxy |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 65 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 66 | start_ric_simulators ricsim_g1 3 OSC_2.1.0 |
| 67 | |
| 68 | start_ric_simulators ricsim_g2 5 STD_1.1.3 |
| 69 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 70 | if [ "$PMS_VERSION" == "V2" ]; then |
| 71 | start_ric_simulators ricsim_g3 1 STD_2.0.0 |
| 72 | fi |
| 73 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 74 | start_mr |
| 75 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 76 | start_cr |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 77 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 78 | if [ $RUNMODE == "DOCKER" ]; then |
| 79 | start_consul_cbs |
| 80 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 81 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 82 | start_control_panel $SIM_GROUP/$CONTROL_PANEL_COMPOSE_DIR/$CONTROL_PANEL_CONFIG_FILE |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 83 | |
BjornMagnussonXA | be9a07f | 2021-02-25 10:51:46 +0100 | [diff] [blame] | 84 | if [ ! -z "$NRT_GATEWAY_APP_NAME" ]; then |
| 85 | start_gateway $SIM_GROUP/$NRT_GATEWAY_COMPOSE_DIR/$NRT_GATEWAY_CONFIG_FILE |
| 86 | fi |
| 87 | |
| 88 | start_policy_agent NORPOXY $SIM_GROUP/$POLICY_AGENT_COMPOSE_DIR/$POLICY_AGENT_CONFIG_FILE |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 89 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 90 | set_agent_debug |
| 91 | |
| 92 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 93 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 94 | prepare_consul_config NOSDNC ".consul_config.json" |
| 95 | |
| 96 | if [ $RUNMODE == "KUBE" ]; then |
| 97 | agent_load_config ".consul_config.json" |
| 98 | else |
| 99 | consul_config_app ".consul_config.json" |
| 100 | fi |
| 101 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 102 | api_get_status 200 |
| 103 | |
| 104 | sim_print ricsim_g1_1 interface |
| 105 | |
| 106 | sim_print ricsim_g2_1 interface |
| 107 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 108 | if [ "$PMS_VERSION" == "V2" ]; then |
| 109 | sim_print ricsim_g3_1 interface |
| 110 | fi |
| 111 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 112 | sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json |
| 113 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 114 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 115 | sim_put_policy_type 201 ricsim_g3_1 STD_QOS_0_2_0 testdata/STD2/sim_qos.json |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 116 | api_equal json:policy-types 3 300 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 117 | else |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 118 | api_equal json:policy_types 2 300 |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 119 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 120 | |
| 121 | # Create policies |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 122 | |
| 123 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 124 | notificationurl=$CR_SERVICE_APP_PATH"/test" |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 125 | else |
| 126 | notificationurl="" |
| 127 | fi |
| 128 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 129 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 130 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 131 | api_put_service 201 "service1" 3600 "$CR_SERVICE_APP_PATH/1" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 132 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 133 | api_put_policy 201 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 134 | |
| 135 | sim_equal ricsim_g1_1 num_instances 1 |
| 136 | |
| 137 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 138 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 139 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 140 | api_put_policy 201 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 141 | |
| 142 | sim_equal ricsim_g1_1 num_instances 2 |
| 143 | |
| 144 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 145 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 146 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 147 | api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 148 | |
| 149 | sim_equal ricsim_g2_1 num_instances 1 |
| 150 | |
| 151 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 152 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 153 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 154 | api_put_policy 201 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 155 | |
| 156 | sim_equal ricsim_g2_1 num_instances 2 |
| 157 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 158 | if [ "$PMS_VERSION" == "V2" ]; then |
| 159 | use_agent_rest_http |
| 160 | |
| 161 | api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1 |
| 162 | |
| 163 | sim_equal ricsim_g3_1 num_instances 1 |
| 164 | |
| 165 | use_agent_dmaap_http |
| 166 | |
| 167 | api_put_policy 201 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 NOTRANSIENT $notificationurl testdata/STD2/pi_qos_template.json 1 |
| 168 | |
| 169 | sim_equal ricsim_g3_1 num_instances 2 |
| 170 | |
| 171 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 172 | |
| 173 | #Update policies |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 174 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 175 | |
BjornMagnussonXA | 663566c | 2021-11-08 10:25:07 +0100 | [diff] [blame] | 176 | api_put_service 200 "service1" 3600 "$CR_SERVICE_APP_PATH/1" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 177 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 178 | api_put_policy 200 "service1" ricsim_g1_1 1 2000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 179 | |
| 180 | sim_equal ricsim_g1_1 num_instances 2 |
| 181 | |
| 182 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 183 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 184 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 185 | api_put_policy 200 "service1" ricsim_g1_1 1 3000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 186 | |
| 187 | sim_equal ricsim_g1_1 num_instances 2 |
| 188 | |
| 189 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 190 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 191 | |
| 192 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 193 | api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 2100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 194 | |
| 195 | sim_equal ricsim_g2_1 num_instances 2 |
| 196 | |
| 197 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 198 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 199 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 200 | api_put_policy 200 "service1" ricsim_g2_1 NOTYPE 3100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json 1 |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 201 | |
| 202 | sim_equal ricsim_g2_1 num_instances 2 |
| 203 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 204 | if [ "$PMS_VERSION" == "V2" ]; then |
| 205 | use_agent_rest_http |
| 206 | |
| 207 | api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 2200 true $notificationurl testdata/STD2/pi_qos_template.json 1 |
| 208 | |
| 209 | sim_equal ricsim_g3_1 num_instances 2 |
| 210 | |
| 211 | |
| 212 | use_agent_dmaap_http |
| 213 | |
| 214 | api_put_policy 200 "service1" ricsim_g3_1 STD_QOS_0_2_0 3200 true $notificationurl testdata/STD2/pi_qos_template.json 1 |
| 215 | |
| 216 | sim_equal ricsim_g3_1 num_instances 2 |
| 217 | fi |
| 218 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 219 | # Check policies |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 220 | if [ "$PMS_VERSION" == "V2" ]; then |
| 221 | api_get_policy 200 2000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl |
| 222 | api_get_policy 200 3000 testdata/OSC/pi1_template.json "service1" ricsim_g1_1 1 false $notificationurl |
| 223 | api_get_policy 200 2100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl |
| 224 | api_get_policy 200 3100 testdata/STD/pi1_template.json "service1" ricsim_g2_1 NOTYPE false $notificationurl |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 225 | api_get_policy 200 2200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl |
| 226 | api_get_policy 200 3200 testdata/STD2/pi_qos_template.json "service1" ricsim_g3_1 STD_QOS_0_2_0 true $notificationurl |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 227 | else |
| 228 | api_get_policy 200 2000 testdata/OSC/pi1_template.json |
| 229 | api_get_policy 200 3000 testdata/OSC/pi1_template.json |
| 230 | api_get_policy 200 2100 testdata/STD/pi1_template.json |
| 231 | api_get_policy 200 3100 testdata/STD/pi1_template.json |
| 232 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 233 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 234 | sim_equal ricsim_g1_1 num_instances 2 |
| 235 | sim_equal ricsim_g2_1 num_instances 2 |
| 236 | |
| 237 | if [ "$PMS_VERSION" == "V2" ]; then |
| 238 | sim_equal ricsim_g3_1 num_instances 2 |
| 239 | fi |
| 240 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 241 | # Remove policies |
| 242 | |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 243 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 244 | api_delete_policy 204 2000 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 245 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 246 | api_delete_policy 204 3000 |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 247 | use_agent_dmaap_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 248 | api_delete_policy 204 2100 |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 249 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 250 | api_delete_policy 204 3100 |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 251 | if [ "$PMS_VERSION" == "V2" ]; then |
| 252 | use_agent_dmaap_http |
| 253 | api_delete_policy 204 2200 |
| 254 | use_agent_rest_http |
| 255 | api_delete_policy 204 3200 |
| 256 | fi |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 257 | |
| 258 | sim_equal ricsim_g1_1 num_instances 0 |
| 259 | sim_equal ricsim_g2_1 num_instances 0 |
| 260 | |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 261 | if [ "$PMS_VERSION" == "V2" ]; then |
| 262 | sim_equal ricsim_g3_1 num_instances 0 |
| 263 | fi |
| 264 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 265 | # Check remote host access to simulator |
| 266 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 267 | sim_contains_str ricsim_g1_1 remote_hosts $POLICY_AGENT_APP_NAME |
| 268 | sim_contains_str ricsim_g2_1 remote_hosts $POLICY_AGENT_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 269 | if [ "$PMS_VERSION" == "V2" ]; then |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 270 | sim_contains_str ricsim_g3_1 remote_hosts $POLICY_AGENT_APP_NAME |
BjornMagnussonXA | 4207b83 | 2020-11-03 09:52:49 +0100 | [diff] [blame] | 271 | fi |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 272 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 273 | # Check policy removal |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 274 | use_agent_rest_http |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 275 | api_get_policy 404 2000 |
| 276 | api_get_policy 404 3000 |
| 277 | api_get_policy 404 2100 |
| 278 | api_get_policy 404 3100 |
| 279 | |
BjornMagnussonXA | 2791e08 | 2020-11-12 00:52:08 +0100 | [diff] [blame] | 280 | if [ "$PMS_VERSION" == "V2" ]; then |
| 281 | api_get_policy 404 2200 |
| 282 | api_get_policy 404 3200 |
| 283 | fi |
| 284 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 285 | # Remove the service |
BjornMagnussonXA | 496156d | 2020-08-10 14:16:24 +0200 | [diff] [blame] | 286 | use_agent_dmaap_http |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 287 | api_delete_services 204 "service1" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 288 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 289 | api_get_services 404 "service1" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 290 | |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 291 | check_policy_agent_logs |
| 292 | |
| 293 | #### TEST COMPLETE #### |
| 294 | |
| 295 | store_logs END |
| 296 | |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 297 | print_result |
| 298 | |
BjornMagnussonXA | e0b665e | 2021-01-08 22:19:18 +0100 | [diff] [blame] | 299 | auto_clean_environment |