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
0af7848d
Commit
0af7848d
authored
May 08, 2019
by
Yann Garcia
Browse files
Add UEidentityAPI support
parent
3c059675
Changes
5
Hide whitespace changes
Inline
Side-by-side
etc/TestCodec/TestCodec.cfg
View file @
0af7848d
...
...
@@ -53,6 +53,8 @@ LogEventTypes:= Yes
[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
TestCodec_External.tc_encode_LocationInfo
TestCodec_External.tc_encode_UserInfo
TestCodec_External.tc_encode_UeIdentityTags
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
...
...
scripts/testcodec_generate_makefile.bash
View file @
0af7848d
...
...
@@ -51,7 +51,7 @@ find .. -type f -name "*~" -exec rm {} \;
find ..
-type
f
-name
"*.bak"
-exec
rm
{}
\;
find ..
-type
f
-name
"*.log"
-exec
rm
{}
\;
REFERENCES
=
"LibCommon LibHttp LibMec LibMec/LocationAPI"
REFERENCES
=
"LibCommon LibHttp LibMec LibMec/LocationAPI
LibMec/UEidentityAPI
"
for
i
in
${
REFERENCES
}
do
# TTCN code
...
...
ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn
View file @
0af7848d
...
...
@@ -86,25 +86,25 @@ module LocationAPI_TypesAndValues {
* @desc The connection type for the access point.
*/
type
enumerated
ConnectionType
{
e_f
emto
,
e_lte
_femto
,
e_s
mallcell
,
e_lte
_smallcell
,
e_w
ifi
,
e_p
ico
,
e_m
icro
,
e_m
acro
,
e_w
imax
,
e_u
nknown
F
emto
,
LTE
_femto
,
S
mallcell
,
LTE
_smallcell
,
W
ifi
,
P
ico
,
M
icro
,
M
acro
,
W
imax
,
U
nknown
}
/**
* @desc The operation status of the access point
*/
type
enumerated
OperationStatus
{
e_s
erviceable
,
e_u
nserviceable
,
e_u
nknown
S
erviceable
,
U
nserviceable
,
U
nknown
}
/**
...
...
ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn
View file @
0af7848d
...
...
@@ -38,8 +38,8 @@ module UEidentityAPI_TypesAndValues {
* @desc Status of the resource ueIdentityTagInfo
*/
type
enumerated
State
{
e_unregistered
,
e_registered
UNREGISTERED
,
REGISTERED
}
/**
...
...
ttcn/TestCodec/TestCodec_External.ttcn
View file @
0af7848d
...
...
@@ -3,6 +3,8 @@ module TestCodec_External {
// LibMec
import
from
LocationAPI_TypesAndValues
all
;
import
from
LocationAPI_Templates
all
;
import
from
UEidentityAPI_TypesAndValues
all
;
import
from
UEidentityAPI_Templates
all
;
// TestCodec
import
from
TestCodec_TestAndSystem
all
;
...
...
@@ -37,4 +39,77 @@ module TestCodec_External {
}
}
// End of testcase tc_encode_LocationInfo
testcase
tc_encode_UserInfo
()
runs
on
TCType
system
TCType
{
var
UserInfo
v_location_info
:=
valueof
(
m_user_info
(
"acr:10.0.0.1"
,
"001010000000000000000000000000001"
,
"zone01"
,
"http://example.com/exampleAPI/location/v2/users?address=acr%3A10.0.0.1"
,
TimeStamp
:
{
1483231138
,
0
}));
var
UserInfo
v_location_info_result
;
var
universal
charstring
v_result
;
var
universal
charstring
v_expected_result
:=
"{
\"
address
\"
:
\"
acr:10.0.0.1
\"
,
\"
accessPointId
\"
:
\"
001010000000000000000000000000001
\"
,
\"
zoneId
\"
:
\"
zone01
\"
,
\"
resourceURL
\"
:
\"
http://example.com/exampleAPI/location/v2/users?address=acr%3A10.0.0.1
\"
,
\"
timeStamp
\"
:{
\"
seconds
\"
:1483231138,
\"
nanoSeconds
\"
:0}}"
;
var
bitstring
v_enc_msg
;
var
integer
v_res
;
v_enc_msg
:=
encvalue
(
v_location_info
);
v_result
:=
oct2unichar
(
bit2oct
(
v_enc_msg
),
"UTF-8"
);
log
(
"v_result= "
,
v_result
);
if
(
match
(
v_expected_result
,
v_result
))
{
setverdict
(
pass
,
"Encoding succeed"
);
}
else
{
setverdict
(
fail
,
"Encoding failed"
);
}
v_res
:=
decvalue
(
v_enc_msg
,
v_location_info_result
);
if
(
v_res
==
0
)
{
log
(
"v_location_info_result= "
,
v_location_info_result
);
if
(
match
(
v_location_info
,
v_location_info_result
))
{
setverdict
(
pass
,
"Decoding succeed"
);
}
else
{
setverdict
(
fail
,
"Decoding failed"
);
}
}
else
{
setverdict
(
fail
,
"Decoding operation failed"
);
}
}
// End of testcase tc_encode_UserInfo
testcase
tc_encode_UeIdentityTags
()
runs
on
TCType
system
TCType
{
var
UeIdentityTagInfo
v_ue_identity_tags_info
:=
valueof
(
m_ue_identity_tag_info
({
m_ue_identity_tag_item
(
"UeTagA"
,
REGISTERED
)
}
));
var
UeIdentityTagInfo
v_ue_identity_tags_info_result
;
var
universal
charstring
v_result
;
var
universal
charstring
v_expected_result
:=
"{
\"
ueIdentityTags
\"
:[{
\"
ueIdentityTag
\"
:
\"
UeTagA
\"
,
\"
state
\"
:
\"
REGISTERED
\"
}]}"
;
var
bitstring
v_enc_msg
;
var
integer
v_res
;
v_enc_msg
:=
encvalue
(
v_ue_identity_tags_info
);
v_result
:=
oct2unichar
(
bit2oct
(
v_enc_msg
),
"UTF-8"
);
log
(
"v_result= "
,
v_result
);
if
(
match
(
v_expected_result
,
v_result
))
{
setverdict
(
pass
,
"Encoding succeed"
);
}
else
{
setverdict
(
fail
,
"Encoding failed"
);
}
v_res
:=
decvalue
(
v_enc_msg
,
v_ue_identity_tags_info_result
);
if
(
v_res
==
0
)
{
log
(
"v_ue_identity_tags_info_result= "
,
v_ue_identity_tags_info_result
);
if
(
match
(
v_ue_identity_tags_info
,
v_ue_identity_tags_info_result
))
{
setverdict
(
pass
,
"Decoding succeed"
);
}
else
{
setverdict
(
fail
,
"Decoding failed"
);
}
}
else
{
setverdict
(
fail
,
"Decoding operation failed"
);
}
v_enc_msg
:=
oct2bit
(
char2oct
(
"{
\"
ueIdentityTags
\"
: [{
\"
ueIdentityTag
\"
:
\"
UeTagA
\"
,
\t\"
state
\"
:
\"
REGISTERED
\"
}]}"
));
v_res
:=
decvalue
(
v_enc_msg
,
v_ue_identity_tags_info_result
);
if
(
v_res
==
0
)
{
log
(
"v_ue_identity_tags_info_result (1)= "
,
v_ue_identity_tags_info_result
);
if
(
match
(
v_ue_identity_tags_info
,
v_ue_identity_tags_info_result
))
{
setverdict
(
pass
,
"Decoding succeed (1)"
);
}
else
{
setverdict
(
fail
,
"Decoding failed (1)"
);
}
}
else
{
setverdict
(
fail
,
"Decoding operation failed (1)"
);
}
}
// End of testcase tc_encode_UeIdentityTags
}
// End of module TestCodec_External
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment