X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fmrstub%2Fbasic_test.sh;h=8b2347dc127f37e9f13734c8f86350c1388fd919;hb=f0a158c3c32b6547c839c559548e4e4b729802e1;hp=577894d8211b3ff21b51172adf968dab5baa6296;hpb=72667f1d4b9e534b38b206f64f2ac67df01a2ed9;p=nonrtric.git diff --git a/test/mrstub/basic_test.sh b/test/mrstub/basic_test.sh index 577894d8..8b2347dc 100755 --- a/test/mrstub/basic_test.sh +++ b/test/mrstub/basic_test.sh @@ -72,15 +72,25 @@ RESULT="json:[{\"apiVersion\":\"1.0\",\"operation\":\"PUT\",\"correlationId\":\" do_curl GET '/events/A1-POLICY-AGENT-READ/users/policy-agent' 200 echo "=== Send a json response ===" -# Create minimal accepted response message +# Create minimal accepted response message, array echo "[{\"correlationId\": \""$CORRID"\", \"message\": {\"test\":\"testresponse\"}, \"status\": \"200\"}]" > .tmp.json -RESULT="OK" +RESULT="{}" do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json echo "=== Fetch a response ===" RESULT="{\"test\": \"testresponse\"}200" do_curl GET '/receive-response?correlationid='$CORRID 200 +echo "=== Send a json response ===" +# Create minimal accepted response message, single message - no array +echo "{\"correlationId\": \""$CORRID"\", \"message\": {\"test\":\"testresponse2\"}, \"status\": \"200\"}" > .tmp.json +RESULT="{}" +do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json + +echo "=== Fetch a response ===" +RESULT="{\"test\": \"testresponse2\"}200" +do_curl GET '/receive-response?correlationid='$CORRID 200 + ### Test with plain text response echo "=== Send a request ===" @@ -115,7 +125,7 @@ RESULT="json:[]" do_curl GET '/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=5000' 200 T2=$SECONDS if [ $(($T2-$T1)) -lt 5 ] || [ $(($T2-$T1)) -gt 7 ]; then - echo "Delay to short or too long"$(($T2-$T1))". Should be 10 sec" + echo "Delay too short or too long"$(($T2-$T1))". Should be 10 sec" exit 1 else echo " Delay ok:"$(($T2-$T1)) @@ -147,7 +157,7 @@ do_curl GET '/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=1000&limit= echo "=== Send a json response ===" # Create minimal accepted response message echo "[{\"correlationId\": \""$CORRID"\", \"message\": \"test2-response\", \"status\": \"200\"}]" > .tmp.json -RESULT="OK" +RESULT="{}" do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json echo "=== Fetch a response ===" @@ -156,4 +166,4 @@ do_curl GET '/receive-response?correlationid='$CORRID 200 echo "********************" echo "*** All tests ok ***" -echo "********************" +echo "********************" \ No newline at end of file