Commit 0824db85 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge branch 'Test_architecture_improvement' of https://git.onem2m.org/TST/ATS...

Merge branch 'Test_architecture_improvement' of https://git.onem2m.org/TST/ATS into Test_architecture_improvement
parents 0adaf86c 5e832b5c
......@@ -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");
}
......
......@@ -125,6 +125,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 := ?,
......
......@@ -45,6 +45,7 @@ module OneM2M_TestControl {
execute(TC_CSE_REG_CRE_023());
execute(TC_CSE_REG_CRE_025());
execute(TC_CSE_REG_CRE_028());
execute(TC_CSE_REG_CRE_029());
execute(TC_CSE_REG_RET_001());
execute(TC_CSE_REG_RET_005());
execute(TC_CSE_REG_RET_008());
......
......@@ -967,7 +967,7 @@ module OneM2M_Testcases {
//Preambule
//vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
//TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule
v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
//v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
//Test Body
//v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));
......@@ -1173,11 +1173,12 @@ module OneM2M_Testcases {
//Preambule
vc_cseSimu.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase));
vc_cseSimu.done;
v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM"));
vc_cseSimu.start(f_cse_resourceAnnouncementHandler());
vc_cseSimu.done;
//TODO Deregister
//f_cse_deleteResource(v_aeIndex);
......@@ -1540,7 +1541,7 @@ module OneM2M_Testcases {
* @desc Check that the IUT rejects the create request of <CSEBase> resource.
*
*/
testcase TC_CSE_REG_CRE_027() runs on InCseSimu system CseSystem {
testcase TC_CSE_REG_CRE_027() runs on AeSimu system CseSystem {
// Local variables
var RequestPrimitive v_request;
......@@ -1550,23 +1551,23 @@ module OneM2M_Testcases {
// Test control
// Test component configuration
f_cf01UpCseSimuMaster();
f_cf02Up();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
vc_cseSimu.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase));
// Test Body
vc_aeSimu.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)));
f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": AE creation successful.");
}
[] mccPort.receive {
[] mcaPort.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE");
}
......@@ -1576,10 +1577,10 @@ module OneM2M_Testcases {
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
f_cse_postamble_deleteResources();
// Tear down
f_cf01DownCseSimuMaster();
f_cf02Down();
}//end TC_CSE_REG_CRE_027
......@@ -1633,6 +1634,47 @@ module OneM2M_Testcases {
}
testcase TC_CSE_REG_CRE_029() runs on CseSimu system CseSystem {
var MsgIn v_response;
var RequestPrimitive v_request;
var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase);
var ResourceType v_resourceType := int16;
// Test control
// Test component configuration
f_cf04Up();
// Test adapter configuration
// Preamble
v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1);
tc_ac.start;
alt {
[] mccPort.receive(mw_request(mw_createRemoteCSEBase(PX_CSE_ID,f_getResourceAddress(-1)))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
}
[] mccPort.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
}
} //end group Create
......@@ -4639,7 +4681,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 +4691,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 +4711,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 +4721,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 +4750,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 +4779,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 +4808,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 +4851,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 +4864,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 +4883,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);
......@@ -4841,15 +4904,18 @@ module OneM2M_Testcases {
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
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