diff --git a/ccsrc/Protocols/Http/http_codec.cc b/ccsrc/Protocols/Http/http_codec.cc index 1a8a2323f6dd6d692206bdd481e835635b004ab2..6a580a6080bebc939e75d24b6b642ead009d5fbe 100644 --- a/ccsrc/Protocols/Http/http_codec.cc +++ b/ccsrc/Protocols/Http/http_codec.cc @@ -496,7 +496,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod if (decoding_buffer.get_len() - decoding_buffer.get_pos() <= 0) { return -1; } - /* TODO Uncommentif (p_content_type.empty()) { + /* TODO Uncomment if (p_content_type.empty()) { loggers::get_instance().warning("http_codec::encode_body: Failed to select a codec for HTTP body payload"); return -1; }*/ diff --git a/etc/AtsMec/AtsMec.cfg b/etc/AtsMec/AtsMec.cfg index 9d55e35c0082a1f92c2350b0fe3a04c871f19a55..c0419a7a9fbb507c550969038e8e06044533c56a 100644 --- a/etc/AtsMec/AtsMec.cfg +++ b/etc/AtsMec/AtsMec.cfg @@ -13,11 +13,12 @@ LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.0.17" LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibMec_Pics.PICS_MEC_PLAT := true +LibMec_Pics.PICS_SERVICES := true LibMec_Pics.PICS_RNIS := false -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true +LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := false -UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false +UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := true BwManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := false @@ -62,7 +63,34 @@ system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.1 [EXECUTE] # In this section you can specify what parts of your test suite you want to execute. -AtsMec_TestControl.control +#AtsMec_TestControl.control +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_OK +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_BR +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_NF +AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_OK +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_BR +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UELOC_001_OK +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UELOC_001_BR +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UELOC_001_NF + +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_001_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_001_BR +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_002_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_002_NF + +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_001_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_001_BR +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_002_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_002_NF + +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_BR +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_NF + +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_001_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_001_BR +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_NF [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn index aa9027b60761a8b77e8036283931ce5dd4cd5499..9ad64c77523a61ab59a5a7c79df1e2c98580ca22 100644 --- a/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn @@ -80,6 +80,8 @@ module AtsMec_BwManagementAPI_TestCases { mw_body_json_bw_info( mw_bw_info ))))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn index b13cf6164eb107f8d9ac0fde900532e648c13dd6..471ebc796af0c3c34231794cdae3aeed0c9e4cf9 100644 --- a/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn @@ -81,6 +81,8 @@ module AtsMec_LocationAPI_TestCases { * } )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -134,6 +136,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -187,6 +191,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_404_not_found )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -258,6 +264,8 @@ module AtsMec_LocationAPI_TestCases { PX_CALLBACK_REF_URL, PX_USER )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -319,6 +327,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -371,6 +381,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_204_no_content )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -423,6 +435,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_404_not_found )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -485,6 +499,8 @@ module AtsMec_LocationAPI_TestCases { PX_CALLBACK_REF_URL, PX_USER )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -546,6 +562,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -598,6 +616,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_204_no_content )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 204 No Content ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -650,6 +670,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -709,6 +731,8 @@ module AtsMec_LocationAPI_TestCases { mw_body_json_user_list( mw_user_list(-, ?) ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -761,6 +785,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -813,6 +839,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_404_not_found )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -884,6 +912,8 @@ module AtsMec_LocationAPI_TestCases { PX_CALLBACK_REF_URL, PX_ZONE_ID )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -945,6 +975,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_400_bad_request )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1006,6 +1038,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_204_no_content )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1058,6 +1092,8 @@ module AtsMec_LocationAPI_TestCases { mw_http_response( mw_http_response_404_not_found )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn index 45872e662a165de708a28cb0a0a58b105358d166..ab831df3c0a2df02684d8a96f9e8fcda62b94922 100644 --- a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn @@ -81,6 +81,8 @@ module AtsMec_RadioNodeLocationAPI_TestCases { mw_access_point_list( PX_ZONE_ID )))))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with an AccessPoint list containing a ZoneId ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn index a491ccad7aaaded065488947c5d0e8f66ae0a136..40768846e77c56d3bbb178cc23ce9330cfb4c525 100644 --- a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn @@ -82,6 +82,8 @@ module AtsMec_RnisAPI_TestCases { PX_LINKS_SELF, ? )))))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn index 69dbb2d1fd418d08250d7f42114f335e729aece9..a11924adfbef421ed232dbc9eeee5b9a5d768861 100644 --- a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn @@ -75,8 +75,9 @@ module AtsMec_UEidentityAPI_TestCases { mw_body_json_ue_identity_tag_info( mw_ue_identity_tag_info( { *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG), * } - - )))))) { + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -115,7 +116,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - "/" & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG_UNKNOWN, "UTF-8")), + "/" & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/invalid/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ) ) @@ -133,6 +134,8 @@ module AtsMec_UEidentityAPI_TestCases { mw_problem_details( -, -, 400 )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -189,6 +192,8 @@ module AtsMec_UEidentityAPI_TestCases { mw_problem_details( -, -, 404 )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -225,7 +230,7 @@ module AtsMec_UEidentityAPI_TestCases { // Preamble f_init_default_headers_list(-, -, v_headers); // Verify that the user is not register yet - if (f_check_user_register_state(-, v_headers) != 0) { + if (f_check_user_register_state(-, v_headers) != 0) { log("*** " & testcasename() & ": INCONC: Wrong initial conditions ***"); f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } @@ -262,6 +267,8 @@ module AtsMec_UEidentityAPI_TestCases { mw_ue_identity_tag_info( { *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG, REGISTERED), * } )))))) { + tc_ac.stop; + if (f_check_user_register_state(-, v_headers) == 1) { log("*** " & testcasename() & ": PASS: IUT successfully registered the tag ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); @@ -340,6 +347,8 @@ module AtsMec_UEidentityAPI_TestCases { mw_problem_details( -, -, 400 )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 403 Forbidden ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -413,6 +422,8 @@ module AtsMec_UEidentityAPI_TestCases { mw_problem_details( -, -, 412 )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn index b9e4801795c635e0532af1b413b936b320413eec..6d91d0c074e62cffc94a8374224c0cc605217273 100644 --- a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn @@ -5,6 +5,7 @@ module LibMec_Functions { // LibMec import from LibMec_Pixits all; + import from LibMec_Pics all; // LibMec_UEidentityAPI import from UEidentityAPI_TypesAndValues all; @@ -85,7 +86,7 @@ module LibMec_Functions { httpPort.send( m_http_request( m_http_request_get( - PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), + "/" & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), p_headers ) ) @@ -102,12 +103,18 @@ module LibMec_Functions { mw_ue_identity_tag_info( { *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG), * } )))))) -> value v_response { + tc_ac.stop; + for (var integer v_i := 0; v_i < lengthof(v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags); v_i := v_i + 1) { if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag == p_ue_identity_tag) { + //log("Processing ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag); + //log("State ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state); if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == UNREGISTERED) { v_result := 0; - } else { + } else if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == REGISTERED) { v_result := 1; + } else if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == INVALID_STATE) { + v_result := 2; } break; }