Updated InfoPort messages

New PIXIT (PX_IUT_IS_IN_CSE)
New functions and templates for requesting info between components
Some fixes for Subscription Test Cases
parent fdd81e25
......@@ -417,6 +417,9 @@ module OneM2M_Functions {
function f_cse_preamble_subscriptionVerification(out AeSimu p_ae2,in integer p_aeIndex, inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2001) runs on AeSimu {
if(p_resourceType == int23){
p_ae2 := AeSimu.create("AE2") alive;
map(p_ae2:mcaPort, system:mcaPort);
map(p_ae2:mcaPortIn, system:mcaPortIn);
//TODO shall be unmapped?
p_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
p_ae2.done;
p_ae2Index := f_getResource(p_ae2);
......@@ -546,6 +549,43 @@ module OneM2M_Functions {
}
/**
@desc
*/
function f_getRequestPrimitive(in AeSimu p_ae) runs on Tester return RequestPrimitive {
var RequestPrimitive v_request;
f_connectInfoPort(p_ae);
p_ae.start(f_sendRequestPrimitive());
alt {
[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
}
}
f_disconnectInfoPort(p_ae);
return v_request;
}
function f_getRemoteCseRequestPrimitive(in CseSimu p_cse) runs on Tester return RequestPrimitive {
var RequestPrimitive v_request;
f_connectInfoPort(p_cse);
p_cse.start(f_sendRemoteCseRequestPrimitive());
alt {
[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
}
}
f_disconnectInfoPort(p_cse);
return v_request;
}
/**
@desc
......@@ -619,6 +659,18 @@ module OneM2M_Functions {
}
function f_sendRequestPrimitive() runs on AeSimu {
infoPort.send(vc_request.primitive.requestPrimitive);
}
function f_sendRemoteCseRequestPrimitive() runs on CseSimu {
infoPort.send(vc_request.primitive.requestPrimitive);
}
function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
infoPort.send(vc_primitiveContentRetrievedResource);
......@@ -1476,11 +1528,9 @@ module OneM2M_Functions {
*/
function f_cse_receiveCreateRequest(in template RequestPrimitive p_requestPrimitive := ?) runs on CseSimu {
var MsgIn v_request;
tc_ac.start;
alt {
[] mccPort.receive(mw_request(p_requestPrimitive)) -> value v_request {
[] mccPort.receive(mw_request(p_requestPrimitive)) -> value vc_request {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: CREATE Request received successfuly");
}
......
......@@ -102,6 +102,7 @@ module OneM2M_Pixits {
//NOTE: Apply to Device-based location request, and this requires Test System (TS) to activate ASN-AE mode to test IUT
modulepar boolean PX_IUT_IS_ASN_CSE := false; //default //set it to true when running Device-based location testcases
modulepar boolean PX_IUT_IS_MN_CSE := false; //default //set it to true when running Share-based location testcases
modulepar boolean PX_IUT_IS_IN_CSE := false; //default //set it to true when running Share-based location testcases
//constant parameters for LOC
modulepar XSD.Token PX_LOCATION_TARGET_ID := "{LOCATION-TARGET-ID}"; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER
......
......@@ -47,9 +47,9 @@ module OneM2M_Ports {
*/
type port InfoPort message {
in
ResponsePrimitive, PrimitiveContent, MyResource;
RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource;
out
ResponsePrimitive, PrimitiveContent, MyResource;
RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource;
}
}//end module
......@@ -3309,6 +3309,8 @@ module OneM2M_Templates {
template ResponsePrimitive mw_responsePrimitiveforInfoPort := ?;
template RequestPrimitive mw_requestPrimitiveforInfoPort := ?;
template ResponsePrimitive mw_responsePrimitive(in template (present) ResponseStatusCode p_statusCode, in template PrimitiveContent p_content := *) := {
responseStatusCode := p_statusCode,
requestIdentifier := ?,
......
......@@ -4639,7 +4639,8 @@ module OneM2M_Testcases {
var RequestPrimitive v_requestPrimitive;
var XSD.NonNegativeInteger maxByteSize := 512; //Correct value? Shall be indicated in TP?
v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
//v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
v_createRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_createRequest.primitiveContent.container.maxByteSize := maxByteSize;
v_createRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"}; //Correct value? Shall be indicated in TP?
......@@ -4648,6 +4649,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if maxByteSize attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize)){
if(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize != maxByteSize){
setverdict(fail, __SCOPE__ & ": Error: Value of maxByteSize has not been announced successfully");
......@@ -4667,7 +4669,8 @@ module OneM2M_Testcases {
var RequestPrimitive v_requestPrimitive;
var XSD.NonNegativeInteger v_contentSize := 512; //Correct value? Shall be indicated in TP?
v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
//v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
v_createRequest.primitiveContent.contentInstance.announceTo := {PX_CSE1_ID};
v_createRequest.primitiveContent.contentInstance.contentSize := v_contentSize;
v_createRequest.primitiveContent.contentInstance.announcedAttribute := {"contentSize"}; //Correct value? Shall be indicated in TP?
......@@ -4676,6 +4679,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if contentSize attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize)){
if(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize != v_contentSize){
setverdict(fail, __SCOPE__ & ": Error: Value of contentSize has not been announced successfully");
......@@ -4704,6 +4708,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if maxNrOfMembers attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers)){
if(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers != maxNrOfMembers){
setverdict(fail, __SCOPE__ & ": Error: Value of maxNrOfMembers has not been announced successfully");
......@@ -4732,6 +4737,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if locationSource attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource)){
if(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource != locationSource){
setverdict(fail, __SCOPE__ & ": Error: Value of locationSource has not been announced successfully");
......@@ -4760,6 +4766,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if description attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.announcedMgmtResource.description)){
if(v_requestPrimitive.primitiveContent.announcedMgmtResource.description != description){
setverdict(fail, __SCOPE__ & ": Error: Value of description has not been announced successfully");
......@@ -4802,6 +4809,7 @@ module OneM2M_Testcases {
if(getverdict == pass){
//Check if scheduleElement attribute has been announced
v_requestPrimitive := f_getRequestPrimitive(v_ae1);
if (ispresent(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement)){
if(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement != scheduleElement){
setverdict(fail, __SCOPE__ & ": Error: Value of scheduleElement has not been announced successfully");
......@@ -4814,13 +4822,16 @@ module OneM2M_Testcases {
}
}
function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu return RequestPrimitive{
function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{
// Local variables
var MsgIn v_anncRequest;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_containerIndex := -1;
var integer v_remoteCseIndex;
var integer v_aeAnncIndex;
var integer v_resourceIndex;
// Test control
......@@ -4830,7 +4841,17 @@ module OneM2M_Testcases {
// Test adapter configuration
// Preamble
v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
if (PX_IUT_IS_MN_CSE == true) {
vc_cseSimu.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase));
}else if (PX_IUT_IS_IN_CSE == true) {
vc_cseSimu.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
}
vc_cseSimu.done;
vc_cseSimu.start(f_cse_resourceAnnouncementHandler());
v_resourceIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit));
vc_cseSimu.done;
if(p_resourceType == int4) {
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
......@@ -4839,17 +4860,20 @@ module OneM2M_Testcases {
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
vc_cseSimu.start(f_cse_receiveCreateRequest(p_requestAnnc));
vc_cseSimu.done;
vc_cseSimu.start(f_cse_receiveCreateRequest(p_requestAnnc));
mcaPort.send(m_request(v_request));
vc_cseSimu.done;
vc_request.primitive.requestPrimitive := f_getRemoteCseRequestPrimitive(vc_cseSimu);
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
return v_anncRequest.primitive.requestPrimitive;
//return v_anncRequest.primitive.requestPrimitive;
}//end f_CSE_DMR_CRE_017
......
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