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

Alignment of TCs ID to TPs (TS-0018 v1.0.1)

parent cb67577b
No related branches found
No related tags found
No related merge requests found
......@@ -5446,328 +5446,707 @@ module OneM2M_Testcases_CSE {
group g_CSE_DMR_CRE_012 {
/**
* @desc Check that the IUT returns successfully after a CREATE request an empty content of created resource when the ResultContent set to 0 (Nothing)
* @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute OPTIONAL_ATTRIBUTE provided
*
*/
testcase TC_CSE_DMR_CRE_012_CNT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_ACPI() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int3, m_createContainerBase));//Container
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
v_createRequest.primitiveContent.container.accessControlPolicyIDs := {"NotInitialized"};
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_GRP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int9, m_createGroupBase));//Group
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.container.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_ACP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_LBL() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int1, m_createAcpBase));//AccessControlPolicy
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.container.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_MNI() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int18, m_createScheduleBase));//Schedule
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxNrOfInstances", omit};
v_createRequest.primitiveContent.container.maxNrOfInstances := 0;
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_PCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_MBS() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int15, m_createPollingChannelBase));//PollingChannel
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxByteSize", omit};
v_createRequest.primitiveContent.container.maxByteSize := 0;
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CNT_MIA() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_012(int23, m_createSubscriptionBase));//Subscription
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxInstanceAge", omit};
v_createRequest.primitiveContent.container.maxInstanceAge := 0;
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
testcase TC_CSE_DMR_CRE_012_CNT_OR() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
v_createRequest.primitiveContent.container.ontologyRef := "MyOntologyRef";
v_ae1.start(f_CSE_DMR_CRE_012(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int0;//Attributes
testcase TC_CSE_DMR_CRE_012_CIN_ET() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
v_createRequest.primitiveContent.contentInstance.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_012(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_012
} // end g_CSE_DMR_CRE_012
group g_CSE_DMR_CRE_013 {
testcase TC_CSE_DMR_CRE_012_CIN_LBL() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.contentInstance.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_012(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
/**
* @desc Check that the IUT returns successfully after a CREATE request only hierarchichal address of the created resource when the Result Content is set to 2 (hierarchical address)
*
*/
testcase TC_CSE_DMR_CRE_013_CNT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CIN_CR() runs on Tester system CseSystem {//TODO
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"creator", omit};
v_createRequest.primitiveContent.contentInstance.creator := "MyCreator";
v_ae1.start(f_CSE_DMR_CRE_012(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
v_contentResponse.uRI := mw_contentContainer_rc2;
v_ae1.start(f_CSE_DMR_CRE_013(int3, m_createContainerBase, v_contentResponse));//Container
testcase TC_CSE_DMR_CRE_012_CIN_CNF() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"contentInfo", omit};
v_createRequest.primitiveContent.contentInstance.contentInfo := "MyContentInfo";
v_ae1.start(f_CSE_DMR_CRE_012(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_013_GRP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_CIN_OR() runs on Tester system CseSystem {//TODO
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
v_createRequest.primitiveContent.contentInstance.ontologyRef := "MyOntologyRef";
v_ae1.start(f_CSE_DMR_CRE_012(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
v_contentResponse.uRI := mw_contentGroup_rc2;
testcase TC_CSE_DMR_CRE_012_ACP_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.accessControlPolicy.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_012(int1, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
v_ae1.start(f_CSE_DMR_CRE_013(int9, m_createGroupBase, v_contentResponse));//Group
testcase TC_CSE_DMR_CRE_012_ACP_LBL() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.accessControlPolicy.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_012(int1, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_013_ACP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_SUB_ACPI() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.uRI := mw_contentAcp_rc2;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := {"NotInitialized"};
v_ae1.start(f_CSE_DMR_CRE_013(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_013_SCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_SUB_ET() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.uRI := mw_contentSchedule_rc2;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.subscription.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_013(int18, m_createScheduleBase, v_contentResponse));//Schedule
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_013_PCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_SUB_LBL() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.uRI := mw_contentPollingChannel_rc2;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.subscription.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_013(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_013_SUB() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_012_SUB_ENC() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.uRI := mw_contentSubscription_rc2;
v_ae1.start(f_CSE_DMR_CRE_013(int23, m_createSubscriptionBase, v_contentResponse));//Subscription
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"eventNotificationCriteria", omit};
v_createRequest.primitiveContent.subscription.eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -));
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
function f_CSE_DMR_CRE_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
testcase TC_CSE_DMR_CRE_012_SUB_EXC() runs on Tester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"expirationCounter", omit};
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
v_createRequest.primitiveContent.subscription.expirationCounter := 1;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int2;//Attributes
testcase TC_CSE_DMR_CRE_012_SUB_GPI() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"groupID", omit};
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
tc_ac.stop;
if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) {
setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource");
} else {
setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");
v_createRequest.primitiveContent.subscription.groupID := "MyGroupID";
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_NFU() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationForwardingURI", omit};
v_createRequest.primitiveContent.subscription.notificationForwardingURI := "MyForwardingURI";
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_BN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"batchNotify", omit};
v_createRequest.primitiveContent.subscription.batchNotify := {0, "PT1S"};
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_RL() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"rateLimit", omit};
v_createRequest.primitiveContent.subscription.rateLimit := {0, omit};
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_PSN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"preSubscriptionNotify", omit};
v_createRequest.primitiveContent.subscription.preSubscriptionNotify := 1;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_PN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"pendingNotification", omit};
v_createRequest.primitiveContent.subscription.pendingNotification := int1;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_NSP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationStoragePriority", omit};
v_createRequest.primitiveContent.subscription.notificationStoragePriority := 1;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_LN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"latestNotify", omit};
v_createRequest.primitiveContent.subscription.latestNotify := true;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_NCT() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationContentType", omit};
v_createRequest.primitiveContent.subscription.notificationContentType := int1;
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_NEC() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationEventCat", omit};
v_createRequest.primitiveContent.subscription.notificationEventCat := {alt_1 := 100};
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_CR() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"creator", omit};
v_createRequest.primitiveContent.subscription.creator := "MyCreator";
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_012_SUB_SU() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"subscriberURI", omit};
v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI";
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on AeSimu {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_containerIndex := -1;
var integer v_parentIndex := -1;
var integer v_acpAuxIndex := -1;
var integer v_ae2Index := -1;
const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs";
var integer v_resourceIndex := -1;
// Test control
if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) {
if(not(PICS_ACP_SUPPORT)) {
setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
stop;
}
}
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
if (match(c_accessControlPolicyIDs, p_optionalAttribute.name)) {
v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi)
}
v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
if(p_resourceType == int4) {
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
v_parentIndex := v_containerIndex;
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name);
f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkAeSimuStatus();
//Check to see if the resource is present or not
if(f_isResourcePresent(v_resourceIndex)) {
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_012
}// end group g_CSE_DMR_CRE_012
group g_CSE_DMR_CRE_013{
/**
* @desc Check that the IUT rejects the CREATE Request of a contentInstance resource with error “NOT_ACCEPTABLE” when contentSize exceeds maxByteSize
*
*/
testcase TC_CSE_DMR_CRE_013() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
const integer c_maxByteSize := 0;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Maximum byte size exceeded");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_013
}// end group g_CSE_DMR_CRE_013
group g_CSE_DMR_CRE_014{
/**
* @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created.
*
*/
testcase TC_CSE_DMR_CRE_014() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
const integer c_maxByteSize := 512;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_createRequest := m_createContainerBase;
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex);
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length)
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": ContentInstance resource created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
//Check currentByteSize
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2");
if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");
}
else{
setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource");
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_013
} // end g_CSE_DMR_CRE_013
group g_CSE_DMR_CRE_014 {
}//end TC_CSE_DMR_CRE_014
}// end group g_CSE_DMR_CRE_014
group g_CSE_DMR_CRE_015 {
/**
* @desc Check that the IUT returns successfully after a CREATE request only attributes and hierarchichal address of the created resource when Result Content is set 3 (attributes and hierarchichal address)
* @desc Check that the IUT returns successfully after a CREATE request an empty content of created resource when the ResultContent set to 0 (Nothing)
*
*/
testcase TC_CSE_DMR_CRE_014_CNT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_CNT() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentContainer_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int3, m_createContainerBase, v_contentResponse));//Container
v_ae1.start(f_CSE_DMR_CRE_015(int3, m_createContainerBase));//Container
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_014_GRP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_GRP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentGroup_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int9, m_createGroupBase, v_contentResponse));//Group
v_ae1.start(f_CSE_DMR_CRE_015(int9, m_createGroupBase));//Group
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_014_ACP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_ACP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentAcp_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy
v_ae1.start(f_CSE_DMR_CRE_015(int1, m_createAcpBase));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_014_SCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_SCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentSchedule_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int18, m_createScheduleBase, v_contentResponse));//Schedule
v_ae1.start(f_CSE_DMR_CRE_015(int18, m_createScheduleBase));//Schedule
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_014_PCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_PCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentPollingChannel_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel
v_ae1.start(f_CSE_DMR_CRE_015(int15, m_createPollingChannelBase));//PollingChannel
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_014_SUB() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_015_SUB() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_contentResponse.resource := mw_contentSubscription_rc3;
v_ae1.start(f_CSE_DMR_CRE_014(int23, m_createSubscriptionBase, v_contentResponse));//Subscription
v_ae1.start(f_CSE_DMR_CRE_015(int23, m_createSubscriptionBase));//Subscription
v_ae1.done;
}
function f_CSE_DMR_CRE_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
// Local variables
var MsgIn v_response;
......@@ -5784,31 +6163,27 @@ module OneM2M_Testcases_CSE {
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int3;//Attributes + Hierarchichal Address
v_request.resultContent := int0;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response {
tc_ac.stop;
if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) {
setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation");
} else {
setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");
}
setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3");
setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
......@@ -5825,597 +6200,375 @@ module OneM2M_Testcases_CSE {
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_014
}//end f_CSE_DMR_CRE_015
} // end g_CSE_DMR_CRE_014
group g_CSE_DMR_CRE_015 {
/**
* @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute OPTIONAL_ATTRIBUTE provided
*
*/
testcase TC_CSE_DMR_CRE_015_CNT_ACPI() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
v_createRequest.primitiveContent.container.accessControlPolicyIDs := {"NotInitialized"};
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.container.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_LBL() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.container.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_MNI() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxNrOfInstances", omit};
v_createRequest.primitiveContent.container.maxNrOfInstances := 0;
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_MBS() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxByteSize", omit};
v_createRequest.primitiveContent.container.maxByteSize := 0;
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_MIA() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"maxInstanceAge", omit};
v_createRequest.primitiveContent.container.maxInstanceAge := 0;
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CNT_OR() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
v_createRequest.primitiveContent.container.ontologyRef := "MyOntologyRef";
v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CIN_ET() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.contentInstance.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CIN_LBL() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.contentInstance.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CIN_CR() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"creator", omit};
v_createRequest.primitiveContent.contentInstance.creator := "MyCreator";
v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CIN_CNF() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"contentInfo", omit};
v_createRequest.primitiveContent.contentInstance.contentInfo := "MyContentInfo";
v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_CIN_OR() runs on Tester system CseSystem {//TODO
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
v_createRequest.primitiveContent.contentInstance.ontologyRef := "MyOntologyRef";
v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_ACP_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.accessControlPolicy.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_ACP_LBL() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.accessControlPolicy.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
} // end g_CSE_DMR_CRE_015
group g_CSE_DMR_CRE_016 {
testcase TC_CSE_DMR_CRE_015_SUB_ACPI() runs on Tester system CseSystem {
/**
* @desc Check that the IUT returns successfully after a CREATE request only hierarchichal address of the created resource when the Result Content is set to 2 (hierarchical address)
*
*/
testcase TC_CSE_DMR_CRE_016_CNT() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := {"NotInitialized"};
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"expirationTime", omit};
v_createRequest.primitiveContent.subscription.expirationTime := "20301231T012345";
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.uRI := mw_contentContainer_rc2;
v_ae1.start(f_CSE_DMR_CRE_016(int3, m_createContainerBase, v_contentResponse));//Container
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_LBL() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_016_GRP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"labels", omit};
v_createRequest.primitiveContent.subscription.labels := {"MyLabel"};
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_ENC() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"eventNotificationCriteria", omit};
v_createRequest.primitiveContent.subscription.eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -));
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.uRI := mw_contentGroup_rc2;
v_ae1.start(f_CSE_DMR_CRE_016(int9, m_createGroupBase, v_contentResponse));//Group
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_EXC() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_016_ACP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"expirationCounter", omit};
v_createRequest.primitiveContent.subscription.expirationCounter := 1;
v_contentResponse.uRI := mw_contentAcp_rc2;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_016(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_GPI() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_016_SCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"groupID", omit};
v_createRequest.primitiveContent.subscription.groupID := "MyGroupID";
v_contentResponse.uRI := mw_contentSchedule_rc2;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_016(int18, m_createScheduleBase, v_contentResponse));//Schedule
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_NFU() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_016_PCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationForwardingURI", omit};
v_createRequest.primitiveContent.subscription.notificationForwardingURI := "MyForwardingURI";
v_contentResponse.uRI := mw_contentPollingChannel_rc2;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_016(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_BN() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_016_SUB() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"batchNotify", omit};
v_createRequest.primitiveContent.subscription.batchNotify := {0, "PT1S"};
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.uRI := mw_contentSubscription_rc2;
v_ae1.start(f_CSE_DMR_CRE_016(int23, m_createSubscriptionBase, v_contentResponse));//Subscription
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_RL() runs on Tester system CseSystem {
function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"rateLimit", omit};
v_createRequest.primitiveContent.subscription.rateLimit := {0, omit};
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
}
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
testcase TC_CSE_DMR_CRE_015_SUB_PSN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"preSubscriptionNotify", omit};
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int2;//Attributes
v_createRequest.primitiveContent.subscription.preSubscriptionNotify := 1;
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
tc_ac.stop;
if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) {
setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource");
} else {
setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
// Tear down
f_cf01Down();
}
}//end f_CSE_DMR_CRE_016
} // end g_CSE_DMR_CRE_016
group g_CSE_DMR_CRE_017 {
testcase TC_CSE_DMR_CRE_015_SUB_PN() runs on Tester system CseSystem {
/**
* @desc Check that the IUT returns successfully after a CREATE request only attributes and hierarchichal address of the created resource when Result Content is set 3 (attributes and hierarchichal address)
*
*/
testcase TC_CSE_DMR_CRE_017_CNT() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"pendingNotification", omit};
v_createRequest.primitiveContent.subscription.pendingNotification := int1;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_NSP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationStoragePriority", omit};
v_createRequest.primitiveContent.subscription.notificationStoragePriority := 1;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.resource := mw_contentContainer_rc3;
v_ae1.start(f_CSE_DMR_CRE_017(int3, m_createContainerBase, v_contentResponse));//Container
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_LN() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_017_GRP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"latestNotify", omit};
v_createRequest.primitiveContent.subscription.latestNotify := true;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.resource := mw_contentGroup_rc3;
v_ae1.start(f_CSE_DMR_CRE_017(int9, m_createGroupBase, v_contentResponse));//Group
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_NCT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_017_ACP() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationContentType", omit};
v_createRequest.primitiveContent.subscription.notificationContentType := int1;
v_contentResponse.resource := mw_contentAcp_rc3;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_017(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_NEC() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_017_SCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"notificationEventCat", omit};
v_createRequest.primitiveContent.subscription.notificationEventCat := {alt_1 := 100};
v_contentResponse.resource := mw_contentSchedule_rc3;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_017(int18, m_createScheduleBase, v_contentResponse));//Schedule
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_CR() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_017_PCH() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"creator", omit};
v_createRequest.primitiveContent.subscription.creator := "MyCreator";
v_contentResponse.resource := mw_contentPollingChannel_rc3;
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_ae1.start(f_CSE_DMR_CRE_017(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_015_SUB_SU() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_017_SUB() runs on Tester system CseSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
const AttributeAux c_optionalAttribute := {"subscriberURI", omit};
v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI";
v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute));
v_contentResponse.resource := mw_contentSubscription_rc3;
v_ae1.start(f_CSE_DMR_CRE_017(int23, m_createSubscriptionBase, v_contentResponse));//Subscription
v_ae1.done;
}
function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on AeSimu {
function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_containerIndex := -1;
var integer v_parentIndex := -1;
var integer v_acpAuxIndex := -1;
var integer v_ae2Index := -1;
const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs";
var integer v_resourceIndex := -1;
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
// Test control
if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) {
if(not(PICS_ACP_SUPPORT)) {
setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
stop;
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int3;//Attributes + Hierarchichal Address
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
tc_ac.stop;
if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) {
setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation");
} else {
setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");
}
}
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
if (match(c_accessControlPolicyIDs, p_optionalAttribute.name)) {
v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi)
}
v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
if(p_resourceType == int4) {
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
v_parentIndex := v_containerIndex;
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name);
f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkAeSimuStatus();
//Check to see if the resource is present or not
if(f_isResourcePresent(v_resourceIndex)) {
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_015
}// end group g_CSE_DMR_CRE_015
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_017
} // end g_CSE_DMR_CRE_017
group g_CSE_DMR_CRE_016 {
group g_CSE_DMR_CRE_020 {
/**
* @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announceTo provided
*
*/
testcase TC_CSE_DMR_CRE_016_ACP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_ACP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int1, v_createRequest, mw_createAccessControlPolicyAnnc));//AccessControlPolicy
v_ae1.start(f_CSE_DMR_CRE_020(int1, v_createRequest, mw_createAccessControlPolicyAnnc));//AccessControlPolicy
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_CNT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_CNT() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int3, v_createRequest, mw_createContainerAnncBase));//Container
v_ae1.start(f_CSE_DMR_CRE_020(int3, v_createRequest, mw_createContainerAnncBase));//Container
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_CIN() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_CIN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int4, v_createRequest, mw_createContentInstanceAnncBase));//ContentInstance
v_ae1.start(f_CSE_DMR_CRE_020(int4, v_createRequest, mw_createContentInstanceAnncBase));//ContentInstance
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_GRP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_GRP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int9, v_createRequest, mw_createGroupAnncBase));//Group
v_ae1.start(f_CSE_DMR_CRE_020(int9, v_createRequest, mw_createGroupAnncBase));//Group
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_LCP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_LCP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit);
v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int10, v_createRequest, mw_createLocationPolicyAnncBase));//LocationPolicy
v_ae1.start(f_CSE_DMR_CRE_020(int10, v_createRequest, mw_createLocationPolicyAnncBase));//LocationPolicy
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_MGO() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_MGO() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createMgmtObjBase;
v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int13, v_createRequest, mw_createMgmtObjAnncBase));//MgmtObj
v_ae1.start(f_CSE_DMR_CRE_020(int13, v_createRequest, mw_createMgmtObjAnncBase));//MgmtObj
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_NOD() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_NOD() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createNodeBase;
v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int14, v_createRequest, mw_createNodeAnnc));//Node
v_ae1.start(f_CSE_DMR_CRE_020(int14, v_createRequest, mw_createNodeAnnc));//Node
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_016_SCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_020_SCH() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};
v_ae1.start(f_CSE_DMR_CRE_016(int18, v_createRequest, mw_createScheduleAnncBase));//Schedule
v_ae1.start(f_CSE_DMR_CRE_020(int18, v_createRequest, mw_createScheduleAnncBase));//Schedule
v_ae1.done;
}
function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu {
function f_CSE_DMR_CRE_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu {
// Local variables
var MsgIn v_response;
......@@ -6452,17 +6605,17 @@ module OneM2M_Testcases_CSE {
// Tear down
f_cf02Down();
}//end f_CSE_DMR_CRE_016
}//end f_CSE_DMR_CRE_020
} // end g_CSE_DMR_CRE_016
} // end g_CSE_DMR_CRE_020
group g_CSE_DMR_CRE_017 {
group g_CSE_DMR_CRE_021 {
/**
* @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announcedAttribute provided
*
*/
testcase TC_CSE_DMR_CRE_017_CNT() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_CNT() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
......@@ -6474,7 +6627,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.container.maxByteSize := maxByteSize;
v_createRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int3, v_createRequest, mw_createContainerAnncBase()));//Container
v_ae1.start(f_CSE_DMR_CRE_021(int3, v_createRequest, mw_createContainerAnncBase()));//Container
v_ae1.done;
if(getverdict == pass){
......@@ -6492,7 +6645,7 @@ module OneM2M_Testcases_CSE {
}
}
testcase TC_CSE_DMR_CRE_017_CIN() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_CIN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
......@@ -6504,7 +6657,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.contentInstance.contentSize := v_contentSize;
v_createRequest.primitiveContent.contentInstance.announcedAttribute := {"contentSize"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int4, v_createRequest, mw_createContentInstanceAnncBase()));//ContentInstance
v_ae1.start(f_CSE_DMR_CRE_021(int4, v_createRequest, mw_createContentInstanceAnncBase()));//ContentInstance
v_ae1.done;
if(getverdict == pass){
......@@ -6522,7 +6675,7 @@ module OneM2M_Testcases_CSE {
}
}
testcase TC_CSE_DMR_CRE_017_GRP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_GRP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
......@@ -6533,7 +6686,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.group_.maxNrOfMembers := maxNrOfMembers;
v_createRequest.primitiveContent.group_.announcedAttribute := {"maxNrOfMembers"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int9, v_createRequest, mw_createGroupAnncBase()));//Group
v_ae1.start(f_CSE_DMR_CRE_021(int9, v_createRequest, mw_createGroupAnncBase()));//Group
v_ae1.done;
if(getverdict == pass){
......@@ -6551,7 +6704,7 @@ module OneM2M_Testcases_CSE {
}
}
testcase TC_CSE_DMR_CRE_017_LCP() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_LCP() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit);
......@@ -6562,7 +6715,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.locationPolicy.locationSource := locationSource;
v_createRequest.primitiveContent.locationPolicy.announcedAttribute := {"locationSource"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int10, v_createRequest, mw_createLocationPolicyAnncBase()));//LocationPolicy
v_ae1.start(f_CSE_DMR_CRE_021(int10, v_createRequest, mw_createLocationPolicyAnncBase()));//LocationPolicy
v_ae1.done;
if(getverdict == pass){
......@@ -6580,7 +6733,7 @@ module OneM2M_Testcases_CSE {
}
}
testcase TC_CSE_DMR_CRE_017_MGO() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_MGO() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createMgmtObjBase;
......@@ -6591,7 +6744,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.mgmtResource.description := description;
v_createRequest.primitiveContent.mgmtResource.announcedAttribute := {"description"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int13, v_createRequest, mw_createMgmtObjAnncBase()));//MgmtObj
v_ae1.start(f_CSE_DMR_CRE_021(int13, v_createRequest, mw_createMgmtObjAnncBase()));//MgmtObj
v_ae1.done;
if(getverdict == pass){
......@@ -6609,7 +6762,7 @@ module OneM2M_Testcases_CSE {
}
}
testcase TC_CSE_DMR_CRE_017_NOD() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_NOD() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createNodeBase;
......@@ -6619,11 +6772,11 @@ module OneM2M_Testcases_CSE {
//TODO node to be done. hostedCSELink attribute (OA) to be added!!!
v_ae1.start(f_CSE_DMR_CRE_017(int14, v_createRequest, mw_createNodeAnnc));//Node
v_ae1.start(f_CSE_DMR_CRE_021(int14, v_createRequest, mw_createNodeAnnc));//Node
v_ae1.done;
}
testcase TC_CSE_DMR_CRE_017_SCH() runs on Tester system CseSystem {
testcase TC_CSE_DMR_CRE_021_SCH() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
......@@ -6634,7 +6787,7 @@ module OneM2M_Testcases_CSE {
v_createRequest.primitiveContent.schedule.scheduleElement := scheduleElement; //Correct value? Shall be indicated in TP?
v_createRequest.primitiveContent.schedule.announcedAttribute := {"scheduleElement"}; //Correct value? Shall be indicated in TP?
v_ae1.start(f_CSE_DMR_CRE_017(int18, v_createRequest, mw_createScheduleAnncBase()));//Schedule
v_ae1.start(f_CSE_DMR_CRE_021(int18, v_createRequest, mw_createScheduleAnncBase()));//Schedule
v_ae1.done;
if(getverdict == pass){
......@@ -6652,7 +6805,7 @@ module OneM2M_Testcases_CSE {
}
}
function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{
function f_CSE_DMR_CRE_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{
// Local variables
var MsgIn v_anncRequest;
......@@ -6705,161 +6858,10 @@ module OneM2M_Testcases_CSE {
//return v_anncRequest.primitive.requestPrimitive;
}//end f_CSE_DMR_CRE_017
} // end g_CSE_DMR_CRE_017
group g_CSE_DMR_CRE_020{
/**
* @desc Check that the IUT rejects the CREATE Request of a contentInstance resource with error “NOT_ACCEPTABLE” when contentSize exceeds maxByteSize
*
*/
testcase TC_CSE_DMR_CRE_020() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
const integer c_maxByteSize := 0;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex);
}//end f_CSE_DMR_CRE_021
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Maximum byte size exceeded");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_020
}// end group g_CSE_DMR_CRE_020
group g_CSE_DMR_CRE_021{
/**
* @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created.
*
*/
testcase TC_CSE_DMR_CRE_021() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
const integer c_maxByteSize := 512;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_createRequest := m_createContainerBase;
} // end g_CSE_DMR_CRE_021
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex);
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length)
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": ContentInstance resource created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
//Check currentByteSize
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");
}
else{
setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_021
}// end group g_CSE_DMR_CRE_021
}//end group Create
......
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