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

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

parents db1bb0a6 4a802bca
......@@ -2000,19 +2000,25 @@ module OneM2M_Functions {
}//end group altstepFunctions
/**
* @desc Get the Resource Identifier with Unstructured-CSE-relative -Resource-ID format
*/
function f_resourceIdCleaner(in XSD.ID p_resourceID) return XSD.ID {
var integer v_length := lengthof(p_resourceID);
var integer i;
var XSD.ID result := "";
//log("p_resourceID: " & p_resourceID);
for (i := v_length - 1; i>=0; i := i-1){
if(p_resourceID[i]=="/"){
//log("result: " & result);
return result;
}
else{
result := p_resourceID[i] & result;
}
}
//log("result: " & result);
return result;
}
......
......@@ -535,7 +535,7 @@ module OneM2M_Templates {
* @desc Base CREATE request primitive for CSEBase resource
*/
template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
requestIdentifier := testcasename() & "-m_createCSEBase" & f_rnd(1, 1000000),
resourceType := int5,
primitiveContent := {cSEBase := m_contentCreateCSEBase}
};
......
......@@ -1367,7 +1367,7 @@ module OneM2M_Testcases {
* @desc Check that the IUT rejects the create request of <CSEBase> resource.
*
*/
testcase TC_CSE_REG_CRE_024() runs on CseTester system CseSystem {
testcase TC_CSE_REG_CRE_025() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
......@@ -1386,7 +1386,7 @@ module OneM2M_Testcases {
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, v_aeIndex);
v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, -1);
mcaPort.send(m_request(v_request));
tc_ac.start;
......@@ -2218,15 +2218,15 @@ module OneM2M_Testcases {
p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex));
}
if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){
f_cse_preamble_registerAe();
}
v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex);
} else {//Resource under CSEBase
if(p_resourceType != int1) {
......@@ -3307,6 +3307,8 @@ module OneM2M_Testcases {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_ae2Index := -1;
var CseTester v_notifyHandler;
// Test control
......@@ -3318,6 +3320,8 @@ module OneM2M_Testcases {
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request.resultContent := int0;//Attributes
......@@ -16331,6 +16335,7 @@ module OneM2M_Testcases {
// Test Body
v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex);
v_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
mcaPort.send(m_request(valueof(v_request)));
......@@ -16658,7 +16663,7 @@ module OneM2M_Testcases {
v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request
v_updateRequest.primitiveContent.aE.labels := v_labels_1;
v_request.primitiveContent.aE.labels := v_labels_1;
mcaPort.send(m_request(v_request));
tc_ac.start;
......@@ -17337,6 +17342,7 @@ module OneM2M_Testcases {
v_notifyHandler.start(f_CSE_SUB_DEL_001(f_getResourceAddress(v_resourceIndex))); // check that no notification is received
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
......@@ -17592,7 +17598,7 @@ module OneM2M_Testcases {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully");
v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1);
v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1, v_aeIndex);
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
......@@ -17664,7 +17670,7 @@ module OneM2M_Testcases {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully");
v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, c_accessControlPolicyType);
v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, c_accessControlPolicyType, v_aeIndex);
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
......@@ -17767,8 +17773,8 @@ module OneM2M_Testcases {
v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex);
if(getverdict == pass){
if(ischosen(v_primitiveContentRetrievedResource.aE)) {
if(not match (v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){
setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute not updated correctly")
if(not match (f_resourceIdCleaner(v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs[0]), v_updateRequest.primitiveContent.aE.accessControlPolicyIDs[0])){
setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute not updated correctly");
}
}
}
......@@ -18322,15 +18328,15 @@ module OneM2M_Testcases {
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var Labels v_labels_1:= {"VALUE_1"};
v_updateRequest.primitiveContent.container.labels := v_labels_1;
f_CSE_SEC_ACP_012(v_updateRequest, int62); //TODO Fix p_acor
f_CSE_SEC_ACP_012(v_updateRequest, int59);
}//end TC_CSE_SEC_ACP_012_UPD
testcase TC_CSE_SEC_ACP_012_RET() runs on CseTester system CseSystem { //Retrieve
f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int62); //TODO Fix p_acor
f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int61);
}//end TC_CSE_SEC_ACP_012_RET
testcase TC_CSE_SEC_ACP_012_DEL() runs on CseTester system CseSystem { //Delete
f_CSE_SEC_ACP_012(m_delete("Temporary", "Temporary"), int62); //TODO Fix p_acor
f_CSE_SEC_ACP_012(m_delete("Temporary", "Temporary"), int55);
}//end TC_CSE_SEC_ACP_012_DEL
function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on CseTester {
......
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