Commit aff0f4b8 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

New CSE/DMR/CRE test cases +


review of template for reception for different values of resultContent +
some compilation errors
Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 9cfafe9b
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 224 2017-02-10 10:40:40Z reinaortega $
* $Id: OneM2M_Functions.ttcn 229 2017-03-16 08:00:30Z reinaortega $
* @desc Module containing functions for oneM2M
*
*/
......@@ -968,6 +968,7 @@ module OneM2M_Functions {
*/
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on CseTester return RequestPrimitive {
var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"};
var template AcpType v_defaultAcpIDs := {"NotInitialized"};
if(p_resourceType != int2) {
p_request.from_ := f_getOriginator(p_parentIndex);
......@@ -975,6 +976,7 @@ module OneM2M_Functions {
p_request.to_ := f_getResourceAddress(p_parentIndex);
if (p_resourceType == int1) {//AccessControlPolicy
}
if (p_resourceType == int9) {//group
......@@ -987,7 +989,10 @@ module OneM2M_Functions {
//when a container is created by hosting cse for storing location information, the container is seen as a location container
if(PX_IS_LOC_CONTAINER){
p_request.primitiveContent.any_1[0].Container_optional.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy
}
}
if(match(valueof(p_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs), v_defaultAcpIDs )){
p_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)};
}
}
if (p_resourceType == int15) {//pollingChannel
......
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
* $Id: OneM2M_Templates.ttcn 226 2017-03-09 08:58:45Z reinaortega $
* $Id: OneM2M_Templates.ttcn 229 2017-03-16 08:00:30Z reinaortega $
* @desc Module containing templates for oneM2M
*
*/
......@@ -404,7 +404,7 @@ module OneM2M_Templates {
requestIdentifier := testcasename() & "-m_createAEAnnc" & f_rnd(1, 1000000),
resourceType := int10002,
primitiveContent := {
any_1 := {{AEAnnc_optional := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_to & "/" & p_stemId)}}
any_1 := {{AEAnnc_optional := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}}
},
roleIDs := omit,
originatingTimestamp := omit,
......@@ -436,7 +436,7 @@ module OneM2M_Templates {
requestIdentifier := ?,
resourceType := int10002,
primitiveContent := {
any_1 := {{AEAnnc_optional := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_to & "/" & p_stemId)}}
any_1 := {{AEAnnc_optional := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}}
},
roleIDs := *,
originatingTimestamp := *,
......@@ -583,6 +583,18 @@ module OneM2M_Templates {
}
};
/**
* @desc Base CREATE request primitive for Content Instance resource
*/
template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000),
resourceType := int3,
primitiveContent := {
any_1 := {{ContentInstance_optional := m_contentCreateContentInstance}}
}
};
template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
to_ := p_parentResourceAddress,
from_ := "admin:admin",
......@@ -1186,7 +1198,7 @@ module OneM2M_Templates {
* @desc Base primitiveContent for CREATE operation for ContentInstance resource
* @param p_primitiveContent Content for the ContentInstance
*/
template (value) ContentInstance_optional m_contentCreateContentInstance(XSD.String p_primitiveContent) := {
template (value) ContentInstance_optional m_contentCreateContentInstance(XSD.String p_primitiveContent := "NotInitializedValue") := {
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
......@@ -1656,8 +1668,9 @@ module OneM2M_Templates {
//TODO
template XSD.AnyURI mw_contentAcp_rc2 := ?;
template AccessControlPolicy_optional mw_contentAcp_rc3 modifies mw_contentAcpBase := {
choice := omit //O
template Resource mw_contentAcp_rc3 := {
choice := {sg_announceableSubordinateResource := {accessControlPolicy := ?}},
uRI := ?
}
template AccessControlPolicy_optional mw_contentAcp_rc4 modifies mw_contentAcpBase := {
......@@ -1769,8 +1782,9 @@ module OneM2M_Templates {
template XSD.AnyURI mw_contentGroup_rc2 := ?;
template Group_optional mw_contentGroup_rc3 modifies mw_contentGroupBase := {
choice := omit //O
template Resource mw_contentGroup_rc3 := {
choice := {sg_announceableResource := {group_ := ?}},
uRI := ?
}
template Group_optional mw_contentGroup_rc4 modifies mw_contentGroupBase := {
......@@ -1843,6 +1857,33 @@ module OneM2M_Templates {
expirationTime := omit//M
};
template PollingChannel_optional mw_contentPollingChannel_rc1 modifies mw_contentPollingChannelBase := {
}
template XSD.AnyURI mw_contentPollingChannel_rc2 := ?;
template Resource mw_contentPollingChannel_rc3 := {
choice := {sg_subordinateResource := {pollingChannel := ?}},
uRI := ?
}
template PollingChannel_optional mw_contentPollingChannel_rc4 modifies mw_contentPollingChannelBase := {
}
template PollingChannel_optional mw_contentPollingChannel_rc5 modifies mw_contentPollingChannelBase := {
}
template PollingChannel_optional mw_contentPollingChannel_rc6 modifies mw_contentPollingChannelBase := {
resourceName := *,//M
resourceType := *,//M
resourceID := *,//M
parentID := *,//M
creationTime := *,//M
lastModifiedTime := *,//M
labels := *,//O
expirationTime := *//M
}
template Schedule_optional mw_contentScheduleBase := {
resourceName := ?,//M
resourceType := ?,//M
......@@ -1894,8 +1935,9 @@ module OneM2M_Templates {
template XSD.AnyURI mw_contentSchedule_rc2 := ?;
template Schedule_optional mw_contentSchedule_rc3 modifies mw_contentScheduleBase := {
choice := omit //O
template Resource mw_contentSchedule_rc3 := {
choice := {sg_announceableSubordinateResource := {schedule := ?}},
uRI := ?
}
template Schedule_optional mw_contentSchedule_rc4 modifies mw_contentScheduleBase := {
......@@ -2016,8 +2058,9 @@ module OneM2M_Templates {
template XSD.AnyURI mw_contentSubscription_rc2 := ?;
template Subscription_optional mw_contentSubscription_rc3 modifies mw_contentSubscriptionBase := {
choice := omit //O
template Resource mw_contentSubscription_rc3 := {
choice := {sg_regularResource := {subscription := ?}},
uRI := ?
}
template Subscription_optional mw_contentSubscription_rc4 modifies mw_contentSubscriptionBase := {
......@@ -2167,8 +2210,9 @@ module OneM2M_Templates {
template XSD.AnyURI mw_contentContainer_rc2 := ?;
template Container_optional mw_contentContainer_rc3 modifies mw_contentContainerBase := {
choice := omit //O
template Resource mw_contentContainer_rc3 := {
choice := {sg_announceableResource := {container := ?}},
uRI := ?
}
template Container_optional mw_contentContainer_rc4 modifies mw_contentContainerBase := {
......@@ -2381,7 +2425,7 @@ module OneM2M_Templates {
* @param p_statusCode Status code
* @param p_requestId Request ID of the corresponding request
*/
template (value) ResponsePrimitive m_responsePrimitive_content(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in PrimitiveContent p_content) modifies m_responsePrimitive := {
template (value) ResponsePrimitive m_responsePrimitive_content(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in template (value) PrimitiveContent p_content) modifies m_responsePrimitive := {
primitiveContent := p_content
}
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment