BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2020 Nordix Foundation. All rights reserved. |
| 5 | # ======================================================================== |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END================================================= |
| 18 | # |
| 19 | |
| 20 | # This is a script that contains specific test functions for A1 Controller API |
| 21 | |
| 22 | # Generic function to query the RICs via the A1-controller API. |
| 23 | # args: <operation> <url> [<body>] |
| 24 | # <operation>: getA1Policy,putA1Policy,getA1PolicyType,deleteA1Policy,getA1PolicyStatus |
| 25 | # response: <json-body><3-digit-response-code> |
| 26 | # (Not for test scripts) |
| 27 | __do_curl_to_controller() { |
| 28 | echo " (${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 29 | if [ $# -ne 2 ] && [ $# -ne 3 ]; then |
| 30 | ((RES_CONF_FAIL++)) |
| 31 | echo "-Incorrect number of parameters to __do_curl_to_controller " $@ >> $HTTPLOG |
| 32 | echo "-Expected: <operation> <url> [<body>]" >> $HTTPLOG |
| 33 | echo "-Returning response 000" >> $HTTPLOG |
| 34 | echo "000" |
| 35 | return 1 |
| 36 | fi |
| 37 | if [ $# -eq 2 ]; then |
| 38 | json='{"input":{"near-rt-ric-url":"'$2'"}}' |
| 39 | else |
| 40 | # Escape quotes in the body |
| 41 | body=$(echo "$3" | sed 's/"/\\"/g') |
| 42 | json='{"input":{"near-rt-ric-url":"'$2'","body":"'"$body"'"}}' |
| 43 | fi |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 44 | payload="./tmp/.sdnc.payload.json" |
| 45 | echo "$json" > $payload |
| 46 | echo " FILE ($payload) : $json" >> $HTTPLOG |
| 47 | curlString="curl -skw %{http_code} -X POST $SDNC_HTTPX://$SDNC_USER:$SDNC_PWD@localhost:$SDNC_LOCAL_PORT$SDNC_API_URL$1 -H accept:application/json -H Content-Type:application/json --data-binary @$payload" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 48 | echo " CMD: "$curlString >> $HTTPLOG |
| 49 | res=$($curlString) |
| 50 | retcode=$? |
| 51 | echo " RESP: "$res >> $HTTPLOG |
| 52 | if [ $retcode -ne 0 ]; then |
| 53 | echo " RETCODE: "$retcode >> $HTTPLOG |
| 54 | echo "000" |
| 55 | return 1 |
| 56 | fi |
| 57 | |
| 58 | status=${res:${#res}-3} |
| 59 | |
| 60 | if [ $status -ne 200 ]; then |
| 61 | echo "000" |
| 62 | return 1 |
| 63 | fi |
| 64 | body=${res:0:${#res}-3} |
BjornMagnussonXA | 70e878f | 2020-05-11 14:11:30 +0200 | [diff] [blame] | 65 | echo " JSON: "$body >> $HTTPLOG |
BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 66 | reply="./tmp/.sdnc-reply.json" |
| 67 | echo "$body" > $reply |
| 68 | res=$(python3 ../common/extract_sdnc_reply.py $reply) |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 69 | echo " EXTRACED BODY+CODE: "$res >> $HTTPLOG |
| 70 | echo "$res" |
| 71 | return 0 |
| 72 | } |
| 73 | |
| 74 | # Controller API Test function: getA1Policy (return ids only) |
| 75 | # arg: <response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) | ( STD <ric-id> [ <policy-id> [<policy-id>]* ] ) |
| 76 | # (Function for test scripts) |
| 77 | controller_api_get_A1_policy_ids() { |
| 78 | echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD |
| 79 | echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 80 | ((RES_TEST++)) |
| 81 | |
| 82 | paramError=1 |
| 83 | if [ $# -gt 3 ] && [ $2 == "OSC" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 84 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 85 | paramError=0 |
| 86 | elif [ $# -gt 2 ] && [ $2 == "STD" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 87 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 88 | paramError=0 |
| 89 | fi |
| 90 | |
| 91 | if [ $paramError -ne 0 ]; then |
| 92 | __print_err "<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) | ( STD <ric-id> [ <policy-id> [<policy-id>]* ] )" $@ |
| 93 | return 1 |
| 94 | fi |
| 95 | |
| 96 | res=$(__do_curl_to_controller getA1Policy "$url") |
| 97 | retcode=$? |
| 98 | status=${res:${#res}-3} |
| 99 | |
| 100 | if [ $? -ne 0 ]; then |
| 101 | echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED |
| 102 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 103 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 104 | return 1 |
| 105 | fi |
| 106 | |
| 107 | if [ $status -ne $1 ]; then |
| 108 | echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED |
| 109 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 110 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 111 | return 1 |
| 112 | fi |
| 113 | body=${res:0:${#res}-3} |
| 114 | |
| 115 | targetJson="[" |
| 116 | start=4 |
| 117 | if [ $2 == "OSC" ]; then |
| 118 | start=5 |
| 119 | fi |
| 120 | for pid in ${@:$start} ; do |
| 121 | if [ "$targetJson" != "[" ]; then |
| 122 | targetJson=$targetJson"," |
| 123 | fi |
BjornMagnussonXA | ad04778 | 2020-06-08 15:54:11 +0200 | [diff] [blame] | 124 | targetJson=$targetJson"\"$UUID$pid\"" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 125 | done |
| 126 | targetJson=$targetJson"]" |
| 127 | |
| 128 | echo " TARGET JSON: $targetJson" >> $HTTPLOG |
| 129 | |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 130 | res=$(python3 ../common/compare_json.py "$targetJson" "$body") |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 131 | |
| 132 | if [ $res -ne 0 ]; then |
| 133 | echo -e $RED" FAIL, returned body not correct"$ERED |
| 134 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 135 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 136 | return 1 |
| 137 | fi |
| 138 | |
| 139 | ((RES_PASS++)) |
| 140 | echo -e $GREEN" PASS"$EGREEN |
| 141 | return 0 |
| 142 | } |
| 143 | |
| 144 | |
| 145 | # Controller API Test function: getA1PolicyType |
| 146 | # arg: <response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>] |
| 147 | # (Function for test scripts) |
| 148 | controller_api_get_A1_policy_type() { |
| 149 | echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD |
| 150 | echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 151 | ((RES_TEST++)) |
| 152 | |
| 153 | paramError=1 |
| 154 | if [ $# -gt 3 ] && [ $2 == "OSC" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 155 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 156 | paramError=0 |
| 157 | fi |
| 158 | |
| 159 | if [ $paramError -ne 0 ]; then |
| 160 | __print_err "<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]" $@ |
| 161 | return 1 |
| 162 | fi |
| 163 | |
| 164 | res=$(__do_curl_to_controller getA1PolicyType "$url") |
| 165 | retcode=$? |
| 166 | status=${res:${#res}-3} |
| 167 | |
| 168 | if [ $? -ne 0 ]; then |
| 169 | echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED |
| 170 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 171 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 172 | return 1 |
| 173 | fi |
| 174 | |
| 175 | if [ $status -ne $1 ]; then |
| 176 | echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED |
| 177 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 178 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 179 | return 1 |
| 180 | fi |
| 181 | body=${res:0:${#res}-3} |
| 182 | |
| 183 | if [ $# -eq 5 ]; then |
| 184 | |
| 185 | body=${res:0:${#res}-3} |
| 186 | |
| 187 | targetJson=$(< $5) |
| 188 | echo " TARGET JSON: $targetJson" >> $HTTPLOG |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 189 | res=$(python3 ../common/compare_json.py "$targetJson" "$body") |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 190 | |
| 191 | if [ $res -ne 0 ]; then |
| 192 | echo -e $RED" FAIL, returned body not correct"$ERED |
| 193 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 194 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 195 | return 1 |
| 196 | fi |
| 197 | fi |
| 198 | |
| 199 | ((RES_PASS++)) |
| 200 | echo -e $GREEN" PASS"$EGREEN |
| 201 | return 0 |
| 202 | } |
| 203 | |
| 204 | # Controller API Test function: deleteA1Policy |
| 205 | # arg: <response-code> (STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>) |
| 206 | # (Function for test scripts) |
| 207 | controller_api_delete_A1_policy() { |
| 208 | echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD |
| 209 | echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 210 | ((RES_TEST++)) |
| 211 | |
| 212 | paramError=1 |
| 213 | if [ $# -eq 5 ] && [ $2 == "OSC" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 214 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 215 | paramError=0 |
| 216 | elif [ $# -eq 4 ] && [ $2 == "STD" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 217 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 218 | paramError=0 |
| 219 | fi |
| 220 | |
| 221 | if [ $paramError -ne 0 ]; then |
| 222 | __print_err "<response-code> (STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>)" $@ |
| 223 | return 1 |
| 224 | fi |
| 225 | |
| 226 | res=$(__do_curl_to_controller deleteA1Policy "$url") |
| 227 | retcode=$? |
| 228 | status=${res:${#res}-3} |
| 229 | |
| 230 | if [ $? -ne 0 ]; then |
| 231 | echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED |
| 232 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 233 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 234 | return 1 |
| 235 | fi |
| 236 | |
| 237 | if [ $status -ne $1 ]; then |
| 238 | echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED |
| 239 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 240 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 241 | return 1 |
| 242 | fi |
| 243 | |
| 244 | ((RES_PASS++)) |
| 245 | echo -e $GREEN" PASS"$EGREEN |
| 246 | return 0 |
| 247 | } |
| 248 | |
| 249 | # Controller API Test function: putA1Policy |
| 250 | # arg: <response-code> (STD <ric-id> <policy-id> <template-file> ) | (OSC <ric-id> <policy-type-id> <policy-id> <template-file>) |
| 251 | # (Function for test scripts) |
| 252 | controller_api_put_A1_policy() { |
| 253 | echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD |
| 254 | echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 255 | ((RES_TEST++)) |
| 256 | |
| 257 | paramError=1 |
| 258 | if [ $# -eq 6 ] && [ $2 == "OSC" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 259 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 260 | body=$(sed 's/XXX/'${5}'/g' $6) |
| 261 | |
| 262 | paramError=0 |
| 263 | elif [ $# -eq 5 ] && [ $2 == "STD" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 264 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 265 | body=$(sed 's/XXX/'${4}'/g' $5) |
| 266 | paramError=0 |
| 267 | fi |
| 268 | |
| 269 | if [ $paramError -ne 0 ]; then |
| 270 | __print_err "<response-code> (STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>)" $@ |
| 271 | return 1 |
| 272 | fi |
| 273 | |
| 274 | res=$(__do_curl_to_controller putA1Policy "$url" "$body") |
| 275 | retcode=$? |
| 276 | status=${res:${#res}-3} |
| 277 | |
| 278 | if [ $? -ne 0 ]; then |
| 279 | echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED |
| 280 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 281 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 282 | return 1 |
| 283 | fi |
| 284 | |
| 285 | if [ $status -ne $1 ]; then |
| 286 | echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED |
| 287 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 288 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 289 | return 1 |
| 290 | fi |
| 291 | |
| 292 | ((RES_PASS++)) |
| 293 | echo -e $GREEN" PASS"$EGREEN |
| 294 | return 0 |
| 295 | } |
| 296 | |
| 297 | |
| 298 | # Controller API Test function: getA1PolicyStatus |
| 299 | # arg: <response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) | (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>) |
| 300 | # (Function for test scripts) |
| 301 | controller_api_get_A1_policy_status() { |
| 302 | echo -e $BOLD"TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ $EBOLD |
| 303 | echo "TEST(${BASH_LINENO[0]}): ${FUNCNAME[0]}" $@ >> $HTTPLOG |
| 304 | ((RES_TEST++)) |
| 305 | |
| 306 | targetJson="" |
| 307 | paramError=1 |
| 308 | if [ $# -ge 5 ] && [ $2 == "OSC" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 309 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/a1-p/policytypes/$4/policies/$UUID$5/status" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 310 | if [ $# -gt 5 ]; then |
| 311 | targetJson="{\"instance_status\":\"$6\"" |
| 312 | targetJson=$targetJson",\"has_been_deleted\":\"$7\"" |
| 313 | targetJson=$targetJson",\"created_at\":\"????\"}" |
| 314 | fi |
| 315 | paramError=0 |
| 316 | elif [ $# -ge 4 ] && [ $2 == "STD" ]; then |
BjornMagnussonXA | 575869c | 2020-09-14 21:28:54 +0200 | [diff] [blame] | 317 | url="$RIC_SIM_HTTPX://$3:$RIC_SIM_PORT/A1-P/v1/policies/$UUID$4/status" |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 318 | if [ $# -gt 4 ]; then |
| 319 | targetJson="{\"enforceStatus\":\"$5\"" |
| 320 | if [ $# -eq 6 ]; then |
| 321 | targetJson=$targetJson",\"reason\":\"$6\"" |
| 322 | fi |
| 323 | targetJson=$targetJson"}" |
| 324 | fi |
| 325 | paramError=0 |
| 326 | fi |
| 327 | |
| 328 | if [ $paramError -ne 0 ]; then |
| 329 | __print_err "<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) | (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)" $@ |
| 330 | return 1 |
| 331 | fi |
| 332 | |
| 333 | res=$(__do_curl_to_controller getA1PolicyStatus "$url") |
| 334 | retcode=$? |
| 335 | status=${res:${#res}-3} |
| 336 | |
| 337 | if [ $? -ne 0 ]; then |
| 338 | echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED |
| 339 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 340 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 341 | return 1 |
| 342 | fi |
| 343 | |
| 344 | if [ $status -ne $1 ]; then |
| 345 | echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED |
| 346 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 347 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 348 | return 1 |
| 349 | fi |
| 350 | |
| 351 | if [ ! -z "$targetJson" ]; then |
| 352 | |
| 353 | body=${res:0:${#res}-3} |
| 354 | echo " TARGET JSON: $targetJson" >> $HTTPLOG |
BjornMagnussonXA | 72667f1 | 2020-04-24 09:20:18 +0200 | [diff] [blame] | 355 | res=$(python3 ../common/compare_json.py "$targetJson" "$body") |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 356 | |
| 357 | if [ $res -ne 0 ]; then |
| 358 | echo -e $RED" FAIL, returned body not correct"$ERED |
| 359 | ((RES_FAIL++)) |
BjornMagnussonXA | 048aaa1 | 2020-06-04 07:48:37 +0200 | [diff] [blame] | 360 | __check_stop_at_error |
BjornMagnussonXA | 80a9200 | 2020-03-19 14:31:06 +0100 | [diff] [blame] | 361 | return 1 |
| 362 | fi |
| 363 | fi |
| 364 | |
| 365 | ((RES_PASS++)) |
| 366 | echo -e $GREEN" PASS"$EGREEN |
| 367 | return 0 |
| 368 | } |