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
6aad2ffd
Commit
6aad2ffd
authored
Jun 21, 2021
by
YannGarcia
Browse files
Finalyze TPs implementation for MEC016
parent
93968200
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
ccsrc/Protocols/Json/json_codec.cc
View file @
6aad2ffd
...
...
@@ -441,21 +441,41 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
predicted_qos
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
PredictedQos_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
predictedQos
()
=
predicted_qos
;
}
else
if
(
(
it
->
second
.
find
(
"
\"
p
rovChgUuUniSubscription
\"
"
)
!=
std
::
string
::
npos
)
||
(
it
->
second
.
find
(
"
\"
v2xApplicationServer
\"
"
)
!=
std
::
string
::
npos
))
{
}
else
if
(
it
->
second
.
find
(
"
\"
P
rovChgUuUniSubscription
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuUniSubscription
prov_chg_uu_uni_subscription
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_uu_uni_subscription
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuUniSubscription_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgUuUniSubscription
()
=
prov_chg_uu_uni_subscription
;
}
else
if
(
(
it
->
second
.
find
(
"
\"
p
rovChgUuMbmsSubscription
\"
"
)
!=
std
::
string
::
npos
)
||
(
it
->
second
.
find
(
"
\"
v2xApplicationServer
\"
"
)
!=
std
::
string
::
npos
))
{
}
else
if
(
it
->
second
.
find
(
"
\"
P
rovChgUuMbmsSubscription
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuMbmsSubscription
prov_chg_uu_mbms_subscription
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_uu_mbms_subscription
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuMbmsSubscription_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgUuMbmsSubscription
()
=
prov_chg_uu_mbms_subscription
;
}
else
if
(
(
it
->
second
.
find
(
"
\"
p
rovChgPc5Subscription
\"
"
)
!=
std
::
string
::
npos
)
||
(
it
->
second
.
find
(
"
\"
v2xApplicationServer
\"
"
)
!=
std
::
string
::
npos
))
{
}
else
if
(
it
->
second
.
find
(
"
\"
P
rovChgPc5Subscription
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgPc5Subscription
prov_chg_pc5_subscription
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_pc5_subscription
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgPc5Subscription_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgPc5Subscription
()
=
prov_chg_pc5_subscription
;
}
else
if
(
it
->
second
.
find
(
"
\"
ProvChgUuUniNotification
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuUniNotification
prov_chg_uu_uni_notification
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_uu_uni_notification
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuUniNotification_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgUuUniNotification
()
=
prov_chg_uu_uni_notification
;
}
else
if
(
it
->
second
.
find
(
"
\"
ProvChgUuMbmsNotification
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuMbmsNotification
prov_chg_uu_mbms_notification
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_uu_mbms_notification
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgUuMbmsNotification_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgUuMbmsNotification
()
=
prov_chg_uu_mbms_notification
;
}
else
if
(
it
->
second
.
find
(
"
\"
provChgPc5Notification
\"
"
)
!=
std
::
string
::
npos
)
{
V2XInformationServiceAPI__TypesAndValues
::
ProvChgPc5Notification
prov_chg_pc5_notification
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
prov_chg_pc5_notification
.
decode
(
V2XInformationServiceAPI__TypesAndValues
::
ProvChgPc5Notification_descr_
,
decoding_buffer_
,
TTCN_EncDec
::
CT_JSON
);
msg
.
provChgPc5Notification
()
=
prov_chg_pc5_notification
;
}
else
if
(
it
->
second
.
find
(
"
\"
AssocStaSubscription
\"
"
)
!=
std
::
string
::
npos
)
{
WlanInformationAPI__TypesAndValues
::
AssocStaSubscription
assoc_sta_subscription
;
TTCN_Buffer
decoding_buffer_
(
OCTETSTRING
(
str
.
length
(),
(
const
unsigned
char
*
)
str
.
c_str
()));
...
...
ccsrc/Protocols/Tcp/tcp_layer.cc
View file @
6aad2ffd
...
...
@@ -21,10 +21,16 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
}
else
if
(
it
->
second
.
compare
(
"1"
)
==
0
)
{
set_socket_debugging
(
true
);
}
it
=
_params
.
find
(
std
::
string
(
"tcp_fragmented"
));
if
(
it
==
_params
.
cend
())
{
_params
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
std
::
string
(
"tcp_fragmented"
),
"0"
));
}
bool
server_mode
=
false
;
it
=
_params
.
find
(
params
::
server_mode
);
if
(
it
!=
_params
.
cend
())
{
server_mode
=
(
1
==
std
::
stoi
(
it
->
second
));
}
else
{
_params
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
std
::
string
(
"server_mode"
),
"0"
));
}
it
=
_params
.
find
(
params
::
server
);
if
(
it
==
_params
.
cend
())
{
...
...
@@ -64,7 +70,7 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
if
(
!
parameter_set
(
local_port_name
(),
_params
[
params
::
local_port
].
c_str
()))
{
loggers
::
get_instance
().
warning
(
"tcp_layer::set_parameter: Unprocessed parameter: %s"
,
params
::
local_port
.
c_str
());
}
parameter_set
(
use_connection_ASPs_name
(),
(
!
server_mode
)
?
"yes"
:
"no"
);
parameter_set
(
server_backlog_name
(),
"1024"
);
loggers
::
get_instance
().
log
(
"tcp_layer::tcp_layer: server_mode=%x"
,
server_mode
);
...
...
@@ -72,10 +78,10 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
if
(
server_mode
)
{
parameter_set
(
"serverPort"
,
_params
[
params
::
local_port
].
c_str
());
if
(
ssl_mode
)
{
// Add certificate bundle
parameter_set
(
ssl_verifycertificate_name
(),
"
yes
"
);
parameter_set
(
ssl_private_key_file_name
(),
"
/etc/ssl/certs/ca-certificates.crt
"
);
parameter_set
(
ssl_certificate_file_name
(),
"
/etc/ssl/certs/ca-certificates
.crt"
);
parameter_set
(
ssl_trustedCAlist_file_name
(),
"
/etc/ssl/certs/ca-certificates
.crt"
);
// FIXME Use a parameter
parameter_set
(
ssl_verifycertificate_name
(),
"
no
"
);
parameter_set
(
ssl_private_key_file_name
(),
"
../certificates/out/privates/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.key.pem
"
);
parameter_set
(
ssl_certificate_file_name
(),
"
../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa
.c
e
rt
.pem
"
);
parameter_set
(
ssl_trustedCAlist_file_name
(),
"
../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa
.c
e
rt
.pem
"
);
// FIXME Use a parameter
}
}
set_ttcn_buffer_usercontrol
(
false
);
...
...
@@ -83,10 +89,11 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
map_user
();
parameter_set
(
client_TCP_reconnect_name
(),
"yes"
);
if
(
!
server_mode
)
{
if
(
!
_reconnect_on_send
)
{
open_client_connection
(
_params
[
params
::
server
].
c_str
(),
_params
[
params
::
port
].
c_str
(),
NULL
,
NULL
);
}
loggers
::
get_instance
().
log
(
"tcp_layer::tcp_layer: Establish connection: %s/%s"
,
_params
[
params
::
server
].
c_str
(),
_params
[
params
::
port
].
c_str
());
open_client_connection
(
_params
[
params
::
server
].
c_str
(),
_params
[
params
::
port
].
c_str
(),
NULL
,
NULL
);
}
}
...
...
@@ -117,7 +124,14 @@ void tcp_layer::send_data(OCTETSTRING& data, params& params) {
loggers
::
get_instance
().
log_msg
(
">>> tcp_layer::send_data: "
,
data
);
loggers
::
get_instance
().
log
(
"tcp_layer::send_data: SSL mode: %x"
,
get_ssl_use_ssl
());
loggers
::
get_instance
().
log
(
"tcp_layer::send_data: server_mode: %s"
,
_params
[
params
::
server_mode
].
c_str
());
loggers
::
get_instance
().
log
(
"tcp_layer::send_data: peer_list_get_nr_of_peers: %d"
,
peer_list_get_nr_of_peers
());
if
((
_params
[
params
::
server_mode
].
compare
(
"0"
)
==
0
)
&&
(
peer_list_get_nr_of_peers
()
==
0
))
{
// Reconnect (e.g. HTTP connection lost
loggers
::
get_instance
().
log
(
"tcp_layer::send_data: Re-establish connection: %s/%s"
,
_params
[
params
::
server
].
c_str
(),
_params
[
params
::
port
].
c_str
());
open_client_connection
(
_params
[
params
::
server
].
c_str
(),
_params
[
params
::
port
].
c_str
(),
NULL
,
NULL
);
}
send_outgoing
(
static_cast
<
const
unsigned
char
*>
(
data
),
data
.
lengthof
(),
_client_id
);
}
...
...
etc/AtsMec/AtsMec_Mockoon.cf_
View file @
6aad2ffd
...
...
@@ -14,7 +14,7 @@ LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibItsHttp_Pics.PICS_USE_TOKEN_HEADER := true
#LibItsHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken"
LibMec_Pics.PICS_ROOT_API := "/sbx
dtd587f
" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API := "/sbx
cyccf53
" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
# LibMec_Pixits
LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v2/queries/zones"
...
...
@@ -75,6 +75,7 @@ LibMec_Pixits.PX_ME_WLAN_URI := "/wai/v2"
#WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "ap/macId" # ApInfo filter
WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "staId/macId" # StatInfo filter
WlanInformationAPI_Pixits.PX_WLAN_FILTER_VALUE := "\"005C06060606\""
WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "https://yanngarcia.ddns.net/wai/v2/notif"
# Mec-030 V2X Information Service API
...
...
@@ -96,7 +97,7 @@ LogEventTypes:= Yes
# In this section you can specify parameters that are passed to Test Ports.
#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=
8081
,use_ssl=
0
)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=
443
,use_ssl=
1
)"
[DEFINE]
# In this section you can create macro definitions,
...
...
@@ -305,7 +306,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_BR
# Check that the IUT responds with the requested list of subscription
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
#
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
# Check that the IUT responds with the requested list of subscription
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
...
...
@@ -331,7 +332,7 @@ AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
# Check that the IUT responds with an error when an not existing subscription cannot be deleted
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_010_NF
# Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated
#
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK
# ETSI GS MEC 030
# Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application
...
...
@@ -421,6 +422,8 @@ AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_NF
# Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated
AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
...
...
ttcn/AtsMec/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn
0 → 100644
View file @
6aad2ffd
This diff is collapsed.
Click to expand it.
ttcn/AtsMec/AtsMec_DeviceApplicationInterface_TestCases.ttcn
deleted
100644 → 0
View file @
93968200
module
AtsMec_DeviceApplicationInterface_TestCases
{
}
// End of module AtsMec_DeviceApplicationInterface_TestCases
ttcn/AtsMec/AtsMec_WlanInformationAPI_TestCases.ttcn
View file @
6aad2ffd
...
...
@@ -11,7 +11,6 @@
*/
module
AtsMec_WlanInformationAPI_TestCases
{
// JSON
import
from
JSON
all
;
...
...
@@ -1255,7 +1254,7 @@ module AtsMec_WlanInformationAPI_TestCases {
var
AssocStaSubscription
v_assoc_sta_subscription
;
var
Headers
v_headers
;
var
HttpMessage
v_response
;
// Test control
if
(
not
(
PICS_MEC_PLAT
)
or
not
(
PICS_WLAN_INFORMATION_API_SUPPORTED
))
{
log
(
"*** "
&
testcasename
()
&
": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"
);
...
...
@@ -1273,7 +1272,7 @@ module AtsMec_WlanInformationAPI_TestCases {
f_selfOrClientSyncAndVerdict
(
c_prDone
,
e_success
);
// Test Body
tc_
ac
.
start
;
tc_
wait
.
start
;
alt
{
[]
httpPort_notif
.
receive
(
mw_http_request
(
...
...
@@ -1287,7 +1286,7 @@ module AtsMec_WlanInformationAPI_TestCases {
-
,
?
))))))
->
value
v_response
{
tc_
ac
.
stop
;
tc_
wait
.
stop
;
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort_notif
.
send
(
...
...
@@ -1298,14 +1297,15 @@ module AtsMec_WlanInformationAPI_TestCases {
log
(
"*** "
&
testcasename
()
&
": PASS: IUT successfully sends notification ***"
);
f_selfOrClientSyncAndVerdict
(
c_tbDone
,
e_success
);
}
[]
tc_
ac
.
timeout
{
[]
tc_
wait
.
timeout
{
log
(
"*** "
&
testcasename
()
&
": INCONC: Expected message not received ***"
);
f_delete_assoc_sta_subscription
(
v_assoc_sta_subscription
);
f_selfOrClientSyncAndVerdict
(
c_tbDone
,
e_timeout
);
}
}
// End of 'alt' statement
// Postamble
f_delete_assoc_sta_subscription
(
v_
response
.
response
.
body
.
json_body
.
assocStaS
ubscription
);
f_delete_assoc_sta_subscription
(
v_
assoc_sta_s
ubscription
);
f_cf_01_http_notif_down
();
}
// End of testcase TC_MEC_MEC028_SRV_WAI_011_OK
...
...
ttcn/AtsMec/module.mk
View file @
6aad2ffd
...
...
@@ -14,7 +14,7 @@ sources := \
AtsMec_UEAppInterfaceAPI_TestCases.ttcn
\
AtsMec_UEidentityAPI_TestCases.ttcn
\
AtsMec_V2XInformationServiceAPI_TestCases.ttcn
\
AtsMec_DeviceApplicationInterface_TestCases.ttcn
\
AtsMec_DeviceApplicationInterface
API
_TestCases.ttcn
\
AtsMec_WlanInformationAPI_TestCases.ttcn
\
# AtsMec_MeoPkgm_TestCases.ttcn \
# AtsMec_MepmPkgm_TestCases.ttcn \
...
...
@@ -37,7 +37,7 @@ modules := ../LibCommon \
../LibMec/UEAppInterfaceAPI
\
../LibMec/UEidentityAPI
\
../LibMec/V2XInformationServiceAPI
\
../LibMec/DeviceApplicationInterface
\
../LibMec/DeviceApplicationInterface
API
\
../LibMec/WlanInformationAPI
\
../../ccsrc/Ports/LibHttp
\
../../ccsrc/EncDec/LibHttp
\
...
...
ttcn/LibMec/DeviceApplicationInterface/module.mk
deleted
100644 → 0
View file @
93968200
sources
:=
\
ttcn/DeviceApplicationInterface_TypesAndValues.ttcn
\
ttcn/DeviceApplicationInterface_Pics.ttcn
\
ttcn/DeviceApplicationInterface_Pixits.ttcn
\
ttcn/DeviceApplicationInterface_Templates.ttcn
\
ttcn/LibMec/DeviceApplicationInterface/ttcn/DeviceApplicationInterface_Pics.ttcn
deleted
100644 → 0
View file @
93968200
module
DeviceApplicationInterface_Pics
{
/**
* @desc Does the IUT support DeviceApplicationInterface?
*/
modulepar
boolean
PICS_DEVICE_APPLICATION_INTERFACE_SUPPORTED
:=
true
;
}
// End of module DeviceApplicationInterface_Pics
ttcn/LibMec/DeviceApplicationInterface/ttcn/DeviceApplicationInterface_Pixits.ttcn
deleted
100644 → 0
View file @
93968200
module
DeviceApplicationInterface_Pixits
{
}
// End of module DeviceApplicationInterface_Pixits
ttcn/LibMec/DeviceApplicationInterface/ttcn/DeviceApplicationInterface_Templates.ttcn
deleted
100644 → 0
View file @
93968200
module
DeviceApplicationInterface_Templates
{
}
// End of module DeviceApplicationInterface_Templates
ttcn/LibMec/DeviceApplicationInterface/json/UEAppInterfaceApi.json
→
ttcn/LibMec/DeviceApplicationInterface
API
/json/UEAppInterfaceApi.json
View file @
6aad2ffd
File moved
ttcn/LibMec/DeviceApplicationInterfaceAPI/module.mk
0 → 100644
View file @
6aad2ffd
sources
:=
\
ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn
\
ttcn/DeviceApplicationInterfaceAPI_Pics.ttcn
\
ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn
\
ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn
\
ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn
\
ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn
0 → 100644
View file @
6aad2ffd
module
DeviceApplicationInterfaceAPI_Functions
{
// JSON
import
from
JSON
all
;
// LibCommon
import
from
LibCommon_BasicTypesAndValues
all
;
import
from
LibCommon_Time
all
;
import
from
LibCommon_VerdictControl
all
;
import
from
LibCommon_Sync
all
;
// LibHttp
import
from
LibItsHttp_TypesAndValues
all
;
import
from
LibItsHttp_Functions
all
;
import
from
LibItsHttp_Templates
all
;
import
from
LibItsHttp_JsonTemplates
all
;
import
from
LibItsHttp_TestSystem
all
;
// LibMec/DeviceApplicationInterfaceAPI
import
from
DeviceApplicationInterfaceAPI_TypesAndValues
all
;
import
from
DeviceApplicationInterfaceAPI_Templates
all
;
import
from
DeviceApplicationInterfaceAPI_Pixits
all
;
// LibMec
import
from
LibMec_Templates
all
;
import
from
LibMec_Functions
all
;
import
from
LibMec_Pics
all
;
import
from
LibMec_Pixits
all
;
function
f_create_application_context
(
out
AppContext
p_device_info_app_context
)
runs
on
HttpComponent
{
var
Headers
v_headers
;
var
HttpMessage
v_response
;
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_post
(
PICS_ROOT_API
&
PX_DEVICE_APP_CTX_URI
,
v_headers
,
m_http_message_body_json
(
m_body_json_device_info_app_context
(
m_device_app_context
(
PX_ASSOCIATE_DEV_APPID
,
m_app_context_info
(
PX_APPD_ID
,
PX_UNKNOWN_APP_NAME
,
PX_APP_PROVIDER
,
PX_APPD_VERSION
),
PX_DEVICE_APP_CALLBACK
)
)
)
)
)
);
tc_ac
.
start
;
alt
{
[]
httpPort
.
receive
(
mw_http_response
(
mw_http_response_201_created
(
mw_http_message_body_json
(
mw_body_json_device_info_app_context
(
mw_device_app_context
(
-
,
PX_ASSOCIATE_DEV_APPID
,
mw_app_context_info
,
PX_DEVICE_APP_CALLBACK
))))))
->
value
v_response
{
tc_ac
.
stop
;
// TODO Check presence of Location HTTP header
p_device_info_app_context
:=
v_response
.
response
.
body
.
json_body
.
appContext_device_info
;
log
(
"f_create_application_context: INFO: IUT successfully responds with an Application Context: "
,
p_device_info_app_context
);
}
[]
tc_ac
.
timeout
{
log
(
"f_create_application_context: INCONC: Expected message not received"
);
}
}
// End of 'alt' statement
}
// End of function f_create_application_context
function
f_delete_application_context
(
in
AppContext
p_device_info_app_context
)
runs
on
HttpComponent
{
var
Headers
v_headers
;
f_init_default_headers_list
(
-
,
-
,
v_headers
);
httpPort
.
send
(
m_http_request
(
m_http_request_delete
(
PICS_ROOT_API
&
PX_DEVICE_APP_CTX_URI
&
"/"
&
p_device_info_app_context
.
contextId
,
v_headers
)
)
);
tc_ac
.
start
;
alt
{
[]
httpPort
.
receive
(
mw_http_response
(
mw_http_response_204_no_content
))
{
tc_ac
.
stop
;
log
(
"f_delete_application_context: INFO: IUT successfully deletes the Application Context: "
,
p_device_info_app_context
.
contextId
);
}
[]
tc_ac
.
timeout
{
log
(
"f_delete_application_context: INCONC: Expected message not received"
);
}
}
// End of 'alt' statement
}
// End of function f_delete_application_context
}
// End of module DeviceApplicationInterfaceAPI_Functions
ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pics.ttcn
0 → 100644
View file @
6aad2ffd
module
DeviceApplicationInterfaceAPI_Pics
{
/**
* @desc Does the IUT support DeviceApplicationInterfaceAPI?
*/
modulepar
boolean
PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED
:=
true
;
}
// End of module DeviceApplicationInterfaceAPI_Pics
ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn
0 → 100644
View file @
6aad2ffd
module
DeviceApplicationInterfaceAPI_Pixits
{
// JSON
import
from
JSON
all
;
modulepar
charstring
PX_DEVICE_APP_LIST_URI
:=
"/dev_app/v1/app_list"
;
modulepar
charstring
PX_DEVICE_APP_CTX_URI
:=
"/dev_app/v1/app_contexts"
;
modulepar
charstring
PX_DEVICE_APP_LOC_URI
:=
"/dev_app/v1/obtain_app_loc_availability"
;
modulepar
charstring
PX_DEVICE_APP_NAME
:=
""
;
modulepar
charstring
PX_DEVICE_UNKNOWN_APP_NAME
:=
""
;
modulepar
charstring
PX_ASSOCIATE_DEV_APPID
:=
""
;
modulepar
charstring
PX_INVALID_ASSOCIATE_DEV_APPID
:=
""
;
modulepar
charstring
PX_DEVICE_APP_CALLBACK
:=
""
;
modulepar
charstring
PX_DEVICE_NEW_APP_CALLBACK
:=
""
;
modulepar
charstring
PX_APPD_ID
:=
""
;
modulepar
charstring
PX_APP_NAME
:=
""
;
modulepar
charstring
PX_UNKNOWN_APP_NAME
:=
""
;
modulepar
charstring
PX_APP_PROVIDER
:=
""
;
modulepar
charstring
PX_APPD_VERSION
:=
""
;
modulepar
charstring
PX_UNKNOWN_APP_CONTEXT_ID
:=
""
;
}
// End of module DeviceApplicationInterfaceAPI_Pixits
ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn
0 → 100644
View file @
6aad2ffd
module
DeviceApplicationInterfaceAPI_Templates
{
// JSON
import
from
JSON
all
;
// LibCommon
import
from
LibCommon_BasicTypesAndValues
all
;
// LibMec/DeviceApplicationInterfaceAPI
import
from
DeviceApplicationInterfaceAPI_TypesAndValues
all
;
import
from
DeviceApplicationInterfaceAPI_Pixits
all
;
template
(
omit
)
AppContext
m_device_app_context
(
in
template
(
value
)
JSON
.
String
p_associateDevAppId
,
in
template
(
value
)
ApplicationContext_AppInfo
p_appInfo
,
in
template
(
omit
)
JSON
.
AnyURI
p_callbackReference
:=
omit
,
in
template
(
omit
)
boolean
p_appLocationUpdates
:=
omit
,
in
template
(
omit
)
boolean
p_appAutoInstantiation
:=
omit
)
:=
{
contextId
:=
omit
,
associateDevAppId
:=
p_associateDevAppId
,
callbackReference
:=
p_callbackReference
,
appLocationUpdates
:=
p_appLocationUpdates
,
appAutoInstantiation
:=
p_appAutoInstantiation
,
appInfo
:=
p_appInfo
}
// End of template m_device_app_context
template
(
present
)
AppContext
mw_device_app_context
(
template
(
present
)
JSON
.
String
p_contextId
:=
?
,
template
(
present
)
JSON
.
String
p_associateDevAppId
:=
?
,
template
(
present
)
ApplicationContext_AppInfo
p_appInfo
:=
?
,
template
JSON
.
AnyURI
p_callbackReference
:=
*
,
template
boolean
p_appLocationUpdates
:=
*
,
template
boolean
p_appAutoInstantiation
:=
*
)
:=
{
contextId
:=
p_contextId
,
associateDevAppId
:=
p_associateDevAppId
,
callbackReference
:=
p_callbackReference
,
appLocationUpdates
:=
p_appLocationUpdates
,
appAutoInstantiation
:=
p_appAutoInstantiation
,
appInfo
:=
p_appInfo
}
// End of template mw_device_app_context
template
(
omit
)
ApplicationContext_AppInfo
m_app_context_info
(
in
JSON
.
String
p_appDId
,
in
JSON
.
String
p_appName
,
in
JSON
.
String
p_appProvider
,
in
JSON
.
String
p_appDVersion
,
in
template
(
omit
)
JSON
.
String
p_appDescription
:=
omit
,
in
template
(
omit
)
JSON
.
String
p_appSoftVersion
:=
omit
,
in
template
(
omit
)
UserAppInstanceInfoList
p_userAppInstanceInfo
:=
omit
,
in
template
(
omit
)
JSON
.
AnyURI
p_appPackageSource
:=
omit
)
:=
{
appDId
:=
p_appDId
,
appName
:=
p_appName
,
appProvider
:=
p_appProvider
,
appSoftVersion
:=
p_appSoftVersion
,
appDVersion
:=
p_appDVersion
,
appDescription
:=
p_appDescription
,
userAppInstanceInfo
:=
p_userAppInstanceInfo
,
appPackageSource
:=
p_appPackageSource
}
// End ot template m_app_context_info
template
(
present
)
ApplicationContext_AppInfo
mw_app_context_info
(
template
(
present
)
JSON
.
String
p_appDId
:=
?
,
template
(
present
)
JSON
.
String
p_appName
:=
?
,
template
(
present
)
JSON
.
String
p_appProvider
:=
?
,
template
(
present
)
JSON
.
String
p_appDVersion
:=
?
,
template
JSON
.
String
p_appDescription
:=
*
,
template
JSON
.
String
p_appSoftVersion
:=
*
,
template
UserAppInstanceInfoList
p_userAppInstanceInfo
:=
*
,
template
JSON
.
AnyURI
p_appPackageSource
:=
*
)
:=
{
appDId
:=
p_appDId
,
appName
:=
p_appName
,
appProvider
:=
p_appProvider
,
appSoftVersion
:=
p_appSoftVersion
,
appDVersion
:=
p_appDVersion
,
appDescription
:=
p_appDescription
,
userAppInstanceInfo
:=
p_userAppInstanceInfo
,
appPackageSource
:=
p_appPackageSource
}
// End ot template mw_app_context_info
template
(
value
)
ApplicationLocationAvailability
m_application_location_availability
(
in
JSON
.
String
p_associateDevAppId
,
in
template
(
value
)
ApplicationLocationAvailability_AppInfo
p_appInfo
)
:=
{
associateDevAppId
:=
p_associateDevAppId
,
appInfo
:=
p_appInfo
}
// End of template m_application_location_availability
template
(
present
)
ApplicationLocationAvailability
mw_application_location_availability
(
template
(
present
)
JSON
.
String
p_associateDevAppId
:=
?
,
template
(
present
)
ApplicationLocationAvailability_AppInfo
p_appInfo
:=
?
)
:=
{
associateDevAppId
:=
p_associateDevAppId
,
appInfo
:=
p_appInfo
}
// End of template mw_application_location_availability
template
(
omit
)
ApplicationLocationAvailability_AppInfo
m_application_location_availability_info
(
in
JSON
.
String
p_appDId
,
in
JSON
.
String
p_appName
,
in
JSON
.
String
p_appProvider
,
in
JSON
.
String
p_appDVersion
,
in
template
(
omit
)
JSON
.
String
p_appSoftVersion
:=
omit
,
in
template
(
omit
)
JSON
.
String
p_appDescription
:=
omit
,
in
template
(
omit
)
AvailableLocationsList
p_availableLocations
:=
omit
,
in
template
(
omit
)
JSON
.
AnyURI
p_appPackageSource
:=
omit
)
:=
{
appDId
:=
p_appDId
,
appName
:=
p_appName
,
appProvider
:=
p_appProvider
,
appSoftVersion
:=
p_appSoftVersion
,
appDVersion
:=
p_appDVersion
,
appDescription
:=
p_appDescription
,
availableLocations
:=
p_availableLocations
,