Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MEC - Multi-access Edge Computing
MEC TTCN-3 Test Suite
Commits
3f195118
Commit
3f195118
authored
Oct 01, 2019
by
Elian Kraja
Browse files
Added new Clauses 8.4 and 8.5 on MEC 021
parent
ad85e669
Changes
6
Hide whitespace changes
Inline
Side-by-side
ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn
View file @
3f195118
...
...
@@ -299,6 +299,528 @@
}
// End of testcase TP_MEC_SRV_AMS_002_BR
}
// End of group appMobilityServices
group
individualAppMobilityService
{
/**
* @desc Check that the AMS service returns information about this individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.1
*/
testcase
TP_MEC_SRV_AMS_011_OK
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_get
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
oct2char
(
unichar2oct
(
PX_APP_MOBILITY_SERVICE_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_app_mobility_service_info
(
mw_app_mobility_service_info
(
-
,
PX_APP_MOBILITY_SERVICE_ID
))))))
->
value
v_response
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a AppMobilityServiceInfo***"
);
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
}
// End of testcase TP_MEC_SRV_AMS_011_OK
/**
* @desc Check that the AMS service sends an error when receives a query about a not existing individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.1
*/
testcase
TP_MEC_SRV_AMS_011_NF
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_get
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_NON_EXISTENT_APP_MOBILITY_SERVICE_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
(
)))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a 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
}
// End of testcase TP_MEC_SRV_AMS_011_NF
/**
* @desc Check that the AMS service modifies the individual application mobility service when requested
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2
*/
testcase
TP_MEC_SRV_AMS_012_OK
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_put
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
oct2char
(
unichar2oct
(
PX_APP_MOBILITY_SERVICE_ID
,
"UTF-8"
)),
v_headers
,
m_http_message_body_json
(
m_body_json_ams_registration_request
(
m_registration_request
(
m_service_consumer_id
(
PX_APP_INS_ID
,
-
),
-
,
-
)
)
)
)));
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_app_mobility_service_info
(
mw_app_mobility_service_info
({
*
,
mw_app_mobility_registration_info
(
mw_service_consumer_id
(
PX_APP_INS_ID
,
-
),
-
,
-
),
*
},
-
)
)
)
)))
->
value
v_response
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a AppMobilityServiceInfo***"
);
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
}
// End of testcase TP_MEC_SRV_AMS_012_OK
/**
* @desc Check that the AMS service sends an error when receives a request to modify a not existing individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2
*/
testcase
TP_MEC_SRV_AMS_012_NF
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_put
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID
,
"UTF-8"
)),
v_headers
,
m_http_message_body_json
(
m_body_json_ams_registration_request
(
m_registration_request
(
m_service_consumer_id
(
PX_APP_INS_ID
,
-
),
-
,
-
)
)
)
)));
f_selfOrClientSyncAndVerdict
(
c_prDone
,
e_success
);
// Test Body
tc_ac
.
start
;
alt
{
[]
httpPort
.
receive
(
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
);
}
[]
tc_ac
.
timeout
{
log
(
"*** "
&
testcasename
()
&
": INCONC: Expected message not received ***"
);
f_selfOrClientSyncAndVerdict
(
c_tbDone
,
e_timeout
);
}
}
// End of 'alt' statement
}
// End of testcase TP_MEC_SRV_AMS_012_NF
/**
* @desc Check that the AMS service sends an error when receives a request to modify a individual application mobility service using bad parameters
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2
*/
testcase
TP_MEC_SRV_AMS_012_BR
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_put
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_APP_MOBILITY_SERVICE_ID
,
"UTF-8"
)),
v_headers
,
m_http_message_body_json
(
m_body_json_ams_registration_request_with_error
(
m_registration_request_with_error
(
m_service_consumer_id_with_error
(
PX_APP_INS_ID
,
-
),
-
,
-
)
)
)
)));
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
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a 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
}
// End of testcase TP_MEC_SRV_AMS_012_BR
/**
* @desc Check that the AMS service de-register the individual application mobility service and delete the resource
* that represents the individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.5
*/
testcase
TP_MEC_SRV_AMS_013_OK
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_delete
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
oct2char
(
unichar2oct
(
PX_APP_MOBILITY_SERVICE_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_204_no_content
(
)))
->
value
v_response
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a 204 No Content ***"
);
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
}
// End of testcase TP_MEC_SRV_AMS_013_OK
/**
* @desc Check that the AMS service sends an error when is requested to delete the resource
* that represents the individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.4.3.5
*/
testcase
TP_MEC_SRV_AMS_013_NF
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_delete
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
"/"
&
oct2char
(
unichar2oct
(
PX_NON_EXISTENT_APP_MOBILITY_SERVICE_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
(
)))
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a 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
}
// End of testcase TP_MEC_SRV_AMS_013_NF
}
group
appMobilityServiceDeregisterTask
{
/**
* @desc Check that the AMS service deregister an individual application mobility service on expiry of the timer associated with the service
* @see ETSI GS MEC 021 2.0.10, clause 8.5.3.4
*/
testcase
TP_MEC_SRV_AMS_014_OK
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_post
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
oct2char
(
unichar2oct
(
PX_APP_MOBILITY_SERVICE_ID
,
"UTF-8"
))
&
"/deregisterTask"
,
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_app_mobility_service_info
(
mw_app_mobility_service_info
({
*
,
mw_app_mobility_registration_info
(
mw_service_consumer_id
(
PX_APP_INS_ID
,
-
),
-
,
-
),
*
},
-
)
)
)
)))
->
value
v_response
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a AppMobilityServiceInfo***"
);
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
}
// End of testcase TP_MEC_SRV_AMS_014_OK
/**
* @desc Check that the AMS service send an error when is requested to deregister a not existent individual application mobility service
* @see ETSI GS MEC 021 2.0.10, clause 8.5.3.4
*/
testcase
TP_MEC_SRV_AMS_014_NF
()
runs
on
HttpComponent
system
HttpTestAdapter
{
// Local variables
var
HeaderLines
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_AMS
)
or
not
(
PICS_AMS_API_SUPPORTED
)){
log
(
"*** "
&
testcasename
()
&
": PICS_AMS required for executing the TC ***"
);
setverdict
(
inconc
);
stop
;
}
// Test component configuration
f_cf_01_http_up
();
// Preamble
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_post
(
"/"
&
PICS_ROOT_API
&
PX_ME_APP_AMS_URI
&
oct2char
(
unichar2oct
(
PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID
,
"UTF-8"
))
&
"/deregisterTask"
,
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
(
)))
->
value
v_response
{
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully responds with a 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
}
// End of testcase TP_MEC_SRV_AMS_012_OK
}
group
appMobilityServicesSubscriptions
{
...
...
ttcn/LibMec/Ams/ttcn/Ams_Pixits.ttcn
View file @
3f195118
...
...
@@ -16,6 +16,8 @@ module Ams_Pixits {
modulepar
JSON
.
String
PX_NON_EXISTENT_SUBSCRIPTION_ID
:=
"NON_EXISTENT_SUBSCRIPTION_ID"
modulepar
JSON
.
String
PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID
:=
"PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID"
modulepar
JSON
.
String
PX_CALLBACK_REFERENCE
:=
"http://127.0.0.1/callback"
modulepar
charstring
PX_CALLBACK_URI
:=
"http://127.0.0.1/callback"
...
...
ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn
View file @
3f195118
...
...
@@ -55,6 +55,14 @@ module Ams_Templates {
mepId
:=
p_mepId
}
template
(
omit
)
ServiceConsumerIdWithError
m_service_consumer_id_with_error
(
in
template
(
omit
)
String
p_appId
:=
omit
,
in
template
(
omit
)
String
p_mepId
:=
omit
)
:=
{
appId
:=
p_appId
,
mepId
:=
p_mepId
}
template
(
omit
)
ServiceConsumer
m_service_consumer_error
(
in
template
(
omit
)
String
p_appInstance
:=
omit
,
in
template
(
omit
)
String
p_mepId
:=
omit
...
...
@@ -82,6 +90,17 @@ module Ams_Templates {
}
template
(
omit
)
RegistrationRequestWithError
m_registration_request_with_error
(
in
template
(
omit
)
ServiceConsumerIdWithError
p_service_consumer_id_with_error
:=
omit
,
in
template
(
omit
)
DeviceInformations
p_device_info
:=
omit
,
in
template
(
omit
)
UInt32
p_expire_time
:=
omit
)
:=
{
serviceConsumerIdWithError
:=
p_service_consumer_id_with_error
,
deviceInformation
:=
p_device_info
,
expiryTime
:=
p_expire_time
}
template
(
omit
)
RegistrationRequest
m_registration_request_error
(
in
template
(
omit
)
ServiceConsumer
p_service_consumer
:=
omit
,
in
template
(
omit
)
DeviceInformations
p_device_info
:=
omit
,
...
...
ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn
View file @
3f195118
...
...
@@ -28,12 +28,24 @@ type record RegistrationRequest {
}
type
record
RegistrationRequestWithError
{
ServiceConsumerIdWithError
serviceConsumerIdWithError
,
DeviceInformations
deviceInformation
optional
,
UInt32
expiryTime
optional
}
type
record
of
ServiceConsumerId
ServiceConsumerIds
;
type
record
ServiceConsumerId
{
String
appInstanceId
optional
,
String
mepId
optional
}
type
record
ServiceConsumerIdWithError
{
String
appId
optional
,
String
mepId
optional
}
// Erroneous parameter: appInstance should be appInstanceId
type
record
of
ServiceConsumer
ServiceConsumers
;
type
record
ServiceConsumer
{
...
...
ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn
View file @
3f195118
...
...
@@ -109,7 +109,7 @@ module LibItsHttp_JsonMessageBodyTypes {
AppLCM_TypesAndValues
.
Notification
lcmNotification
,
AppContext
appContext
,
AppInfo
appInfo
,
Ams_TypesAndValues
.
RegistrationRequestWithError
registrationRequestWithError_ams
,
UEAppInterfaceAPI_TypesAndValues
.
ProblemDetails
problemDetails_ue_app_ctxt
,
universal
charstring
raw
}
with
{
...
...
ttcn/pat