Commit ec5adf9c2ab28ea719484128bf93cd4297839ab0

Authored by Abbas AHMAD
1 parent c0eea593

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

... ... @@ -4008,8 +4008,8 @@ module OneM2M_Functions {
4008 4008 v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex);
4009 4009 v_requestNotify.from_ := PX_CSE1_ID;
4010 4010 v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
4011   - v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw==");
4012   - v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
  4011 + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50IEhlbGxv");
  4012 + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
4013 4013 mccPort.send(m_request(v_requestNotify));
4014 4014  
4015 4015 tc_ac.start;
... ...
... ... @@ -1358,13 +1358,15 @@ module OneM2M_Templates {
1358 1358 * @desc SecurityInfo content
1359 1359 * @param p_securityInfoType security type integer
1360 1360 */
1361   - template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in XSD.Base64Binary p_escertkeMessage) := {
  1361 + template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in template (omit) XSD.Base64Binary p_escertkeMessage := omit, in template (omit) DynAuthDasRequest p_dasRequest:=omit ) := {
1362 1362 securityInfoType := p_securityInfoType,
1363 1363 dasRequest := *,
1364 1364 dasResponse := *,
1365 1365 esprimRandObject := *,
1366 1366 esprimObject := *,
1367 1367 escertkeMessage := p_escertkeMessage
  1368 +
  1369 + //dynAuthDasRequest
1368 1370 }
1369 1371  
1370 1372  
... ...
... ... @@ -13,6 +13,8 @@
13 13 */
14 14 module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
15 15  
  16 + import from LibCommon_BasicTypesAndValues all;
  17 +
16 18 import from OneM2M_TestSystem all;
17 19 import from OneM2M_Templates all;
18 20 import from OneM2M_Types all;//{type XSD.ID};
... ... @@ -77,8 +79,74 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
77 79  
78 80 }//end group oneM2M_demos
79 81  
  82 + group AE {
  83 +
  84 + group ESCertKE {
  85 +
  86 + }
  87 +
  88 + }
  89 +
80 90 group CSE {
81 91  
  92 + group DAS {
  93 +
  94 + testcase TC_CSE_DAS_BV_001() runs on AeSimu system CseSystem {
  95 +
  96 + var MsgIn v_response;
  97 + var RequestPrimitive v_requestRetrive;
  98 + var PrimitiveContent v_primitiveContentResponse;
  99 + var integer v_ae1Index, v_contIndex, v_auxAcpIndex;
  100 + var DynAuthDasRequest v_dasRequest;
  101 +
  102 + //Test component configuration
  103 + f_cf01Up();
  104 +
  105 + //Preamble (initial conditions)
  106 + v_auxAcpIndex := f_cse_preamble_createAcpAux( - , int61);
  107 + v_ae1Index := f_cse_preamble_registerAe();
  108 + v_contIndex := f_cse_createResource_withAcpAux(int3, m_createContainerBase, v_ae1Index);
  109 + //TODO => ? and the IUT having registered at least one DAS AE
  110 +
  111 + //TestBody
  112 + v_requestRetrive.to_ := f_getResourceAddress(v_contIndex);
  113 + v_requestRetrive.from_ := f_getOriginator(v_ae1Index);
  114 +
  115 + v_primitiveContentResponse.responsePrimitive.to_ := f_getResourceAddress(v_contIndex);
  116 + v_primitiveContentResponse.responsePrimitive.from_ := f_getOriginator(v_ae1Index);
  117 +
  118 + v_dasRequest.originator := f_getOriginator(v_ae1Index);
  119 + v_dasRequest.targetedResourceType := int3;
  120 + v_dasRequest.operation := int2;
  121 + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int1, - , v_dasRequest);
  122 +
  123 + mcaPort.send(m_request(v_requestRetrive));
  124 +
  125 + tc_ac.start;
  126 + alt {
  127 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response {
  128 + tc_ac.stop;
  129 + setverdict(pass, __SCOPE__ & ": DAS Request received successfully");
  130 + }
  131 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
  132 + tc_ac.stop;
  133 + setverdict(fail, __SCOPE__ & ": Wrong SecurityInfo (securityInfoType ¦¦ dasRequest ) Message received");
  134 + }
  135 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
  136 + tc_ac.stop;
  137 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  138 + }
  139 + [] tc_ac.timeout {
  140 + setverdict(inconc, __SCOPE__& ":INFO: Timeout while awaiting the reception of a message");
  141 + }
  142 + }
  143 +
  144 + f_cse_postamble_deleteResources();
  145 + f_cf01Down();
  146 + }
  147 + }
  148 +
  149 +
82 150 group ESCertKE {
83 151  
84 152 testcase TC_CSE_ESC_BV_001() runs on CseSimu system CseSystem {
... ... @@ -100,9 +168,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
100 168 v_requestNotify.from_ := PX_CSE1_ID;
101 169 v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
102 170  
103   - //TODO Base 64 representation of message ?
104   - v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("ClientHello");
105   - v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone"));
  171 + //Base 64 representation of message (https://www.base64encode.org/) ? ClientHello
  172 + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50SGVsbG8=");
  173 + //msg ? ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone
  174 + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
106 175  
107 176 mccPort.send(m_request(v_requestNotify));
108 177 tc_ac.start;
... ... @@ -128,8 +197,6 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
128 197 f_cf02DownCseSimuMaster();
129 198 }
130 199  
131   -
132   -
133 200 testcase TC_CSE_ESC_BV_002() runs on CseSimu system CseSystem {
134 201 var MsgIn v_response;
135 202 var RequestPrimitive v_requestNotify;
... ... @@ -150,9 +217,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
150 217 v_requestNotify.from_ := PX_CSE1_ID;
151 218 v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
152 219  
153   - //TODO Base 64 representation of message ?
154   - v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished");
155   - v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("[ChangeCipherSpec], Finished"));
  220 + //TODO Base 64 representation of message ? Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished
  221 + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2VydGlmaWNhdGUqLCBDbGllbnRLZXlFeGNoYW5nZSwgQ2VydGlmaWNhdGVWZXJpZnkqLCBbQ2hhbmdlQ2lwaGVyU3BlY10sIEZpbmlzaGVk");
  222 + // Msg: ? [ChangeCipherSpec], Finished
  223 + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("W0NoYW5nZUNpcGhlclNwZWNdLCBGaW5pc2hlZA=="));
156 224 mccPort.send(m_request(v_requestNotify));
157 225 tc_ac.start;
158 226 alt {
... ...