Commit 40575462 authored by Naum Spaseski's avatar Naum Spaseski
Browse files

Corrected function f_prepareCSE and added new configuration function f_cf02Up

parent 382fa8ba
......@@ -33,7 +33,6 @@ module OneM2M_Functions {
// Map
map(self:mcaPort, system:mcaPort);
map(self:mccPort, system:mccPort);
map(self:acPort, system:acPort);
activate(a_default());
......@@ -42,6 +41,22 @@ module OneM2M_Functions {
//Initialze the IUT
} // end f_cf01Up
function f_cf02Up() runs on M2M {
// Variables
// Map
map(self:mcaPort, system:mcaPort);
map(self:mccPort, system:mccPort);
map(self:acPort, system:acPort);
activate(a_default());
// Connect
//Initialze the IUT
} // end f_cf02Up
}//end group configFunctions
......@@ -113,37 +128,9 @@ module OneM2M_Functions {
var M2MResponsePrimitive v_response;
var integer v_cseBaseAuxIndex := -1;
var integer v_acpAuxIndex := -1;
var ServiceSubscribedAppRule_optional v_serviceSubscribedAppRule;
var RequestPrimitive v_request;
v_serviceSubscribedAppRule.applicableCredIDs := {"None"};
v_serviceSubscribedAppRule.allowedApp_IDs := {PX_APP_ID};
v_serviceSubscribedAppRule.allowedAEs := valueof(p_allowedAEs);
mcaPort.send(m_request(m_createServiceSubscribedAppRule(v_serviceSubscribedAppRule)));
tc_ac.start;
alt {
[] 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;
setverdict(inconc, "Preamble: Error while registering application");
stop;
}
[] mcaPort.receive {
tc_ac.stop;
setverdict(inconc, "Preamble: Unexpected message received");
stop;
}
[] tc_ac.timeout {
setverdict(inconc, "Preamble: No answer while registering resource");
stop;
}
}
v_cseBaseAuxIndex := f_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {PX_APP_ID}, valueof(p_allowedAEs)));
return v_cseBaseAuxIndex;
......@@ -198,6 +185,13 @@ module OneM2M_Functions {
function f_postamble_default() runs on M2M {
unmap(self:mcaPort, system:mcaPort);
unmap(self:acPort, system:acPort);
//stop;
}
function f_postamble_CF02() runs on M2M {
unmap(self:mcaPort, system:mcaPort);
unmap(self:mccPort, system:mccPort);
unmap(self:acPort, system:acPort);
......
......@@ -787,14 +787,14 @@ module OneM2M_Templates {
};
//Added by @Naum
template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ServiceSubscribedAppRule_optional p_serviceSubscribedAppRule) := {
template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedApp_IDs, in ListOfM2MID p_allowedAEs) := {
operation := int1,
to_ := "NotInitialized",
from_ := PX_AE_ID_STEM,
requestIdentifier := "m_createCSE" & f_rnd(1, 1000000),
resourceType := int1,
primitiveContent := {
any_1 := {{ServiceSubscribedAppRule_optional := m_contentCreateServiceSubscribedAppRule (p_serviceSubscribedAppRule)}}
any_1 := {{ServiceSubscribedAppRule_optional := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedApp_IDs, p_allowedAEs)}}
},
role := omit,
originatingTimestamp := omit,
......@@ -1071,7 +1071,7 @@ module OneM2M_Templates {
choice := omit//NP
};
template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in template (value) ServiceSubscribedAppRule_optional serviceSubscribedAppRule := omit) := {
template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedApp_IDs, in ListOfM2MID p_allowedAEs) := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
......@@ -1081,9 +1081,9 @@ module OneM2M_Templates {
labels := omit,
accessControlPolicyIDs := omit,
expirationTime := omit,
applicableCredIDs := serviceSubscribedAppRule.applicableCredIDs,
allowedApp_IDs := serviceSubscribedAppRule.allowedApp_IDs,
allowedAEs := serviceSubscribedAppRule.allowedAEs,
applicableCredIDs := p_applicableCredIDs,
allowedApp_IDs := p_allowedApp_IDs,
allowedAEs := p_allowedAEs,
choice := omit
}
......
......@@ -118,7 +118,7 @@ module OneM2M_Testcases {
// Test component configuration
f_cf01Up();
//Preambule
v_cseBaseIndex := f_preamble_prepareCSE({"C-AE-ID-STEM"});//c_CRUDNDi);
......@@ -274,7 +274,7 @@ module OneM2M_Testcases {
var ResourceType v_resourceType := int2;
// Test component configuration
f_cf01Up();
f_cf02Up();
//Preambule
v_cseBaseIndex := f_preamble_prepareCSE({"S"});//c_CRUDNDi);
......
......@@ -4558,5 +4558,5 @@ with {
encode "XML";
variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
extension "anytype charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, ContentInstance_update_invalid, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid"
extension "anytype ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, ContentInstance_update_invalid, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid"
}
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