return 1
fi
- if [ $ADAPTER == $RESTBASE ]; then
+ if [ $ADAPTER == $RESTBASE ] || [ $ADAPTER == $RESTBASE_SECURE ]; then
url=" "${ADAPTER}${2}
oper=" -X "$oper
- curlString="curl"${oper}${timeout}${httpcode}${accept}${content}${url}${file}
+ curlString="curl -k "${oper}${timeout}${httpcode}${accept}${content}${url}${file}
echo " CMD: "$curlString >> $HTTPLOG
if [ $# -eq 3 ]; then
echo " FILE: $(<$3)" >> $HTTPLOG
file=" --data-binary "$payload
fi
#urlencode the request url since it will be carried by send-request url
- requestUrl=$(python -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "$2")
+ requestUrl=$(python3 -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "$2")
url=" "${ADAPTER}"/send-request?url="${requestUrl}"&operation="${oper}
curlString="curl -X POST${timeout}${httpcode}${content}${url}${file}"
echo " CMD: "$curlString >> $HTTPLOG
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body" "id")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
sed 's/XXX/'${2}'/g' $3 > $file
targetJson=$(< $file)
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
sed 's/XXX/'${pid}'/g' $6 > $file
res="$(__do_curl_to_agent PUT $query $file)"
status=${res:${#res}-3}
- echo -ne " Creating "$count"("$max")\033[0K\r"
+ echo -ne " Creating "$count"("$max")${SAMELINE}"
if [ $status -ne $1 ]; then
let pid=$pid+1
let pid=$pid+1
let count=$count+1
- echo -ne " Created "$count"("$max")\033[0K\r"
+ echo -ne " Created "$count"("$max")${SAMELINE}"
done
echo ""
query="/policy?id="$pid
res="$(__do_curl_to_agent DELETE $query)"
status=${res:${#res}-3}
- echo -ne " Deleting "$count"("$max")\033[0K\r"
+ echo -ne " Deleting "$count"("$max")${SAMELINE}"
if [ $status -ne $1 ]; then
echo " Deleted "$count"?("$max")"
fi
let pid=$pid+1
let count=$count+1
- echo -ne " Deleted "$count"("$max")\033[0K\r"
+ echo -ne " Deleted "$count"("$max")${SAMELINE}"
done
echo ""
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
targetJson=$(< $3)
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
if [ $file == "NOFILE" ]; then
targetJson=$targetJson"{}"
else
- targetJson=$targetJson$(< $3)
+ targetJson=$targetJson$(< $file)
fi
done
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
echo "TARGET JSON: $targetJson" >> $HTTPLOG
body=${res:0:${#res}-3}
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
if [ $# -gt 2 ]; then
body=${res:0:${#res}-3}
- res=$(python ../common/create_rics_json.py ".tmp_rics.json" "$3" )
+ res=$(python3 ../common/create_rics_json.py ".tmp_rics.json" "$3" )
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, could not create target ric info json"$ERED
((RES_FAIL++))
targetJson=$(<.tmp_rics.json)
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
done
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body" "serviceName")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED
((RES_FAIL++))
targetJson=$targetJson"]"
echo "TARGET JSON: $targetJson" >> $HTTPLOG
- res=$(python ../common/compare_json.py "$targetJson" "$body" "serviceName")
+ res=$(python3 ../common/compare_json.py "$targetJson" "$body")
if [ $res -ne 0 ]; then
echo -e $RED" FAIL, returned body not correct"$ERED