Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
TST
ATS
Commits
32e6b74f
Commit
32e6b74f
authored
Feb 09, 2018
by
Miguel Angel Reina Ortega
Browse files
Removing duplicated functions
Signed-off-by:
reinaortega
<
miguelangel.reinaortega@etsi.org
>
parent
5553743a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
52 deletions
+9
-52
LibOneM2M/OneM2M_Functions.ttcn
LibOneM2M/OneM2M_Functions.ttcn
+8
-51
OneM2M_PermutationFunctions.ttcn
OneM2M_PermutationFunctions.ttcn
+1
-1
No files found.
LibOneM2M/OneM2M_Functions.ttcn
View file @
32e6b74f
...
...
@@ -1072,36 +1072,7 @@ module OneM2M_Functions {
}
return
false
;
}
/**
* @desc Check that a resource is present in the IUT (resourceId is known) by using RETRIEVE operation
* @param p_resourceIndex Resource index of the resource to be checked
* @return boolean
*/
function
f_isResourcePresentCseSimu
(
integer
p_resourceIndex
)
runs
on
CseSimu
return
boolean
{
//Check to see if the resource is present or not
mccPort
.
send
(
m_request
(
m_retrieve
(
f_getResourceAddress
(
p_resourceIndex
),
f_getOriginator
(
p_resourceIndex
))));
tc_ac
.
start
;
alt
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
)))
{
tc_ac
.
stop
;
setverdict
(
pass
,
testcasename
()
&
": Resource present: "
&
f_getResourceAddress
(
p_resourceIndex
));
return
true
;
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
?
,
-
)))
{
tc_ac
.
stop
;
setverdict
(
inconc
,
testcasename
()
&
": Wrong response status code in the response"
);
return
false
;
}
[]
tc_ac
.
timeout
{
setverdict
(
inconc
,
testcasename
()
&
": No answer while retrieving resource"
);
return
false
;
}
}
return
false
;
}
/**
* @desc Check that a resource is not present in the IUT (resourceId is NOT known)
* @param p_parentIndex Index of the parent resource of the resource to be checked
...
...
@@ -1768,6 +1739,11 @@ module OneM2M_Functions {
setverdict
(
pass
,
testcasename
()
&
": Resource not present"
);
return
true
;
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
)))
{
tc_ac
.
stop
;
setverdict
(
pass
,
testcasename
()
&
": Resource "
&
p_resourceName
&
" present"
);
return
false
;
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
?
)))
{
tc_ac
.
stop
;
setverdict
(
inconc
,
testcasename
()
&
": Wrong response status code in the response"
);
...
...
@@ -1959,7 +1935,8 @@ module OneM2M_Functions {
v_myResource
.
remoteCSE
.
resourceName
:=
"remoteCSE"
&
int2str
(
v_resourceIndex
);
}
v_myResource
.
remoteCSE
.
resourceType
:=
p_resourceType
;
v_myResource
.
remoteCSE
.
resourceID
:=
f_resourceIdCleaner
(
v_myResource
.
remoteCSE
.
cSE_ID
);
//v_myResource.remoteCSE.resourceID := f_resourceIdCleaner(v_myResource.remoteCSE.cSE_ID);
v_myResource
.
remoteCSE
.
resourceID
:=
"remoteCSE-ID"
&
int2str
(
v_resourceIndex
);
v_myResource
.
remoteCSE
.
parentID
:=
f_getResourceId
(
vc_localResourcesList
[
p_parentIndex
].
resource
);
v_myResource
.
remoteCSE
.
creationTime
:=
fx_generateTimestamp
();
v_myResource
.
remoteCSE
.
creationTime
:=
"20171231T012345"
;
...
...
@@ -2036,27 +2013,7 @@ module OneM2M_Functions {
return
v_myResource
;
}
//End of function
/**
* @desc Sending of a request primitive over mca port
* @param p_resourceType Resource type of the resource to be created
* @param p_requestPrimitive CREATE request primitive for the resource to be created
* @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
* @return Internal resource index of the created resource
* @verdict
*/
function
f_cse_sendCreateRequestPrimitive
(
in
ResourceType
p_resourceType
,
template
RequestPrimitive
p_requestPrimitive
:=
m_create
,
integer
p_parentIndex
:=
-
1
)
runs
on
AeSimu
{
var
RequestPrimitive
v_request
;
var
integer
v_resourceIndex
:=
-
1
;
v_request
:=
f_getCreateRequestPrimitive
(
p_resourceType
,
p_requestPrimitive
,
p_parentIndex
);
mcaPort
.
send
(
m_request
(
v_request
));
}
}
//end group CseSimuFunctions
group
CseAltstepFunctions
{
...
...
OneM2M_PermutationFunctions.ttcn
View file @
32e6b74f
...
...
@@ -1938,7 +1938,7 @@ module OneM2M_PermutationFunctions {
f_checkCseSimuStatus
();
//Check to see if the resource is present or not
if
(
f_isResourcePresent
CseSimu
(
v_resourceIndex
)){
if
(
f_
cse_
isResourcePresent
(
v_resourceIndex
)){
setverdict
(
pass
,
__SCOPE__
&
":INFO: Resource created"
);
}
else
{
setverdict
(
fail
,
__SCOPE__
&
":ERROR: Resource not created"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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