Commit a75abed6 authored by YannGarcia's avatar YannGarcia
Browse files

Add FixedAccessInformationService test cases

parent d1556ffa
......@@ -1576,7 +1576,7 @@ group app_lcm__notification {
[] httpPort_notif.receive(
mw_http_request(
mw_http_request_post(
unichar2char(PX_CALLBACK_URI),
oct2char(unichar2oct(PX_CALLBACK_URI)),
-,
mw_http_message_body_json(
mw_body_json_lcm_notification(
......
......@@ -23,118 +23,113 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_LocationAPI
import from LocationAPI_TypesAndValues all;
import from LocationAPI_Templates all;
import from LocationAPI_Pics all;
import from LocationAPI_Pixits all;
// LibMec_FixedAccessInformationServiceAPI
import from FixedAccessInformationServiceAPI_Templates all;
import from FixedAccessInformationServiceAPI_Pics all;
import from FixedAccessInformationServiceAPI_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
/*
* Fixed Access Information Service (FAIS)
*/
group fixedAccessInfoService {
group fixedAccessInfoService {
/**
* @desc Check that the IUT responds with the current status of the fixed access information when queried by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_001_OK() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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(
"/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI,
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_fai_fa_info(
mw_fa_info
))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a FaInfo ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// 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_FAI_FA_INFO_URI,
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_fai_fa_info(
mw_fai_fa_info(?)
)))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a FaInfo ***");
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();
[] 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 TP_MEC_SRV_FAIS_001_OK
/**
* @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_001_BR() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_FA_INFO_URI & "?interface=1",
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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(
"/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI & "?interface=1",
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
)) {
tc_ac.stop;
......@@ -146,10 +141,10 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
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 'alt' statement
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_001_BR
/**
......@@ -160,15 +155,15 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Test adapter configuration
// Preamble
......@@ -176,7 +171,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_FA_INFO_URI & "?interface=999",
"/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI & "?interface=999",
v_headers
)
)
......@@ -200,7 +195,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_001_NF
......@@ -209,17 +204,16 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
* @desc Check that the IUT responds with the current status of the device information when queried by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_002_OK() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -230,7 +224,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_DEVICE_INFO_URI,
"/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI,
v_headers
)
)
......@@ -240,16 +234,16 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_fai_device_info(
mw_fai_device_info(?)
)))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo ***");
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_fai_device_info(
mw_device_info
))))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
......@@ -257,26 +251,25 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_002_OK
/**
* @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_002_BR() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -287,7 +280,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_DEVICE_INFO_URI & "?device=__any_value__",
"/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI & "?device=__any_value__",
v_headers
)
)
......@@ -299,8 +292,8 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request()
)) {
mw_http_response_400_bad_request
)) {
tc_ac.stop;
......@@ -312,9 +305,9 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_002_BR
/**
......@@ -323,14 +316,14 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
testcase TP_MEC_SRV_FAIS_002_NF() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -341,7 +334,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_DEVICE_INFO_URI & "?gwId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_GW_ID, "UTF-8")),
"/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI & "?gwId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_GW_ID[0], "UTF-8")),
v_headers
)
)
......@@ -353,7 +346,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found()
mw_http_response_404_not_found
)) {
tc_ac.stop;
......@@ -374,17 +367,16 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
* @desc CCheck that the IUT responds with the current status of the cable line information when queried by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_003_OK() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -395,9 +387,9 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_CABLE_LINE_INFO_URI
v_headers,
)
"/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI,
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
......@@ -410,8 +402,8 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_fai_cable_line_info(
mw_fai_cable_line_info(?)
)))) {
mw_cable_line_info
))))) {
tc_ac.stop;
......@@ -423,26 +415,25 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_003_OK
/**
* @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
*/
testcase TP_MEC_SRV_FAIS_003_BR() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -453,7 +444,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_CABLE_LINE_INFO_URI & "?cm=__any_value__",
"/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI & "?cm=__any_value__",
v_headers
)
)
......@@ -465,8 +456,8 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request()
)) {
mw_http_response_400_bad_request
)) {
tc_ac.stop;
......@@ -478,26 +469,25 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_down();
// Postamble
f_cf_01_http_down();
} // End of testcase TP_MEC_SRV_FAIS_003_BR
/**
* @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
*/
testcase TP_MEC_SRV_FAIS_003_NF() 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_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
......@@ -508,7 +498,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PX_FAI_CABLE_LINE_INFO_URI & "?cmId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_CM_ID, "UTF-8")),
"/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI & "?cmId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_CM_ID, "UTF-8")),
v_headers
)
)
......@@ -520,7 +510,7 @@ module AtsMec_FixedAccessInformationAPI_TestCases {
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found()
mw_http_response_404_not_found
)) {
tc_ac.stop;
......@@ -532,26 +522,25 @@ module AtsMec_FixedAccessInformationAPI_TestCases {