Commit ad9b9a3a authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Implemented TPs CSE/PCH/003 and CSE/PCH/005


Signed-off-by: Pramod Kulkarni's avatarpkulkarni <pkulkarni75@gmail.com>
parent 3cc4cc2f
......@@ -1243,6 +1243,14 @@ module OneM2M_Templates {
vendorInformation := *
};
/**
* @desc Base UPDATE request primitive for PollingChannel resource
*/
template (value) RequestPrimitive m_deletePollingChannelBase modifies m_delete := {
requestIdentifier := "m_deletePollingChannel",
primitiveContent:= {pollingChannel := m_contentDeletePollingChannel}
};
}//end group Delete
group Notify {
......@@ -2670,6 +2678,24 @@ module OneM2M_Templates {
}
}//end group ContentUpdate
group ContentDelete {
/**
* @desc Base primitiveContent for DELETE operation for PollingChannel resource
*/
template (value) PollingChannel_optional m_contentDeletePollingChannel := {
resourceName := omit,//NP
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
expirationTime := omit//O
};
} //end group ContentDelete
group RequestContent {
......
......@@ -1729,6 +1729,7 @@ type union PrimitiveContent {
ResourceRefList resourceRefList,
AggregatedResponse aggregatedResponse,
URI uRI,
RequestPrimitive requestPrimitive,
DebugInfo debugInfo,
//Invalid types
AE_update_invalid aE_update_invalid,
......
......@@ -7203,7 +7203,7 @@ module OneM2M_Testcases_CSE_Release_2 {
* @desc Check that the IUT which hosts <pollingChannel> resource forwards a Notify request successfully to a target AE, once the IUT receives a polling request from AE (retrieve request to <pollingChannelURI> resource)
*
*/
testcase TC_CSE_PCH_001() runs on Tester system CseSystem {
testcase TC_CSE_PCH_002() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
......@@ -7213,7 +7213,7 @@ module OneM2M_Testcases_CSE_Release_2 {
}
function f_CSE_PCH_001() runs on AeSimu {
function f_CSE_PCH_002() runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
......@@ -7271,7 +7271,239 @@ module OneM2M_Testcases_CSE_Release_2 {
// Tear down
f_cf01Down();
} // end TC_CSE_PCH_001
} // end TC_CSE_PCH_002
testcase TC_CSE_PCH_003() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_PCH_003());
v_ae1.done;
}
function f_CSE_PCH_003() runs on AeSimu {
//Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
vc_cse1.done;
v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
mcaPort.send(m_request(v_request));
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_requestNotify));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePollingResponse(v_requestNotify))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Polling response received");
}
[] mcaPort.receive(mw_response(mw_responsePollingResponse)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Content not carrying request targeting AE1");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
mcaPort.send(m_request(v_requestNotify));
//Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
}
testcase TC_CSE_PCH_004() runs on Tester system CseSystem {
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_cse1.start(f_CSE_PCH_004());
v_cse1.done;
}
function f_CSE_PCH_004() runs on CseSimu {
}
group g_CSE_PCH_005 {
testcase TC_CSE_PCH_005_CRE() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var RequestPrimitive v_request;
var integer v_aeIndex1 := -1;
var integer v_aeIndex2 := -1;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2));
v_request := f_getCreateRequestPrimitive(int15, v_createRequest, v_aeIndex1);
v_request.to_ := f_getResourceAddress(v_aeIndex2);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(int15)) & " not created as originator has no privilege");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while creating polling resource type " & int2str(enum2int(p_resourceType)));
}
}
v_ae1.done;
}
testcase TC_CSE_PCH_005_RET() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var RequestPrimitive v_request;
var integer v_aeIndex1 := -1;
var integer v_aeIndex2 := -1;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2));
v_request := f_getCreateRequestPrimitive(int15, v_createRequest, v_aeIndex1);
mcaPort.send(m_request(v_request));
v_request := valueof(m_retrievePollingRequest(f_getResourceAddress(v_aeIndex1), f_getOriginator(v_aeIndex1)));
v_request.to_ := f_getResourceAddress(v_aeIndex2);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(int15)) & " not retrieved as originator has no privilege");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving polling resource type " & int2str(enum2int(p_resourceType)));
}
}
v_ae1.done;
}
testcase TC_CSE_PCH_005_UPD() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var RequestPrimitive v_request;
var integer v_aeIndex1 := -1;
var integer v_aeIndex2 := -1;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2));
v_request := f_getCreateRequestPrimitive(int15, v_createRequest, v_aeIndex1);
mcaPort.send(m_request(v_request));
v_request := valueof(m_updatePollingChannelBase);
v_request.to_ := f_getResourceAddress(v_aeIndex2);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(int15)) & " not retrieved as originator has no privilege");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving polling resource type " & int2str(enum2int(p_resourceType)));
}
}
v_ae1.done;
}
testcase TC_CSE_PCH_005_DEL() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var RequestPrimitive v_request;
var integer v_aeIndex1 := -1;
var integer v_aeIndex2 := -1;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2));
v_request := f_getCreateRequestPrimitive(int15, v_createRequest, v_aeIndex1);
mcaPort.send(m_request(v_request));
v_request := valueof(m_deletePollingChannelBase);
v_request.to_ := f_getResourceAddress(v_aeIndex2);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(int15)) & " not deleted as originator has no privilege");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while deleting polling resource type " & int2str(enum2int(p_resourceType)));
}
}
v_ae1.done;
}
function f_CSE_PCH_005(inout integer p_aeIndex1, inout integer p_aeIndex2) runs on AeSimu {
//Local variables
var integer v_aeIndex1 := -1;
var integer v_aeIndex2 := -1;
var integer v_resourceIndex := -1;
var integer v_acpAuxIndex := -1;
var RequestPrimitive v_request;
var MsgIn v_response;
var RequestPrimitive v_requestNotify;
// Test control
// Test component configuration
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int63);//c_CUDNDi)
p_aeIndex1 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
p_aeIndex2 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
//v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
}
} //end group g_CSE_PCH_005
}//end group PollingChannel
......
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