oneM2M Interop event#3 output: Check points added to all test cases

Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 7e20e7aa
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 218 2017-02-07 09:36:53Z carres $
* $Id: OneM2M_Functions.ttcn 224 2017-02-10 10:40:40Z reinaortega $
* @desc Module containing functions for oneM2M
*
*/
......@@ -25,13 +25,15 @@ module OneM2M_Functions {
group ConfigFunctions {
/**
@desc Ports mapping and default behaviour activation for Config 1
*/
function f_cf01Up() runs on CseTester {
// Variables
vc_config := e_cf01;
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
......@@ -39,7 +41,7 @@ module OneM2M_Functions {
activate(a_cse_cf01());
// Connect
//Initialze the IUT
} // end f_cf01Up
......@@ -47,6 +49,7 @@ module OneM2M_Functions {
function f_cf02Up() runs on CseTester {
// Variables
vc_config := e_cf02;
// Map
map(self:mcaPort, system:mcaPort);
......@@ -56,7 +59,7 @@ module OneM2M_Functions {
activate(a_cse_cf02());
// Connect
//Initialze the IUT
} // end f_cf02Up
......@@ -67,7 +70,8 @@ module OneM2M_Functions {
function f_cf03Up() runs on AeTester {
// Variables
vc_config := e_cf03;
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
......@@ -81,14 +85,27 @@ module OneM2M_Functions {
} // end f_cf03Up
/**
* @desc Ports unmapping for Config 03
* @desc Ports unmapping
* @verdict
*/
function f_cf03Down() runs on AeTester {
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
function f_cfCseTesterDown() runs on CseTester {
if(vc_config == e_cf01) {
f_cf01Down()
} else if (vc_config == e_cf02){
f_cf02Down()
}
}
/**
* @desc Ports unmapping
* @verdict
*/
function f_cfAeTesterDown() runs on AeTester {
if(vc_config == e_cf03) {
f_cf03Down()
}
}
/**
* @desc Ports unmapping
* @verdict
......@@ -97,16 +114,28 @@ module OneM2M_Functions {
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
//stop;
stop;
}
/**
* @desc Ports unmapping
* @verdict
*/
function f_cf02Down() runs on CseTester {
unmap(self:mcaPort, system:mcaPort);
unmap(self:mccPort, system:mccPort);
unmap(self:acPort, system:acPort);
//stop;
stop;
}
/**
* @desc Ports unmapping for Config 03
*/
function f_cf03Down() runs on AeTester {
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
stop;
}
}//end group configFunctions
......@@ -180,6 +209,7 @@ module OneM2M_Functions {
}
}
f_checkCseTesterStatus();
return v_aeAuxIndex;
}
......@@ -249,6 +279,7 @@ module OneM2M_Functions {
}
}
f_checkCseTesterStatus();
return v_aeAuxIndex;
}
......@@ -296,11 +327,12 @@ module OneM2M_Functions {
v_request := valueof(m_deleteRequest(v_resourceAddress));
if(PX_FROM_IS_AE_ID){
if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) {
v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID;
}
}
//Not needed any longer: PX_SUPER_USER should be able to do all operations
// if(PX_FROM_IS_AE_ID){
// if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) {
// v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID;
// }
// }
f_cse_deleteResource(v_request);
......@@ -376,6 +408,8 @@ module OneM2M_Functions {
}
}
f_checkCseTesterStatus();
return v_resourceIndex;
}
......@@ -419,6 +453,8 @@ module OneM2M_Functions {
setverdict(inconc, "f_createAccessControlPolicy: No answer while creating resource type " & int2str(1));
}
}
f_checkCseTesterStatus();
return v_acpAuxIndex;
......@@ -476,6 +512,9 @@ module OneM2M_Functions {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
}
f_checkCseTesterStatus();
}// end f_cse_updateResource
/**
......@@ -542,6 +581,8 @@ module OneM2M_Functions {
setverdict(inconc, "f_updateAcpAuxResource: No answer while updating " & v_request.to_ & " resource" );
}
}
f_checkCseTesterStatus();
}
function f_subscriptionVerificationHandler(in XSD.ID p_creator, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester {
......@@ -803,7 +844,9 @@ module OneM2M_Functions {
setverdict(inconc, testcasename() & ": AE registration request not received");
stop;
}
}
}
f_checkAeTesterStatus();
return v_resourceIndex;
}
......@@ -1281,6 +1324,38 @@ module OneM2M_Functions {
group CommonFunctions {
/**
* @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA
* @param data Corresponding information for the correct execution of the given action
* @verdict
*/
function f_checkCseTesterStatus() runs on CseTester {
if (getverdict != pass) {
f_cse_postamble_deleteResources();
// Tear down
f_cfCseTesterDown();
}
}
/**
* @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA
* @param data Corresponding information for the correct execution of the given action
* @verdict
*/
function f_checkAeTesterStatus() runs on AeTester {
if (getverdict != pass) {
//f_ae_postamble_deleteResources();
// Tear down
f_cfAeTesterDown();
}
}
/**
* @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA
......
......@@ -7,13 +7,14 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $
* $Id: OneM2M_TestSystem.ttcn 202 2016-12-15 15:08:33Z reinaortega $
* $Id: OneM2M_TestSystem.ttcn 224 2017-02-10 10:40:40Z reinaortega $
* @desc Test System module for oneM2M
*
*/
module OneM2M_TestSystem {
import from OneM2M_Types all;
import from OneM2M_TypesAndValues all;
import from LibCommon_Time {modulepar all};
/* Ports */
......@@ -44,6 +45,7 @@ module OneM2M_TestSystem {
timer tc_ac := PX_TAC;
timer tc_wait;
//global variables
var Configurations vc_config;
var MyResourcesList vc_resourcesList;
var IntegerList vc_resourcesIndexToBeDeleted := {};
}
......
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $
* $Id: OneM2M_TypesAndValues.ttcn 147 2016-10-25 07:52:22Z carres $
* $Id: OneM2M_TypesAndValues.ttcn 224 2017-02-10 10:40:40Z reinaortega $
* @desc Module containing types and values for oneM2M
*
*/
......@@ -92,5 +92,11 @@ module OneM2M_TypesAndValues {
type NhURI ParentID;
type record length(0 .. infinity) of RequestPrimitive RequestPrimitiveList;
type record length(1 .. infinity) of RequestPrimitiveList RequestPrimitiveMatrix;
type enumerated Configurations {
e_cf01,
e_cf02,
e_cf03
}
}
// end of module
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
* $Id: OneM2M_Testcases.ttcn 218 2017-02-07 09:36:53Z carres $
* $Id: OneM2M_Testcases.ttcn 224 2017-02-10 10:40:40Z reinaortega $
* @desc Module containing test cases for oneM2M
*
*/
......@@ -127,9 +127,9 @@ module OneM2M_Testcases {
// Test component configuration
f_cf01Up();
//Preambule
//Preamble
v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi);
//Test Body
v_request := valueof(m_createAe(PX_APP_ID, omit, omit));
......@@ -4113,6 +4113,10 @@ module OneM2M_Testcases {
p_createRequestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};
} else {
f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});
v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2};
v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest);
f_cse_updateResource(v_updateRequest);
}
//Creation of resource
......@@ -7050,6 +7054,7 @@ module OneM2M_Testcases {
v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex);
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......@@ -7103,7 +7108,8 @@ module OneM2M_Testcases {
v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance
v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex);
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......@@ -7161,7 +7167,8 @@ module OneM2M_Testcases {
v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......@@ -7214,7 +7221,7 @@ module OneM2M_Testcases {
v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription
//v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {"Not Initialized"};
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......@@ -7271,7 +7278,8 @@ module OneM2M_Testcases {
v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)};
notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int4101));
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
......@@ -7329,7 +7337,8 @@ module OneM2M_Testcases {
v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)};
notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int5205));
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
......
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