body=$(echo "$3" | sed 's/"/\\"/g')
json='{"input":{"near-rt-ric-url":"'$2'","body":"'"$body"'"}}'
fi
- echo "$json" > .sndc.payload.json
+ echo "$json" > .sdnc.payload.json
echo " FILE: $json" >> $HTTPLOG
- curlString="curl -sw %{http_code} -X POST http://$SDNC_USER:$SDNC_PWD@localhost:$SDNC_EXTERNAL_PORT$SDNC_API_URL$1 -H accept:application/json -H Content-Type:application/json --data-binary @.sndc.payload.json"
+ 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 @.sdnc.payload.json"
echo " CMD: "$curlString >> $HTTPLOG
res=$($curlString)
retcode=$?
return 1
fi
body=${res:0:${#res}-3}
+ echo " JSON: "$body >> $HTTPLOG
echo "$body" > .sdnc-reply.json
res=$(python3 ../common/extract_sdnc_reply.py .sdnc-reply.json)
echo " EXTRACED BODY+CODE: "$res >> $HTTPLOG
if [ $? -ne 0 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $status -ne $1 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
body=${res:0:${#res}-3}
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $? -ne 0 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $status -ne $1 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
body=${res:0:${#res}-3}
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
fi
if [ $? -ne 0 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $status -ne $1 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $? -ne 0 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $status -ne $1 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $? -ne 0 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status "(likely remote server error)"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $status -ne $1 ]; then
echo -e $RED" FAIL. Exepected status "$1", got "$status $ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
+ __check_stop_at_error
return 1
fi
fi