Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ATS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TST
ATS
Commits
1c9895c1
Commit
1c9895c1
authored
7 years ago
by
Pramod Kulkarni
Committed by
Miguel Angel Reina Ortega
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
First draft of TTCN code for TP/oneM2M/CSE/ANNC/001
parent
4a9f4142
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LibOneM2M/OneM2M_Functions.ttcn
+4
-0
4 additions, 0 deletions
LibOneM2M/OneM2M_Functions.ttcn
OneM2M_PermutationFunctions.ttcn
+79
-0
79 additions, 0 deletions
OneM2M_PermutationFunctions.ttcn
OneM2M_Testcases_CSE_Release_2.ttcn
+23
-0
23 additions, 0 deletions
OneM2M_Testcases_CSE_Release_2.ttcn
with
106 additions
and
0 deletions
LibOneM2M/OneM2M_Functions.ttcn
+
4
−
0
View file @
1c9895c1
...
...
@@ -1736,11 +1736,15 @@ module OneM2M_Functions {
*/
function
f_cse_receiveCreateRequest
(
in
template
RequestPrimitive
p_requestPrimitive
:=
?
)
runs
on
CseSimu
{
var
ResponsePrimitive
v_responsePrimitive
;
tc_ac
.
start
;
alt
{
[]
mccPortIn
.
receive
(
mw_request
(
p_requestPrimitive
))
->
value
vc_request
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
":INFO: CREATE Request received successfuly"
);
v_responsePrimitive
:=
f_getCreateResponsePrimitive
(
vc_request
.
primitive
.
requestPrimitive
.
resourceType
,
vc_request
.
primitive
.
requestPrimitive
);
v_responsePrimitive
.
responseStatusCode
:=
int2001
;
mccPortIn
.
send
(
m_response
(
v_responsePrimitive
));
}
[]
mccPortIn
.
receive
(
mw_request
(
?
))
{
tc_ac
.
stop
;
...
...
This diff is collapsed.
Click to expand it.
OneM2M_PermutationFunctions.ttcn
+
79
−
0
View file @
1c9895c1
...
...
@@ -6176,6 +6176,85 @@ module OneM2M_PermutationFunctions {
}
//end group AccessControlPolicy
}
//end group Security
group
Annoucement
{
group
Basic
{
function
f_CSE_ANNC_001
(
ResourceType
p_resourceType
,
template
RequestPrimitive
p_requestCreatePrimitive
,
template
(
present
)
RequestPrimitive
p_requestAnnc
,
template
(
omit
)
RequestPrimitive
p_requestUpdatePrimitive
:=
omit
)
runs
on
AeSimu
{
// Local variables
var
MsgIn
vc_response
;
var
RequestPrimitive
v_request
;
var
integer
v_parentIndex
:=
-
1
;
var
integer
v_containerIndex
:=
-
1
;
var
ResponsePrimitive
v_responsePrimitive
;
// Test control
// Test component configuration
f_cf02Up
();
// Test adapter configuration
//Register the CSE
vc_cse1
.
start
(
f_cse_registerRemoteCse
(
m_createRemoteCSEBase
));
vc_cse1
.
done
;
//Preamble
v_parentIndex
:=
f_cse_preamble_registerAe
();
//c_CRUDNDi);
vc_cse1
.
start
(
f_cse_resourceAnnouncementHandler
());
v_resourceIndex
:=
f_cse_createResource
(
p_resourceType
,
m_createAEAnnc
(
PX_APP_ID
,
omit
,
omit
));
vc_cse1
.
done
;
// Test Body
if
(
ispresent
(
p_requestUpdatePrimitive
))
{
v_request
:=
f_getUpdateRequestPrimitive
(
p_resourceType
,
v_resourceIndex
,
p_requestUpdatePrimitive
);
v_responsePrimitive
.
responseStatusCode
:=
int2004
;
}
else
{
v_request
:=
f_getCreateRequestPrimitive
(
p_resourceType
,
p_requestCreatePrimitive
,
v_parentIndex
);
v_responsePrimitive
.
responseStatusCode
:=
int2001
;
}
mcaPort
.
send
(
m_request
(
v_request
));
vc_cse1
.
start
(
f_cse_receiveCreateRequest
(
p_requestAnnc
));
vc_cse1
.
done
;
tc_ac
.
start
;
alt
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
v_responsePrimitive
.
responseStatusCode
)))
->
value
vc_response
{
tc_ac
.
stop
;
if
(
v_responsePrimitive
.
responseStatusCode
==
int2004
){
setverdict
(
pass
,
__SCOPE__
,
": Attribute of resource type "
&
int2str
(
enum2int
(
p_resourceType
))
&
" updated successfully"
);
}
else
if
(
v_responsePrimitive
.
responseStatusCode
==
int2001
)
{
setverdict
(
pass
,
__SCOPE__
,
": Attribute of resource type "
&
int2str
(
enum2int
(
p_resourceType
))
&
" created successfully"
);
}
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
,
": Wrong response status code"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveKO
))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
,
": Error while updating optional attribute"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
fail
,
__SCOPE__
,
": No answer while updating resource type "
&
int2str
(
enum2int
(
p_resourceType
)));
}
}
// Postamble
f_cse_postamble_deleteResources
();
// Tear down
f_cf02Down
();
}
//end f_CSE_ANNC_001
}
//end group Basic
}
// end group Announcement
}
//end group CSE
...
...
This diff is collapsed.
Click to expand it.
OneM2M_Testcases_CSE_Release_2.ttcn
+
23
−
0
View file @
1c9895c1
...
...
@@ -7242,6 +7242,29 @@ module OneM2M_Testcases_CSE_Release_2 {
}
//end group AccessControlPolicy
}
//end group Security
group
Announcement
{
group
Basic
{
group
g_CSE_ANNC_001
{
testcase
TC_CSE_ANNC_001_ACP_UPD
()
runs
on
Tester
system
CseSystem
{
// Local variables
var
AeSimu
v_ae1
:=
AeSimu
.
create
(
"AE1"
)
alive
;
var
template
RequestPrimitive
v_createRequest
:=
m_createAcpBase
;
var
template
RequestPrimitive
v_updateRequest
:=
m_updateAcpBase
;
v_createRequest
.
primitiveContent
.
accessControlPolicy
.
announceTo
:=
{
f_getAnnouncementTargetPoA
()};
v_ae1
.
start
(
f_CSE_ANNC_001
(
int1
,
v_createRequest
,
mw_createAccessControlPolicyAnnc
,
v_updateRequest
));
//AccessControlPolicy
v_ae1
.
done
;
}
}
// end group g_CSE_ANNC_001
}
}
}
//end group CSE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment