Commit 8400f794 authored by Antonio Castillo Verdugo's avatar Antonio Castillo Verdugo
Browse files

TP/oneM2M/CSE/REG/CRE/BI/001


TP/oneM2M/CSE/REG/RET/BV/001
TP/oneM2M/CSE/REG/RET/BV/005
TP/oneM2M/CSE/REG/RET/BV/006
TP/oneM2M/CSE/REG/UPD/BI/001
TP/oneM2M/CSE/REG/DEL/BI/001
Signed-off-by: Antonio Castillo Verdugo's avataracverdugo <acverdugo@at4wireless.com>
parent 0fdcafe9
......@@ -18,6 +18,7 @@ module OneM2M_Pics {
* @see oneM2M TS-0017 A.5.5.1/1
*/
modulepar boolean PICS_ACP_SUPPORT := true;
modulepar boolean PICS_IN_CSE := true;
} // end of module
......@@ -77,4 +77,7 @@ module OneM2M_Pixits {
modulepar Labels PX_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 PoaList PX_POA := {""};
modulepar ResourceTypeList PX_SRT := {int1, int2, int3, int4};
} // end of module
......@@ -263,6 +263,14 @@ module OneM2M_Templates {
primitiveContent:= {group_optional := m_contentUpdateGroup}
};
/**
* @desc Base UPDATE request primitive for CSEBase resource
*/
template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000),
primitiveContent:= {cSEBase_optional := m_contentUpdateCSEBase}
};
/**
* @desc Base UPDATE request primitive for Schedule resource
*/
......@@ -438,11 +446,20 @@ module OneM2M_Templates {
primitiveContent := {accessControlPolicy_optional := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
};
template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
from_ := PX_SUPER_USER,
requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
primitiveContent := {cSEBase_optional := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
};*/
/**
* @desc Base CREATE request primitive for CSEBase resource
*/
template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
resourceType := int5,
primitiveContent := {cSEBase_optional := m_contentCreateCSEBase}
};
......@@ -1016,7 +1033,7 @@ module OneM2M_Templates {
accessControlObjectDetails_list := {}
}
template (value) CSEBase_optional m_contentCreateCSEBase (in template (value) ServiceSubscribedAppRule p_serviceSubscribedAppRule) := {
/*template (value) CSEBase_optional m_contentCreateCSEBase (in template (value) ServiceSubscribedAppRule p_serviceSubscribedAppRule) := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
......@@ -1036,7 +1053,29 @@ module OneM2M_Templates {
serviceSubscribedAppRule := p_serviceSubscribedAppRule
}}
}
}
}*/
/**
* @desc Base primitiveContent for CREATE operation for CSEBase resource
* @param p_name Resource name
*/
template (value) CSEBase_optional m_contentCreateCSEBase (in template (omit) XSD.String p_name := c_defaultResourceName):= {
resourceName := p_name,//O
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
cseType := omit,
cSE_ID := omit,
supportedResourceType := omit,
pointOfAccess := omit,
nodeLink := omit,
e2eSecInfo := omit,
choice := omit
};
/**
* @desc Base primitiveContent for CREATE operation for Group resource
......@@ -1615,6 +1654,28 @@ module OneM2M_Templates {
choice := omit//NP
};
/**
* @desc Base primitiveContent for UPDATE operation for CSEBase resource
*/
template (value) CSEBase_optional m_contentUpdateCSEBase := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
cseType := omit,
cSE_ID := omit,
supportedResourceType := omit,
pointOfAccess := omit,
nodeLink := omit,
e2eSecInfo := omit,
choice := omit
};
/**
* @desc Base primitiveContent for UPDATE operation for PollingChannel resource
......@@ -2538,6 +2599,28 @@ module OneM2M_Templates {
notificationEventType := ?
}
};
template CSEBase_optional mw_contentCSEBaseBase := {
resourceName := ?,//M
resourceType := ?,//M
resourceID := ?,//M
parentID := ?,//M
creationTime := ?,//M
lastModifiedTime := ?,//M
labels := *,//O
accessControlPolicyIDs := *,//O
cseType := *,//O
cSE_ID := ?,//M
supportedResourceType := ?,//M
pointOfAccess := ?,//M
nodeLink := *,//O
e2eSecInfo := *,//O
choice := *//O
};
template CSEBase_optional mw_contentCSEBase_rc1 modifies mw_contentCSEBaseBase := {
choice := omit //O
}
}//end group responseContent
......
......@@ -471,6 +471,331 @@ module OneM2M_Testcases {
f_cf02Down();
}
group Create{
testcase TC_CSE_REG_CRE_BI_001() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var ResourceType v_resourceType := int5; //CSEBase
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": CSEBase creation rejected.");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating CSEBase");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_BV_012
} //end group Create
group Retrieve{
testcase TC_CSE_REG_RET_BV_001() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_contentResponse.cSEBase_optional := mw_contentCSEBase_rc1;
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Response OK for retrieving");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_REG_RET_BV_005
testcase TC_CSE_REG_RET_BV_005() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
if(not(PICS_IN_CSE)) {
setverdict(inconc, testcasename() & ": IUT shall be IN-CSE to run this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_contentResponse.cSEBase_optional := mw_contentCSEBase_rc1;
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
if (ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase_optional.cseType)){
if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase_optional.cseType==int1){
setverdict(pass, testcasename() & ": cseType attribute is set to 1 (IN_CSE)");
}else{
setverdict(fail, testcasename() & ": Error, cseType attribute is set to " & int2str(enum2int(v_response.primitive.responsePrimitive.primitiveContent.cSEBase_optional.cseType)));
}
}else{
setverdict(fail, testcasename() & ": Error, cseType attribute is not present");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_REG_RET_BV_005
testcase TC_CSE_REG_RET_BV_006() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_contentResponse.cSEBase_optional := mw_contentCSEBase_rc1;
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase_optional.supportedResourceType==PX_SRT){
setverdict(pass, testcasename() & ": supportedResourceTypes attribute is set according to PX_SRT");
}else{
setverdict(fail, testcasename() & ": supportedResourceTypes attribute is not set according to PX_SRT");
}
if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase_optional.pointOfAccess==PX_POA){
setverdict(pass, testcasename() & ": supportedResourceTypes attribute is set according to PX_POA");
}else{
setverdict(fail, testcasename() & ": supportedResourceTypes attribute is not set according to PX_POA");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_REG_RET_BV_006
} //end group Retrieve
group Update{
testcase TC_CSE_REG_UPD_BI_001() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateCSEBaseBase;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_updateRequest.primitiveContent.cSEBase_optional.labels := v_labels_1;
v_request := f_getUpdateRequestPrimitive(int5, v_aeIndex, v_updateRequest);
v_request.to_ := f_getResourceAddress();
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": CSEBase update rejected.");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating CSEBase");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_REG_UPD_BI_001
}// end group Update
group Delete{
testcase TC_CSE_REG_DEL_BI_001() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := valueof(m_deleteRequest(f_getResourceAddress()));
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": CSEBase deletion rejected.");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while deleting CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while deleting CSEBase");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_REG_DEL_BI_001
}// end group Delete
}//end Registration
......@@ -1134,7 +1459,7 @@ module OneM2M_Testcases {
v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);
}
// Test Bodyi
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
v_request.resultContent := int6;//Child resource references
mcaPort.send(m_request(v_request));
......
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