Commit 2be74c99 authored by YannGarcia's avatar YannGarcia

Finalyze RnisQuery_BV/RnisQuery_BI_BO tests

parent 68867733
......@@ -27,8 +27,37 @@ https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purpo
https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2
- TC_MEC_SRV_RNIS_011_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_012_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_011_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_012_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_016_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_016_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_016_NF <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_017_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_017_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_017_NF <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_018_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_018_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_018_NF <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_019_OK <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_019_BR <font color="color:green">To be tested</font>
- TC_MEC_SRV_RNIS_019_NF <font color="color:green">To be tested</font>
### SAQ
### SRVSUB
......
......@@ -99,14 +99,126 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
traffic_rule.decode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.trafficRule() = traffic_rule;
} else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) {
// Replace "type": "1" by type": "EU_IPV4_ADDRESS", "type": "2"...
// TODO Create a method instead of copy/past
//loggers::get_instance().log("json_codec::decode: Before, str=%s", str.c_str());
std::size_t it_start = str.find("\"type\"");
loggers::get_instance().log("json_codec::decode: id_start=%d", it_start);
if (it_start != std::string::npos) {
std::size_t it_stop = str.find(",", it_start);
//loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop);
//loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str());
std::size_t it = str.find("1", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV4_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("2", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV6_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("3", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "NATED_IP_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("4", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "GTP_TEID" + str.substr(it + 1);
}
}
}
}
}
//loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str());
decoding_buffer.clear();
decoding_buffer.put_os(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription;
cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.cellChangeSubscription() = cell_change_subscription;
//TODO Continue with other ChangeSubscription
} else if (it->second.find("\"RabInfo\"") != std::string::npos) {
// Replace "type": "1" by type": "EU_IPV4_ADDRESS", "type": "2"...
// TODO Create a method instead of copy/past
// loggers::get_instance().log("json_codec::decode: Before, str=%s", str.c_str());
std::size_t it_start = str.find("\"type\"");
loggers::get_instance().log("json_codec::decode: id_start=%d", it_start);
if (it_start != std::string::npos) {
std::size_t it_stop = str.find(",", it_start);
//loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop);
//loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str());
std::size_t it = str.find("1", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV4_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("2", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV6_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("3", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "NATED_IP_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("4", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "GTP_TEID" + str.substr(it + 1);
}
}
}
}
}
//loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str());
decoding_buffer.clear();
decoding_buffer.put_os(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
RnisAPI__TypesAndValues::RabInfo rab_info;
rab_info.decode(RnisAPI__TypesAndValues::RabInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.rabInfo() = rab_info;
} else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) {
// Replace "type": "1" by type": "EU_IPV4_ADDRESS", "type": "2"...
// TODO Create a method instead of copy/past
// loggers::get_instance().log("json_codec::decode: Before, str=%s", str.c_str());
std::size_t it_start = str.find("\"type\"");
loggers::get_instance().log("json_codec::decode: id_start=%d", it_start);
if (it_start != std::string::npos) {
std::size_t it_stop = str.find(",", it_start);
//loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop);
//loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str());
std::size_t it = str.find("1", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV4_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("2", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "UE_IPV6_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("3", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "NATED_IP_ADDRESS" + str.substr(it + 1);
} else {
it = str.find("4", it_start, 1);
//loggers::get_instance().log("json_codec::decode: it=%d", it);
if ((it != std::string::npos) && (it < it_stop)) {
str = str.substr(0, it) + "GTP_TEID" + str.substr(it + 1);
}
}
}
}
}
//loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str());
decoding_buffer.clear();
decoding_buffer.put_os(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
RnisAPI__TypesAndValues::S1BearerInfo s1_nearer_info;
s1_nearer_info.decode(RnisAPI__TypesAndValues::S1BearerInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.s1BearerInfo() = s1_nearer_info;
} else if (it->second.find("\"PlmnInfo\"") != std::string::npos) {
RnisAPI__TypesAndValues::PlmnInfo plmn_info;
plmn_info.decode(RnisAPI__TypesAndValues::PlmnInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
......@@ -139,7 +251,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
RnisAPI__TypesAndValues::ProblemDetails problem_details;
problem_details.decode(RnisAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.problemDetails__rni() = problem_details;
msg.problemDetails__rnis() = problem_details;
} else {
......
......@@ -104,7 +104,18 @@ system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.1
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_012_OK
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_011_BR
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_012_BR
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_OK
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_OK
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_OK
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_OK
#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_OK
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_BR
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_NF
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_BR
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_NF
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_BR
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_NF
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_BR
AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_NF
#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRANS_001_OK
#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_001_OK
......
......@@ -355,7 +355,7 @@ module AtsMec_RnisAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "?cell_id=" & oct2char(unichar2oct(PX_CELL_ID, "UTF-8")),
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/rab_info?cell_id=" & oct2char(unichar2oct(PX_CELL_ID, "UTF-8")),
v_headers
)
)
......@@ -374,11 +374,15 @@ module AtsMec_RnisAPI_TestCases {
mw_time_stamp,
PX_APP_INS_ID,
-,
{
mw_cell_user_info(
mw_ecgi(
mw_plmn,
PX_CELL_ID
)))))))) {
)
)
}
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a RAB information ***");
......@@ -419,7 +423,7 @@ module AtsMec_RnisAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "?cell_id=" & oct2char(unichar2oct(PX_CELL_ID, "UTF-8")),
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/plmn_info?app_ins_id=" & oct2char(unichar2oct(PX_APP_INS_ID, "UTF-8")),
v_headers
)
)
......@@ -437,10 +441,8 @@ module AtsMec_RnisAPI_TestCases {
mw_plmn_info(
mw_time_stamp,
PX_APP_INS_ID,
mw_ecgi(
mw_plmn,
PX_CELL_ID
))))))) {
{ mw_plmn }
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a PLMN information ***");
......@@ -456,7 +458,572 @@ module AtsMec_RnisAPI_TestCases {
f_cf_01_http_down();
} // End of testcase TC_MEC_SRV_RNIS_017_OK
/**
* @desc Check that the RNIS service returns the S1 bearer information.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2
*/
testcase TC_MEC_SRV_RNIS_018_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/s1_bearer_info?cell_id=" & oct2char(unichar2oct(PX_CELL_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_s1_bearer_info(
mw_s1_bearer_info(
mw_time_stamp,
{
mw_s1_ue_info(
{ mw_temp_ue_id },
{ mw_associate_id },
{ *, mw_ecgi(mw_plmn, PX_CELL_ID), * },
{
mw_s1_bearer_info_detailed
// TODO To be refined
})
})))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a S1BearerInfo information ***");
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_SRV_RNIS_018_OK
/**
* @desc Check that the RNIS service returns the L2 measurements information.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2
*/
testcase TC_MEC_SRV_RNIS_019_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Test adapter configuration
// Preamble
// Test Body
log("*** " & testcasename() & ": INCONC: Too many changes in JSON data description, not implemented ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
// Postamble
f_cf_01_http_down();
} // End of testcase TC_MEC_SRV_RNIS_019_OK
} // End of group rnis_query
group rnis_query_bi_bo {
/**
* @desc Check that the RNIS service returns an error when the RAB information is requested with a malformatted message.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_016_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/rab_info?c_id=" & oct2char(unichar2oct(PX_CELL_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 400
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_016_BR
/**
* @desc Check that the RNIS service returns an error when the RAB information is requested with a malformatted message.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_016_NF() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/rab_info?cell_id=" & oct2char(unichar2oct(PX_NOT_EXISTENT_CELL_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 404
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_016_NF
/**
* @desc Check that the RNIS service returns an error when the PLMN information is requested with a malformatted message.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_017_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/plmn_info?app_id=" & oct2char(unichar2oct(PX_APP_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 400
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_017_BR
/**
* @desc Check that the RNIS service returns an error when the PLMN information for a not existing element is requested.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_017_NF() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/plmn_info?app_ins_id=" & oct2char(unichar2oct(PX_NOT_EXISTENT_APP_INS_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 404
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_017_NF
/**
* @desc Check that the RNIS service returns an error when the S1 bearer information is requested with a malformatted message.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_018_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/s1_bearer_info?c_id=" & oct2char(unichar2oct(PX_C_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 400
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_018_BR
/**
* @desc Check that the RNIS service returns an error when the S1 bearer information for a not existing element is requested.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_018_NF() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/s1_bearer_info?cell_id=" & oct2char(unichar2oct(PX_NOT_EXISTENT_CELL_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found(
mw_http_message_body_json(
mw_body_json_rni_problem_details(
mw_problem_details(
-, -, 404
)))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***");
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_SRV_RNIS_018_NF
/**
* @desc Check that the RNIS service returns an error when the L2 measurements information is requested with a malformatted message.
* @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2
*/
testcase TC_MEC_SRV_RNIS_019_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_RNIS) or not(PICS_RNIS_QUERY)) {
log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_QUERY 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(
"/" & PICS_ROOT_API & PX_RNIS_QUERIES_URI & "/layer2_meas?c_id=" & oct2char(unichar2oct(PX_C_ID, "UTF-8")),
v_headers
)