Skip to content
Snippets Groups Projects
Commit c9ed43a1 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

f_cse_updateAcpAuxResource correction

f_checkAttributesToBeSaved rewritten
stopping test case in certain functions to avoid runtime errors

Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 7943425c
No related branches found
No related tags found
1 merge request!25Ae fixes
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 197 2016-12-02 04:58:45Z reinaortega $ * $Id: OneM2M_Functions.ttcn 199 2016-12-04 21:49:51Z reinaortega $
* @desc Module containing functions for oneM2M * @desc Module containing functions for oneM2M
* *
*/ */
...@@ -494,6 +494,7 @@ module OneM2M_Functions { ...@@ -494,6 +494,7 @@ module OneM2M_Functions {
v_request := valueof(m_updateAcpBase); v_request := valueof(m_updateAcpBase);
v_request.to_ := f_getResourceAddress(vc_acpAuxIndex); v_request.to_ := f_getResourceAddress(vc_acpAuxIndex);
v_request.from_ := f_getOriginator(vc_acpAuxIndex);
v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := { v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := {
{ {
accessControlOriginators := PX_ACOR, //{"admin:admin"} accessControlOriginators := PX_ACOR, //{"admin:admin"}
...@@ -571,27 +572,58 @@ module OneM2M_Functions { ...@@ -571,27 +572,58 @@ module OneM2M_Functions {
} //end f_subscriptionVerificationHandler } //end f_subscriptionVerificationHandler
function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) { function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) {
select (p_resourceType) {
if(p_resourceType == int2) { case (int1) {
if(not(ispresent(p_response.primitiveContent.any_1[0].AE_optional.resourceName))) { if(isvalue(p_response.primitiveContent.any_1[0].AccessControlPolicy_optional) and
p_response.primitiveContent.any_1[0].AE_optional.resourceName := p_request.primitiveContent.any_1[0].AE_optional.resourceName; not(ispresent(p_response.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName))) {
} p_response.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName := p_request.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName;
} }
if(p_resourceType == int3) {
if(not(ispresent(p_response.primitiveContent.any_1[0].Container_optional.resourceName))) {
p_response.primitiveContent.any_1[0].Container_optional.resourceName := p_request.primitiveContent.any_1[0].Container_optional.resourceName;
} }
} case (int2) {
if(p_resourceType == int1) { if(isvalue(p_response.primitiveContent.any_1[0].AE_optional) and
if(not(ispresent(p_response.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName))) { not(ispresent(p_response.primitiveContent.any_1[0].AE_optional.resourceName))) {
p_response.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName := p_request.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName; p_response.primitiveContent.any_1[0].AE_optional.resourceName := p_request.primitiveContent.any_1[0].AE_optional.resourceName;
}
} }
} case (int3) {
if(p_resourceType == int2) { if(isvalue(p_response.primitiveContent.any_1[0].Container_optional) and
if(not(ispresent(p_response.primitiveContent.any_1[0].AE_optional.resourceName))) { not(ispresent(p_response.primitiveContent.any_1[0].Container_optional.resourceName))) {
p_response.primitiveContent.any_1[0].AE_optional.resourceName := p_request.primitiveContent.any_1[0].AE_optional.resourceName; p_response.primitiveContent.any_1[0].Container_optional.resourceName := p_request.primitiveContent.any_1[0].Container_optional.resourceName;
}
} }
} case (int15) {
if (isvalue(p_response.primitiveContent.any_1[0].PollingChannel_optional) and
not(ispresent(p_response.primitiveContent.any_1[0].PollingChannel_optional.resourceName))) {
p_response.primitiveContent.any_1[0].PollingChannel_optional.resourceName := p_request.primitiveContent.any_1[0].PollingChannel_optional.resourceName;
}
}
case (int18) {
if (isvalue(p_response.primitiveContent.any_1[0].Schedule_optional) and
not(ispresent(p_response.primitiveContent.any_1[0].Schedule_optional.resourceName))) {
p_response.primitiveContent.any_1[0].Schedule_optional.resourceName := p_request.primitiveContent.any_1[0].Schedule_optional.resourceName;
}
}
case (int23) {
if (isvalue(p_response.primitiveContent.any_1[0].Subscription_optional) and
not(ispresent(p_response.primitiveContent.any_1[0].Subscription_optional.resourceName))) {
p_response.primitiveContent.any_1[0].Subscription_optional.resourceName := p_request.primitiveContent.any_1[0].Subscription_optional.resourceName;
}
}
case (int9) {
if (isvalue(p_response.primitiveContent.any_1[0].Group_optional) and
not(ispresent(p_response.primitiveContent.any_1[0].Group_optional.resourceName))) {
p_response.primitiveContent.any_1[0].Group_optional.resourceName := p_request.primitiveContent.any_1[0].Group_optional.resourceName;
}
}
case else {
log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented");
if (not PX_DISABLE_STOP_ON_ERROR) {
testcase.stop;
}
}
}
// TODO test that if the resource name is returned is the same resource name as used in the create message
} }
function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{ function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{
...@@ -865,8 +897,14 @@ module OneM2M_Functions { ...@@ -865,8 +897,14 @@ module OneM2M_Functions {
if(ischosen(p_contentResource.any_1[0].ServiceSubscribedAppRule_optional)) { if(ischosen(p_contentResource.any_1[0].ServiceSubscribedAppRule_optional)) {
return p_contentResource.any_1[0].ServiceSubscribedAppRule_optional.resourceID; return p_contentResource.any_1[0].ServiceSubscribedAppRule_optional.resourceID;
} }
return "1"; log(""&__SCOPE__&":WARNING: Primitive Content Kind not implemented");
if (PX_DISABLE_STOP_ON_ERROR) {
return "1";
} else {
testcase.stop;
return "1";
}
} }
/** /**
...@@ -901,9 +939,13 @@ module OneM2M_Functions { ...@@ -901,9 +939,13 @@ module OneM2M_Functions {
if(ischosen(p_contentResource.any_1[0].ServiceSubscribedAppRule_optional)) { if(ischosen(p_contentResource.any_1[0].ServiceSubscribedAppRule_optional)) {
return p_contentResource.any_1[0].ServiceSubscribedAppRule_optional.resourceName; return p_contentResource.any_1[0].ServiceSubscribedAppRule_optional.resourceName;
} }
log(__SCOPE__&":WARNING: Primitive Content Kind not implemented");
return "1"; if (PX_DISABLE_STOP_ON_ERROR) {
return "1";
} else {
testcase.stop;
return "1";
}
} }
/** /**
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $
* $Id: OneM2M_Pixits.ttcn 195 2016-12-01 05:26:05Z reinaortega $ * $Id: OneM2M_Pixits.ttcn 199 2016-12-04 21:49:51Z reinaortega $
* @desc Module containing Pixits for oneM2M * @desc Module containing Pixits for oneM2M
* *
*/ */
...@@ -74,4 +74,5 @@ module OneM2M_Pixits { ...@@ -74,4 +74,5 @@ module OneM2M_Pixits {
modulepar Labels LABELS := {"VALUE_1"}; modulepar Labels LABELS := {"VALUE_1"};
modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information
modulepar boolean PX_DISABLE_STOP_ON_ERROR := false;
} // end of module } // end of module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment