Commit 651d6feb authored by YannGarcia's avatar YannGarcia
Browse files

Review UEidentityAPI tests

parent 79d00f6f
...@@ -27,13 +27,13 @@ module AtsMec_TestControl { ...@@ -27,13 +27,13 @@ module AtsMec_TestControl {
execute(TC_MEC_PLAT_MP1_LOC_BV_001()); execute(TC_MEC_PLAT_MP1_LOC_BV_001());
} }
if (PICS_UE_IDENTITY_API_SUPPORTED) { if (PICS_UE_IDENTITY_API_SUPPORTED) {
execute(TC_MEC_PLAT_MP1_UETAG_BV_001()); execute(TC_MEC_PLAT_UETAG_001_OK());
execute(TC_MEC_PLAT_MP1_UETAG_BV_002()); execute(TC_MEC_PLAT_UETAG_002_OK());
execute(TC_MEC_PLAT_MP1_UETAG_BV_003()); execute(TC_MEC_PLAT_UETAG_003_OK());
execute(TC_MEC_PLAT_MP1_UETAG_BI_001()); execute(TC_MEC_PLAT_UETAG_001_BI());
execute(TC_MEC_PLAT_MP1_UETAG_BI_002()); execute(TC_MEC_PLAT_UETAG_002_BI());
execute(TC_MEC_PLAT_MP1_UETAG_BI_003()); execute(TP_MEC_PLAT_UETAG_003_BI());
execute(TC_MEC_PLAT_MP1_UETAG_BI_004()); execute(TP_MEC_PLAT_UETAG_004_BI());
} }
if (PICS_LOCATION_API_SUPPORTED) { if (PICS_LOCATION_API_SUPPORTED) {
execute(TC_MEC_PLAT_MP1_INF_BV_001()); execute(TC_MEC_PLAT_MP1_INF_BV_001());
......
...@@ -40,7 +40,7 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -40,7 +40,7 @@ module AtsMec_UEidentityAPI_TestCases {
* @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application * @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BV_001() runs on HttpComponent system HttpTestAdapter { testcase TC_MEC_PLAT_UETAG_001_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -92,13 +92,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -92,13 +92,13 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_001 } // End of testcase TC_MEC_PLAT_UETAG_001_OK
/** /**
* @desc Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application * @desc Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BV_002() runs on HttpComponent system HttpTestAdapter { testcase TC_MEC_PLAT_UETAG_002_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -161,13 +161,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -161,13 +161,13 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_002 } // End of testcase TC_MEC_PLAT_UETAG_002_OK
/** /**
* @desc Check that the IUT deregisters a tag (representing a UE) or a list of tags when commanded by a MEC Application * @desc Check that the IUT deregisters a tag (representing a UE) or a list of tags when commanded by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BV_003() runs on HttpComponent system HttpTestAdapter { testcase TC_MEC_PLAT_UETAG_003_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -230,13 +230,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -230,13 +230,13 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_003 } // End of testcase TC_MEC_PLAT_UETAG_003_OK
/** /**
* @desc Check that the IUT responds with ProblemDetails on information on an unknown UE Identity tag when queried by a MEC Application * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BI_001() runs on HttpComponent system HttpTestAdapter { testcase TC_MEC_PLAT_UETAG_001_BI() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -270,13 +270,70 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -270,13 +270,70 @@ module AtsMec_UEidentityAPI_TestCases {
alt { alt {
[] httpPort.receive( [] httpPort.receive(
mw_http_response( mw_http_response(
mw_http_response_404_not_found( mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_ue_identity_problem_details(
mw_problem_details(
-, -, 400
)))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_UETAG_001_BI
/**
* @desc Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/
testcase TC_MEC_PLAT_UETAG_002_BI() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Test adapter configuration
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_get(
PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID_UNAUTHORIZED, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_403_forbidden(
mw_http_message_body_json( mw_http_message_body_json(
mw_body_json_ue_identity_problem_details( mw_body_json_ue_identity_problem_details(
mw_problem_details( mw_problem_details(
-, -, 404 -, -, 403
)))))) -> value v_response { )))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 403 Forbidden ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success); f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} }
[] tc_ac.timeout { [] tc_ac.timeout {
...@@ -287,13 +344,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -287,13 +344,13 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_001 } // End of testcase TC_MEC_PLAT_UETAG_002_BI
/** /**
* @desc Check that the IUT responds with ProblemDetails on information an unknown Application Instance Identifier when queried by a MEC Application * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BI_002() runs on HttpComponent system HttpTestAdapter { testcase TC_MEC_PLAT_UETAG_003_BI() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -315,7 +372,7 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -315,7 +372,7 @@ module AtsMec_UEidentityAPI_TestCases {
httpPort.send( httpPort.send(
m_http_request( m_http_request(
m_http_request_get( m_http_request_get(
PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID_UNKNOWN, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
v_headers v_headers
) )
) )
...@@ -344,13 +401,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -344,13 +401,13 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_002 } // End of testcase TC_MEC_PLAT_UETAG_003_BI
/** /**
* @desc Check that the IUT responds with ProblemDetails on information an invalid URI * @desc Check that the IUT responds with ProblemDetails on information an invalid URI
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BI_003() runs on HttpComponent system HttpTestAdapter { testcase TP_MEC_PLAT_UETAG_003_BI() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
...@@ -401,37 +458,49 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -401,37 +458,49 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_003 } // End of testcase TP_MEC_PLAT_UETAG_003_BI
/** /**
* @desc Check that the IUT responds with ProblemDetails on information on not allowed request * @desc Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
*/ */
testcase TC_MEC_PLAT_MP1_UETAG_BI_004() runs on HttpComponent system HttpTestAdapter { testcase TP_MEC_PLAT_UETAG_004_BI() runs on HttpComponent system HttpTestAdapter {
// Local variables // Local variables
var HeaderLines v_headers; var HeaderLines v_headers;
var HttpMessage v_response; var HttpMessage v_response;
// Test control // Test control
if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
setverdict(inconc); setverdict(inconc);
stop; stop;
} }
// Test component configuration // Test component configuration
f_cf_01_http_up(); f_cf_01_http_up();
// Test adapter configuration // Test adapter configuration
// Preamble // Preamble
f_init_default_headers_list(-, -, v_headers); f_init_default_headers_list(-, -, v_headers);
httpPort.send( httpPort.send(
m_http_request( m_http_request(
m_http_request_get( m_http_request_post(
PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info",
v_headers v_headers,
) m_http_message_body_json(
m_body_json_ue_identity_tag_info(
m_ue_identity_tag_info(
{
m_ue_identity_tag_item(
PX_UE_IDENTITY_TAG,
INVALID_STATE
)
}
)
)
)
)
) )
); );
f_selfOrClientSyncAndVerdict(c_prDone, e_success); f_selfOrClientSyncAndVerdict(c_prDone, e_success);
...@@ -441,13 +510,13 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -441,13 +510,13 @@ module AtsMec_UEidentityAPI_TestCases {
alt { alt {
[] httpPort.receive( [] httpPort.receive(
mw_http_response( mw_http_response(
mw_http_response_403_forbidden( mw_http_response_400_bad_request(
mw_http_message_body_json( mw_http_message_body_json(
mw_body_json_ue_identity_problem_details( mw_body_json_ue_identity_problem_details(
mw_problem_details( mw_problem_details(
-, -, 403 -, -, 400
)))))) -> value v_response { )))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success); f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} }
[] tc_ac.timeout { [] tc_ac.timeout {
...@@ -458,7 +527,7 @@ module AtsMec_UEidentityAPI_TestCases { ...@@ -458,7 +527,7 @@ module AtsMec_UEidentityAPI_TestCases {
// Postamble // Postamble
f_cf_01_http_down(); f_cf_01_http_down();
} // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_004 } // End of testcase TP_MEC_PLAT_UETAG_004_BI
} // End of group me_app_role } // End of group me_app_role
......
...@@ -8,9 +8,9 @@ module UEidentityAPI_Pixits { ...@@ -8,9 +8,9 @@ module UEidentityAPI_Pixits {
modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01"; modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01";
modulepar universal charstring PX_APP_INSTANCE_ID_UNKNOWN := "appInst99"; modulepar universal charstring PX_NON_EXISTENT_APP_INSTANCE_ID := "appInst99";
modulepar universal charstring APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS := "appInst98"; modulepar universal charstring PX_APP_INSTANCE_ID_UNAUTHORIZED := "appInst98";
modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA"; modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA";
......
...@@ -56,7 +56,8 @@ module UEidentityAPI_TypesAndValues { ...@@ -56,7 +56,8 @@ module UEidentityAPI_TypesAndValues {
*/ */
type enumerated State { type enumerated State {
UNREGISTERED, UNREGISTERED,
REGISTERED REGISTERED,
INVALID_STATE // Used for BI tests
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment