X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fmrstub%2Fbasic_test.sh;h=6e854ead36b533ae1d65eb8734d5d8ca8810cc11;hb=333e6d78ea15d1b8eefafcab426ac2fc641386de;hp=e9ca1d25000b111ac24ba75f720d308ba5763b1b;hpb=ba50f8809edc7d49a74021e25b4094f4c3174b26;p=nonrtric.git diff --git a/test/mrstub/basic_test.sh b/test/mrstub/basic_test.sh index e9ca1d25..6e854ead 100755 --- a/test/mrstub/basic_test.sh +++ b/test/mrstub/basic_test.sh @@ -31,12 +31,12 @@ fi if [ $1 == "nonsecure" ]; then #Default http port for the simulator - PORT=3905 + PORT=3904 # Set http protocol HTTPX="http" else #Default https port for the mr-stub - PORT=3906 + PORT=3905 # Set https protocol HTTPX="https" fi @@ -44,6 +44,8 @@ fi # source function to do curl and check result . ../common/do_curl_function.sh +RESP_CONTENT='*' #Dont check resp content type + echo "=== Stub hello world ===" RESULT="OK" do_curl GET / 200 @@ -72,7 +74,7 @@ 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="{}" do_curl POST /events/A1-POLICY-AGENT-WRITE 200 .tmp.json @@ -81,6 +83,16 @@ 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 ===" @@ -154,6 +166,17 @@ echo "=== Fetch a response ===" RESULT="test2-response200" do_curl GET '/receive-response?correlationid='$CORRID 200 + +echo "=== Send a json response ===" +# Create minimal accepted response message, array +echo "{\"correlationId\": \""$CORRID"\", \"message\": {\"test\":\"testresponse\"}, \"status\": \"200\"}" > .tmp.json +RESULT="{}" +do_curl POST /events/generic-path 200 .tmp.json + +echo "=== Fetch a request ===" +RESULT="json:[\"{\\\"correlationId\\\": \\\""$CORRID"\\\", \\\"message\\\": {\\\"test\\\": \\\"testresponse\\\"}, \\\"status\\\": \\\"200\\\"}\"]" +do_curl GET '/events/generic-path' 200 + echo "********************" echo "*** All tests ok ***" echo "********************" \ No newline at end of file