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
e75ee72f
Commit
e75ee72f
authored
Jan 29, 2020
by
Miguel Angel Reina Ortega
Browse files
Fix
#68
Signed-off-by:
reinaortega
<
miguelangel.reinaortega@etsi.org
>
parent
95d81d07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
42 deletions
+61
-42
OneM2M_PermutationFunctions.ttcn
OneM2M_PermutationFunctions.ttcn
+61
-42
No files found.
OneM2M_PermutationFunctions.ttcn
View file @
e75ee72f
...
...
@@ -925,10 +925,11 @@ module OneM2M_PermutationFunctions {
// Local variables
var
RequestPrimitive
v_request
;
var
RequestPrimitive
v_groupRequest
:=
m_createGroupBase
;
var
integer
v_aeIndex
:=
-
1
;
var
integer
v_groupIndex
:=
-
1
;
var
integer
v_resourceIndex
:=
-
1
;
var
AddressingMethod
v_addressingMethod
;
var
PrimitiveScope
v_primitiveScope
;
// Test control
if
(
not
(
PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT
))
{
...
...
@@ -943,22 +944,26 @@ module OneM2M_PermutationFunctions {
// Preamble
v_aeIndex
:=
f_cse_preamble_registerAe
();
//c_CRUDNDi);
v_resourceIndex
:=
f_cse_createResource
(
int3
,
m_createContainerBase
,
v_aeIndex
);
v_groupRequest
.
primitiveContent
.
group_
.
memberIDs
:=
{
f_getResourceId
(
vc_resourcesList
[
v_resourceIndex
].
resource
)};
v_groupIndex
:=
f_cse_createResource
(
int9
,
v_groupRequest
,
v_aeIndex
);
// Test Body
v_request
:=
f_getCreateRequestPrimitive
(
int3
,
m_createContainerBase
,
v_aeIndex
);
//Force usage of Hybrid Hierarchical addressing method
v_addressingMethod
:=
e_hybrid
;
v_primitiveScope
:=
p_primitiveScope
;
v_request
:=
f_getCreateRequestPrimitive
(
int3
,
m_createContainerBase
,
v_resourceIndex
);
v_request
.
to_
:=
f_getResourceAddress
(
v_resourceIndex
,
v_addressingMethod
,
v_primitiveScope
);
v_addressingMethod
:=
e_nonHierarchical
;
v_request
.
to_
:=
f_getResourceAddress
(
v_groupIndex
,
v_addressingMethod
,
p_primitiveScope
);
v_request
.
to_
:=
v_request
.
to_
&
"/fopt"
;
f_send
(
e_mca_port
,
m_request
(
v_request
));
tc_ac
.
start
;
alt
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
1
)))
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
0
)))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
":
Container resource created using hierarchical
addressing
method
"
);
setverdict
(
pass
,
__SCOPE__
&
":
Fanout operation performed successfully by using hybrid
addressing"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
{
tc_ac
.
stop
;
...
...
@@ -1161,9 +1166,11 @@ module OneM2M_PermutationFunctions {
// Local variables
var
integer
v_aeIndex
:=
-
1
;
var
integer
v_groupIndex
:=
-
1
;
var
integer
v_resourceIndex
:=
-
1
;
var
AddressingMethod
v_addressingMethod
;
var
PrimitiveScope
v_primitiveScope
;
var
RequestPrimitive
v_request
;
var
RequestPrimitive
v_groupRequest
:=
m_createGroupBase
;
// Test control
if
(
not
(
PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT
))
{
...
...
@@ -1181,17 +1188,22 @@ module OneM2M_PermutationFunctions {
v_resourceIndex
:=
f_cse_createResource
(
int3
,
m_createContainerBase
,
v_aeIndex
);
v_groupRequest
.
primitiveContent
.
group_
.
memberIDs
:=
{
f_getResourceId
(
vc_resourcesList
[
v_resourceIndex
].
resource
)};
v_groupIndex
:=
f_cse_createResource
(
int9
,
v_groupRequest
,
v_aeIndex
);
// Test Body
//Force usage of Hybrid Hierarchical addressing method
v_addressingMethod
:=
e_hybrid
;
v_primitiveScope
:=
p_primitiveScope
;
f_send
(
e_mca_port
,
m_request
(
m_retrieve
(
f_getResourceAddress
(
v_resourceIndex
,
v_addressingMethod
,
v_primitiveScope
),
f_getOriginator
(
v_resourceIndex
))));
v_addressingMethod
:=
e_nonHierarchical
;
v_request
:=
m_retrieve
(
f_getResourceAddress
(
v_groupIndex
,
v_addressingMethod
,
p_primitiveScope
),
f_getOriginator
(
v_groupIndex
));
v_request
.
to_
:=
v_request
.
to_
&
"/fopt"
;
f_send
(
e_mca_port
,
m_request
(
v_request
));
tc_ac
.
start
;
alt
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
)))
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
)))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
":
Container resource retrieved
using hybrid addressing
method
"
);
setverdict
(
pass
,
__SCOPE__
&
":
Fanout operation performed successfully by
using hybrid addressing"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
{
tc_ac
.
stop
;
...
...
@@ -1199,10 +1211,10 @@ module OneM2M_PermutationFunctions {
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveKO
))
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
": Error while ret
riev
ing container resource using h
ybrid
addressing method"
);
setverdict
(
fail
,
__SCOPE__
&
": Error while
c
re
a
ting container resource using h
ierarchical
addressing method"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
fail
,
__SCOPE__
&
": No answer while ret
riev
ing resource"
);
setverdict
(
fail
,
__SCOPE__
&
": No answer while
c
re
a
ting resource"
);
}
}
...
...
@@ -1211,7 +1223,7 @@ module OneM2M_PermutationFunctions {
// Tear down
f_cf01Down
();
}
//end f_CSE_GEN_RET_004
}
// end of group Retrieve
...
...
@@ -1410,11 +1422,12 @@ module OneM2M_PermutationFunctions {
function
f_CSE_GEN_UPD_004
(
in
PrimitiveScope
p_primitiveScope
)
runs
on
AeSimu
system
CseSystem
{
// Local variables
var
RequestPrimitive
v_groupRequest
:=
m_createGroupBase
;
var
RequestPrimitive
v_updateRequest
:=
valueof
(
m_updateContainerBase
);
var
integer
v_aeIndex
:=
-
1
;
var
integer
v_groupIndex
:=
-
1
;
var
integer
v_resourceIndex
:=
-
1
;
var
AddressingMethod
v_addressingMethod
;
var
PrimitiveScope
v_primitiveScope
;
// Test control
if
(
not
(
PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT
))
{
...
...
@@ -1432,22 +1445,24 @@ module OneM2M_PermutationFunctions {
v_resourceIndex
:=
f_cse_createResource
(
int3
,
m_createContainerBase
,
v_aeIndex
);
// Test Body
//Force usage of Hybrid Hierarchical addressing method
v_addressingMethod
:=
e_hybrid
;
v_primitiveScope
:=
p_primitiveScope
;
v_groupRequest
.
primitiveContent
.
group_
.
memberIDs
:=
{
f_getResourceId
(
vc_resourcesList
[
v_resourceIndex
].
resource
)};
v_groupIndex
:=
f_cse_createResource
(
int9
,
v_groupRequest
,
v_aeIndex
);
// Test Body
v_updateRequest
:=
f_getUpdateRequestPrimitive
(
int9
,
v_groupIndex
,
v_updateRequest
);
v_updateRequest
.
primitiveContent
.
container
.
labels
:=
{
"MyLabel"
};
v_updateRequest
:=
f_getUpdateRequestPrimitive
(
int3
,
v_resourceIndex
,
v_updateRequest
);
v_updateRequest
.
to_
:=
f_getResourceAddress
(
v_resourceIndex
,
v_addressingMethod
,
v_primitiveScope
);
//Force usage of Hybrid Hierarchical addressing method
v_addressingMethod
:=
e_nonHierarchical
;
v_updateRequest
.
to_
:=
f_getResourceAddress
(
v_groupIndex
,
v_addressingMethod
,
p_primitiveScope
);
v_updateRequest
.
to_
:=
v_updateRequest
.
to_
&
"/fopt"
;
f_send
(
e_mca_port
,
m_request
(
v_updateRequest
));
tc_ac
.
start
;
alt
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
4
)))
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
0
)))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
":
Container resource updated using hierarchical
addressing
method
"
);
setverdict
(
pass
,
__SCOPE__
&
":
Fanout operation performed successfully by using hybrid
addressing"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
{
tc_ac
.
stop
;
...
...
@@ -1455,10 +1470,10 @@ module OneM2M_PermutationFunctions {
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveKO
))
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
": Error while
upd
ating container resource using hierarchical addressing method"
);
setverdict
(
fail
,
__SCOPE__
&
": Error while
cre
ating container resource using hierarchical addressing method"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
fail
,
__SCOPE__
&
": No answer while
upd
ating resource"
);
setverdict
(
fail
,
__SCOPE__
&
": No answer while
cre
ating resource"
);
}
}
...
...
@@ -1467,7 +1482,7 @@ module OneM2M_PermutationFunctions {
// Tear down
f_cf01Down
();
}
//end f_CSE_GEN_UPD_004
}
// end of group Update
...
...
@@ -1658,10 +1673,11 @@ module OneM2M_PermutationFunctions {
// Local variables
var
RequestPrimitive
v_request
;
var
RequestPrimitive
v_groupRequest
:=
m_createGroupBase
;
var
integer
v_aeIndex
:=
-
1
;
var
integer
v_groupIndex
:=
-
1
;
var
integer
v_resourceIndex
:=
-
1
;
var
AddressingMethod
v_addressingMethod
;
var
PrimitiveScope
v_primitiveScope
;
// Test control
if
(
not
(
PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT
))
{
...
...
@@ -1679,19 +1695,22 @@ module OneM2M_PermutationFunctions {
v_resourceIndex
:=
f_cse_createResource
(
int3
,
m_createContainerBase
,
v_aeIndex
);
v_groupRequest
.
primitiveContent
.
group_
.
memberIDs
:=
{
f_getResourceId
(
vc_resourcesList
[
v_resourceIndex
].
resource
)};
v_groupIndex
:=
f_cse_createResource
(
int9
,
v_groupRequest
,
v_aeIndex
);
// Test Body
//Force usage of Hybrid Hierarchical addressing method
v_addressingMethod
:=
e_hybrid
;
v_primitiveScope
:=
p_primitiveScope
;
v_request
:=
valueof
(
m_delete
(
f_getResourceAddress
(
v_resourceIndex
,
v_addressingMethod
,
v_primitiveScope
),
f_getOriginator
(
v_resourceIndex
)));
v_addressingMethod
:=
e_nonHierarchical
;
v_request
:=
valueof
(
m_delete
(
f_getResourceAddress
(
v_groupIndex
,
v_addressingMethod
,
p_primitiveScope
),
f_getOriginator
(
v_resourceIndex
)));
v_request
.
to_
:=
v_request
.
to_
&
"/fopt"
;
f_send
(
e_mca_port
,
m_request
(
v_request
));
tc_ac
.
start
;
alt
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
2
)))
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int200
0
)))
->
value
vc_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
":
Container resource deleted using hierarchical
addressing
method
"
);
setverdict
(
pass
,
__SCOPE__
&
":
Fanout operation performed successfully by using hybrid
addressing"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
{
tc_ac
.
stop
;
...
...
@@ -1699,10 +1718,10 @@ module OneM2M_PermutationFunctions {
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveKO
))
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
": Error while
dele
ting container resource using hierarchical addressing method"
);
setverdict
(
fail
,
__SCOPE__
&
": Error while
crea
ting container resource using hierarchical addressing method"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
fail
,
__SCOPE__
&
": No answer while
dele
ting resource"
);
setverdict
(
fail
,
__SCOPE__
&
": No answer while
crea
ting resource"
);
}
}
...
...
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