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

First review -> Rest of TCs to be completed


Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 637b0de1
......@@ -24,23 +24,23 @@ module OneM2M_Functions {
group configFunctions {
/**
@desc
*/
function f_cf01Up() runs on M2M {
/**
@desc
*/
function f_cf01Up() runs on M2M {
// Variables
// Variables
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
activate(a_default());
// Map
map(self:mcaPort, system:mcaPort);
map(self:acPort, system:acPort);
activate(a_default());
// Connect
// Connect
//Initialze the IUT
//Initialze the IUT
} // end f_cf01Up
} // end f_cf01Up
}//end group configFunctions
......@@ -64,7 +64,7 @@ module OneM2M_Functions {
//TODO Test, to be removed
v_request.to_ := f_addPrefix(f_getResourceAddress());
mcaPort.send(m_request(v_request));
mcaPort.send(m_request(v_request));
//mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & c_acpAuxName})));
} else {
mcaPort.send(m_request(m_createAeAux()));
......@@ -108,28 +108,25 @@ module OneM2M_Functions {
}
//Added by @Naum
function f_preamble_prepareCSE(in template (value) AccessControlOperations p_allowedOperations := int63, in template ListOfM2MID p_allowedAEs) runs on M2M return integer{//c_CRUDNDi
function f_preamble_prepareCSE(in template ListOfM2MID p_allowedAEs, in template (value) AccessControlOperations p_allowedOperations := int63) runs on M2M return integer{//c_CRUDNDi
var integer v_aeAuxIndex := -1;
var M2MResponsePrimitive v_response;
var integer v_cseBaseAuxIndex := -1;
var integer v_acpAuxIndex := -1;
if(PX_ACP_SUPPORT){
v_acpAuxIndex := f_createAccessControlPolicyAux(p_allowedOperations := p_allowedOperations);
}
var ServiceSubscribedAppRule v_serviceSubscribedAppRule;
v_serviceSubscribedAppRule.applicableCredIDs := {"None"};
v_serviceSubscribedAppRule.allowedApp_IDs := {PX_APP_ID};
v_serviceSubscribedAppRule.allowedAEs := valueof(p_allowedAEs);
if(v_acpAuxIndex != -1) {
//TODO:Discuss this case
} else {
var ServiceSubscribedAppRule v_serviceSubscribedAppRule;
v_serviceSubscribedAppRule.applicableCredIDs := {"None"};
v_serviceSubscribedAppRule.allowedApp_IDs := {"APP-ID"};
v_serviceSubscribedAppRule.allowedAEs := valueof(p_allowedAEs);
mcaPort.send(m_request(m_createCSEBase(v_serviceSubscribedAppRule)));
}
mcaPort.send(m_request(m_createCSEBase(v_serviceSubscribedAppRule)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)){
[] mcaPort.receive(mw_response(int2001)) -> value v_response{
tc_ac.stop;
v_cseBaseAuxIndex := f_setResource(v_response.responsePrimitive_.primitiveContent);
vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_cseBaseAuxIndex};
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
......@@ -147,7 +144,7 @@ module OneM2M_Functions {
}
}
return v_aeAuxIndex;
return v_cseBaseAuxIndex;
}
......@@ -231,11 +228,11 @@ module OneM2M_Functions {
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, in template (omit) AccessControlOperations p_allowedOperations, template RequestPrimitive p_request, integer p_parentIndex) runs on M2M return RequestPrimitive {
p_request.from_ := f_getOriginator(p_parentIndex);
p_request.from_ := f_getOriginator(p_parentIndex);
p_request.to_ := f_addPrefix(f_getResourceAddress(p_parentIndex));
p_request.to_ := f_addPrefix(f_getResourceAddress(p_parentIndex));
//p_request.name := p_name;
//p_request.name := p_name;
if (p_resourceType == int1) {//AccessControlPolicy
......@@ -551,12 +548,12 @@ module OneM2M_Functions {
v_request.to_ := f_addPrefix(p_acpAddress);
v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := {
{
accessControlOriginators := PX_ACOR, //{"admin:admin"}
accessControlOperations := valueof(p_allowedOperations),
accessControlContexts_list := omit
}
};
{
accessControlOriginators := PX_ACOR, //{"admin:admin"}
accessControlOperations := valueof(p_allowedOperations),
accessControlContexts_list := omit
}
};
mcaPort.send(m_request(v_request));
tc_ac.start;
......
This diff is collapsed.
......@@ -57,8 +57,8 @@ module OneM2M_TestSystem {
/* Primitives */
type record M2MRequestPrimitive {
RequestPrimitive requestPrimitive_,
charstring host,
charstring xmlNamespace,
charstring host optional,
charstring xmlNamespace optional,
charstring protocolBinding optional,
charstring serialization optional,
AttributeList_1 nullFields optional
......@@ -68,6 +68,18 @@ module OneM2M_TestSystem {
ResponsePrimitive responsePrimitive_
}
type record M2MPrimitive {
union {
RequestPrimitive requestPrimitive_,
ResponsePrimitive responsePrimitive_
} primitive,
charstring host optional,
charstring xmlNamespace optional,
charstring protocolBinding optional,
charstring serialization optional,
AttributeList_1 nullFields optional
}
type record AcRequestPrimitive {
charstring event,
anytype data
......
This diff is collapsed.
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