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

Implemented TC CSE/PCH/004


Signed-off-by: Pramod Kulkarni's avatarpkulkarni <pkulkarni75@gmail.com>
parent ad9b9a3a
......@@ -1246,7 +1246,7 @@ module OneM2M_Templates {
/**
* @desc Base UPDATE request primitive for PollingChannel resource
*/
template (value) RequestPrimitive m_deletePollingChannelBase modifies m_delete := {
template (value) RequestPrimitive m_deletePollingChannelBase(XSD.ID p_resourceAddress, in XSD.ID p_originator := PX_SUPER_AE_ID) modifies m_delete := {
requestIdentifier := "m_deletePollingChannel",
primitiveContent:= {pollingChannel := m_contentDeletePollingChannel}
};
......@@ -2679,6 +2679,22 @@ module OneM2M_Templates {
}//end group ContentUpdate
group ContentRetrieve {
/**
* @desc Base primitiveContent for DELETE operation for PollingChannel resource
*/
template (value) PollingChannel_optional m_contentRetrievePollingChannel := {
resourceName := omit,//NP
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
expirationTime := omit//O
};
}
group ContentDelete {
/**
......@@ -4226,6 +4242,14 @@ module OneM2M_Templates {
}
}
template (value) UtTriggerPrimitive m_utCreatePollingChannel modifies m_utCreate := {
requestPrimitive := {
requestIdentifier := testcasename() & "-m_utCreatePollingChannel" & f_rnd(1, 1000000),
resourceType := int15,
primitiveContent := {pollingChannel := m_contentPollingChannel_allOmit}
}
}
template (value) UtTriggerPrimitive m_utRetrieve(XSD.ID p_targetResourceAddress) := {
requestPrimitive := {
operation := int2,
......@@ -4257,6 +4281,14 @@ module OneM2M_Templates {
forcedFields := omit
};
template (value) UtTriggerPrimitive m_utRetrievePollingChannel(XSD.ID p_targetResourceAddress) modifies m_utRetrieve := {
requestPrimitive := {
requestIdentifier := testcasename() & "-m_utRetrievePollingChannel" & f_rnd(1, 1000000),
resourceType := int15,
primitiveContent := {pollingChannel := m_contentRetrievePollingChannel}
}
}
template (value) UtTriggerPrimitive m_utUpdate := {
requestPrimitive := {
operation := int3,
......
......@@ -7207,7 +7207,7 @@ module OneM2M_Testcases_CSE_Release_2 {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_PCH_001());
v_ae1.start(f_CSE_PCH_002());
v_ae1.done;
......@@ -7354,7 +7354,78 @@ module OneM2M_Testcases_CSE_Release_2 {
}
function f_CSE_PCH_004() runs on CseSimu {
//Local variables
var integer v_cseIndex := -1;
var integer v_resourceIndex := -1;
var MsgIn v_request;
var ResponsePrimitive v_response;
var template UtTriggerPrimitive v_utRequest1 := m_utCreatePollingChannel;
var template UtTriggerPrimitive v_utRequest2;
var charstring v_action1 := "Please, send a Polling Channel request";
var charstring v_action2 := "Please, send a Retrieve Polling Channel request";
var RequestPrimitive v_requestNotify;
//Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
//send triggering primitive to SUT
f_sendUtPrimitive(v_utRequest1,v_action1);
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(m_createPollingChannelBase)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type Polling Channel created successfuly");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel");
}
}
v_utRequest2 := m_utRetrievePollingChannel(f_getResourceAddress(v_cseIndex));
//send triggering primitive to SUT
f_sendUtPrimitive(v_utRequest2,v_action2);
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(m_retrievePollingRequest(f_getResourceAddress(v_cseIndex), f_getOriginator(v_cseIndex)))) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type Polling Channel retrieved successfuly");
v_response := valueof(m_responsePrimitive(int2000,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel");
}
}
v_requestNotify := valueof(m_notify(f_getResourceAddress(v_cseIndex)));
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(v_requestNotify)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": NOTIFY request received");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while expecting NOTIFY request");
}
}
//Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}
group g_CSE_PCH_005 {
......@@ -7367,20 +7438,11 @@ module OneM2M_Testcases_CSE_Release_2 {
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.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2, v_request));
v_ae1.done;
}
......@@ -7393,24 +7455,13 @@ module OneM2M_Testcases_CSE_Release_2 {
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.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2, v_request));
v_ae1.done;
}
......@@ -7423,24 +7474,15 @@ module OneM2M_Testcases_CSE_Release_2 {
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;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2, v_request));
v_ae1.done;
}
......@@ -7453,28 +7495,19 @@ module OneM2M_Testcases_CSE_Release_2 {
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 := valueof(m_deletePollingChannelBase(f_getResourceAddress(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 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;
v_ae1.start(f_CSE_PCH_005(v_aeIndex1, v_aeIndex2, v_request));
v_ae1.done;
}
function f_CSE_PCH_005(inout integer p_aeIndex1, inout integer p_aeIndex2) runs on AeSimu {
function f_CSE_PCH_005(inout integer p_aeIndex1, inout integer p_aeIndex2, RequestPrimitive p_requestprimitive) runs on AeSimu {
//Local variables
var integer v_aeIndex1 := -1;
......@@ -7500,6 +7533,17 @@ module OneM2M_Testcases_CSE_Release_2 {
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);
mcaPort.send(m_request(p_requestprimitive));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Polling Resource type not created as originator has no privilege");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while creating polling resource type");
}
}
}
......
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