Skip to content
Snippets Groups Projects
Commit ec5adf9c authored by abbas ahmad's avatar abbas ahmad
Browse files

Implemented 1 DAS TC. Made corrections on message representation in ESC TC's.

parent c0eea593
No related tags found
No related merge requests found
...@@ -4008,8 +4008,8 @@ module OneM2M_Functions { ...@@ -4008,8 +4008,8 @@ module OneM2M_Functions {
v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex); v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex);
v_requestNotify.from_ := PX_CSE1_ID; v_requestNotify.from_ := PX_CSE1_ID;
v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)}; v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw=="); v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50IEhlbGxv");
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU=")); v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
mccPort.send(m_request(v_requestNotify)); mccPort.send(m_request(v_requestNotify));
tc_ac.start; tc_ac.start;
......
...@@ -1358,13 +1358,15 @@ module OneM2M_Templates { ...@@ -1358,13 +1358,15 @@ module OneM2M_Templates {
* @desc SecurityInfo content * @desc SecurityInfo content
* @param p_securityInfoType security type integer * @param p_securityInfoType security type integer
*/ */
template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in XSD.Base64Binary p_escertkeMessage) := { template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in template (omit) XSD.Base64Binary p_escertkeMessage := omit, in template (omit) DynAuthDasRequest p_dasRequest:=omit ) := {
securityInfoType := p_securityInfoType, securityInfoType := p_securityInfoType,
dasRequest := *, dasRequest := *,
dasResponse := *, dasResponse := *,
esprimRandObject := *, esprimRandObject := *,
esprimObject := *, esprimObject := *,
escertkeMessage := p_escertkeMessage escertkeMessage := p_escertkeMessage
//dynAuthDasRequest
} }
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
*/ */
module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
import from LibCommon_BasicTypesAndValues all;
import from OneM2M_TestSystem all; import from OneM2M_TestSystem all;
import from OneM2M_Templates all; import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID}; import from OneM2M_Types all;//{type XSD.ID};
...@@ -77,8 +79,74 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { ...@@ -77,8 +79,74 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
}//end group oneM2M_demos }//end group oneM2M_demos
group AE {
group ESCertKE {
}
}
group CSE { group CSE {
group DAS {
testcase TC_CSE_DAS_BV_001() runs on AeSimu system CseSystem {
var MsgIn v_response;
var RequestPrimitive v_requestRetrive;
var PrimitiveContent v_primitiveContentResponse;
var integer v_ae1Index, v_contIndex, v_auxAcpIndex;
var DynAuthDasRequest v_dasRequest;
//Test component configuration
f_cf01Up();
//Preamble (initial conditions)
v_auxAcpIndex := f_cse_preamble_createAcpAux( - , int61);
v_ae1Index := f_cse_preamble_registerAe();
v_contIndex := f_cse_createResource_withAcpAux(int3, m_createContainerBase, v_ae1Index);
//TODO => ? and the IUT having registered at least one DAS AE
//TestBody
v_requestRetrive.to_ := f_getResourceAddress(v_contIndex);
v_requestRetrive.from_ := f_getOriginator(v_ae1Index);
v_primitiveContentResponse.responsePrimitive.to_ := f_getResourceAddress(v_contIndex);
v_primitiveContentResponse.responsePrimitive.from_ := f_getOriginator(v_ae1Index);
v_dasRequest.originator := f_getOriginator(v_ae1Index);
v_dasRequest.targetedResourceType := int3;
v_dasRequest.operation := int2;
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int1, - , v_dasRequest);
mcaPort.send(m_request(v_requestRetrive));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": DAS Request received successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong SecurityInfo (securityInfoType ¦¦ dasRequest ) Message received");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__& ":INFO: Timeout while awaiting the reception of a message");
}
}
f_cse_postamble_deleteResources();
f_cf01Down();
}
}
group ESCertKE { group ESCertKE {
testcase TC_CSE_ESC_BV_001() runs on CseSimu system CseSystem { testcase TC_CSE_ESC_BV_001() runs on CseSimu system CseSystem {
...@@ -100,9 +168,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { ...@@ -100,9 +168,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
v_requestNotify.from_ := PX_CSE1_ID; v_requestNotify.from_ := PX_CSE1_ID;
v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)}; v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
//TODO Base 64 representation of message ? //Base 64 representation of message (https://www.base64encode.org/) ? ClientHello
v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("ClientHello"); v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50SGVsbG8=");
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone")); //msg ? ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
mccPort.send(m_request(v_requestNotify)); mccPort.send(m_request(v_requestNotify));
tc_ac.start; tc_ac.start;
...@@ -128,8 +197,6 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { ...@@ -128,8 +197,6 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
f_cf02DownCseSimuMaster(); f_cf02DownCseSimuMaster();
} }
testcase TC_CSE_ESC_BV_002() runs on CseSimu system CseSystem { testcase TC_CSE_ESC_BV_002() runs on CseSimu system CseSystem {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_requestNotify; var RequestPrimitive v_requestNotify;
...@@ -150,9 +217,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { ...@@ -150,9 +217,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
v_requestNotify.from_ := PX_CSE1_ID; v_requestNotify.from_ := PX_CSE1_ID;
v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)}; v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
//TODO Base 64 representation of message ? //TODO Base 64 representation of message ? Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished
v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished"); v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2VydGlmaWNhdGUqLCBDbGllbnRLZXlFeGNoYW5nZSwgQ2VydGlmaWNhdGVWZXJpZnkqLCBbQ2hhbmdlQ2lwaGVyU3BlY10sIEZpbmlzaGVk");
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("[ChangeCipherSpec], Finished")); // Msg: ? [ChangeCipherSpec], Finished
v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("W0NoYW5nZUNpcGhlclNwZWNdLCBGaW5pc2hlZA=="));
mccPort.send(m_request(v_requestNotify)); mccPort.send(m_request(v_requestNotify));
tc_ac.start; tc_ac.start;
alt { alt {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment