+}
+
+# Wait for http status on url
+# args: <response-code> <ric-id>
+# (Function for test scripts)
+controller_api_wait_for_status_ok() {
+ __log_conf_start $@
+
+ if [ $# -ne 2 ]; then
+ __print_err "<response-code> <ric-id> " $@
+ return 1
+ fi
+ ric_id=$(__find_sim_host $2)
+ url="$ric_id/"
+
+ TS_START=$SECONDS
+ while [ $(($TS_START+500)) -gt $SECONDS ]; do
+ echo -ne " Waiting for http status $1 on $url via sdnc, waited: $(($SECONDS-$TS_START))"$SAMELINE
+ res=$(__do_curl_to_controller getA1Policy "$url")
+ retcode=$?
+ status=${res:${#res}-3}
+ if [ $retcode -eq 0 ]; then
+ if [ $status -eq $1 ]; then
+ echo ""
+ __log_conf_ok
+ return 0
+ fi
+ fi
+ sleep 5
+ done
+ echo ""
+ __log_conf_fail_general
+ return 1
+}