Commit 08c3f3c24a04ce341334b9df57fe3e941c7bfdc1

Authored by Miguel Angel Reina Ortega
1 parent 7e20e7aa

oneM2M Interop event#3 output: Check points added to all test cases

Signed-off-by: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author ETSI
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
10   - * $Id: OneM2M_Functions.ttcn 218 2017-02-07 09:36:53Z carres $
  10 + * $Id: OneM2M_Functions.ttcn 224 2017-02-10 10:40:40Z reinaortega $
11 11 * @desc Module containing functions for oneM2M
12 12 *
13 13 */
... ... @@ -25,13 +25,15 @@ module OneM2M_Functions {
25 25  
26 26  
27 27 group ConfigFunctions {
  28 +
28 29 /**
29 30 @desc Ports mapping and default behaviour activation for Config 1
30 31 */
31 32 function f_cf01Up() runs on CseTester {
32 33  
33 34 // Variables
34   -
  35 + vc_config := e_cf01;
  36 +
35 37 // Map
36 38 map(self:mcaPort, system:mcaPort);
37 39 map(self:acPort, system:acPort);
... ... @@ -39,7 +41,7 @@ module OneM2M_Functions {
39 41 activate(a_cse_cf01());
40 42  
41 43 // Connect
42   -
  44 +
43 45 //Initialze the IUT
44 46  
45 47 } // end f_cf01Up
... ... @@ -47,6 +49,7 @@ module OneM2M_Functions {
47 49 function f_cf02Up() runs on CseTester {
48 50  
49 51 // Variables
  52 + vc_config := e_cf02;
50 53  
51 54 // Map
52 55 map(self:mcaPort, system:mcaPort);
... ... @@ -56,7 +59,7 @@ module OneM2M_Functions {
56 59 activate(a_cse_cf02());
57 60  
58 61 // Connect
59   -
  62 +
60 63 //Initialze the IUT
61 64  
62 65 } // end f_cf02Up
... ... @@ -67,7 +70,8 @@ module OneM2M_Functions {
67 70 function f_cf03Up() runs on AeTester {
68 71  
69 72 // Variables
70   -
  73 + vc_config := e_cf03;
  74 +
71 75 // Map
72 76 map(self:mcaPort, system:mcaPort);
73 77 map(self:acPort, system:acPort);
... ... @@ -81,14 +85,27 @@ module OneM2M_Functions {
81 85 } // end f_cf03Up
82 86  
83 87 /**
84   - * @desc Ports unmapping for Config 03
  88 + * @desc Ports unmapping
  89 + * @verdict
85 90 */
86   - function f_cf03Down() runs on AeTester {
87   -
88   - unmap(self:mcaPort, system:mcaPort);
89   - unmap(self:acPort, system:acPort);
  91 + function f_cfCseTesterDown() runs on CseTester {
  92 +
  93 + if(vc_config == e_cf01) {
  94 + f_cf01Down()
  95 + } else if (vc_config == e_cf02){
  96 + f_cf02Down()
  97 + }
90 98 }
91   -
  99 + /**
  100 + * @desc Ports unmapping
  101 + * @verdict
  102 + */
  103 + function f_cfAeTesterDown() runs on AeTester {
  104 +
  105 + if(vc_config == e_cf03) {
  106 + f_cf03Down()
  107 + }
  108 + }
92 109 /**
93 110 * @desc Ports unmapping
94 111 * @verdict
... ... @@ -97,16 +114,28 @@ module OneM2M_Functions {
97 114  
98 115 unmap(self:mcaPort, system:mcaPort);
99 116 unmap(self:acPort, system:acPort);
100   - //stop;
  117 + stop;
101 118 }
102   -
  119 + /**
  120 + * @desc Ports unmapping
  121 + * @verdict
  122 + */
103 123 function f_cf02Down() runs on CseTester {
104 124  
105 125 unmap(self:mcaPort, system:mcaPort);
106 126 unmap(self:mccPort, system:mccPort);
107 127 unmap(self:acPort, system:acPort);
108   - //stop;
  128 + stop;
109 129 }
  130 + /**
  131 + * @desc Ports unmapping for Config 03
  132 + */
  133 + function f_cf03Down() runs on AeTester {
  134 +
  135 + unmap(self:mcaPort, system:mcaPort);
  136 + unmap(self:acPort, system:acPort);
  137 + stop;
  138 + }
110 139  
111 140 }//end group configFunctions
112 141  
... ... @@ -180,6 +209,7 @@ module OneM2M_Functions {
180 209 }
181 210 }
182 211  
  212 + f_checkCseTesterStatus();
183 213 return v_aeAuxIndex;
184 214  
185 215 }
... ... @@ -249,6 +279,7 @@ module OneM2M_Functions {
249 279 }
250 280 }
251 281  
  282 + f_checkCseTesterStatus();
252 283 return v_aeAuxIndex;
253 284  
254 285 }
... ... @@ -296,11 +327,12 @@ module OneM2M_Functions {
296 327  
297 328 v_request := valueof(m_deleteRequest(v_resourceAddress));
298 329  
299   - if(PX_FROM_IS_AE_ID){
300   - if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) {
301   - v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID;
302   - }
303   - }
  330 + //Not needed any longer: PX_SUPER_USER should be able to do all operations
  331 +// if(PX_FROM_IS_AE_ID){
  332 +// if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) {
  333 +// v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID;
  334 +// }
  335 +// }
304 336  
305 337 f_cse_deleteResource(v_request);
306 338  
... ... @@ -376,6 +408,8 @@ module OneM2M_Functions {
376 408 }
377 409 }
378 410  
  411 + f_checkCseTesterStatus();
  412 +
379 413 return v_resourceIndex;
380 414  
381 415 }
... ... @@ -419,6 +453,8 @@ module OneM2M_Functions {
419 453 setverdict(inconc, "f_createAccessControlPolicy: No answer while creating resource type " & int2str(1));
420 454 }
421 455 }
  456 +
  457 + f_checkCseTesterStatus();
422 458  
423 459 return v_acpAuxIndex;
424 460  
... ... @@ -476,6 +512,9 @@ module OneM2M_Functions {
476 512 setverdict(inconc, testcasename() & ": No answer while updating resource");
477 513 }
478 514 }
  515 +
  516 + f_checkCseTesterStatus();
  517 +
479 518 }// end f_cse_updateResource
480 519  
481 520 /**
... ... @@ -542,6 +581,8 @@ module OneM2M_Functions {
542 581 setverdict(inconc, "f_updateAcpAuxResource: No answer while updating " & v_request.to_ & " resource" );
543 582 }
544 583 }
  584 +
  585 + f_checkCseTesterStatus();
545 586 }
546 587  
547 588 function f_subscriptionVerificationHandler(in XSD.ID p_creator, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester {
... ... @@ -803,7 +844,9 @@ module OneM2M_Functions {
803 844 setverdict(inconc, testcasename() & ": AE registration request not received");
804 845 stop;
805 846 }
806   - }
  847 + }
  848 +
  849 + f_checkAeTesterStatus();
807 850  
808 851 return v_resourceIndex;
809 852 }
... ... @@ -1281,6 +1324,38 @@ module OneM2M_Functions {
1281 1324  
1282 1325 group CommonFunctions {
1283 1326  
  1327 +
  1328 +
  1329 + /**
  1330 + * @desc Sending of an Adapter Control primitive
  1331 + * @param event Action to be performed by TA
  1332 + * @param data Corresponding information for the correct execution of the given action
  1333 + * @verdict
  1334 + */
  1335 + function f_checkCseTesterStatus() runs on CseTester {
  1336 +
  1337 + if (getverdict != pass) {
  1338 + f_cse_postamble_deleteResources();
  1339 + // Tear down
  1340 + f_cfCseTesterDown();
  1341 + }
  1342 + }
  1343 +
  1344 + /**
  1345 + * @desc Sending of an Adapter Control primitive
  1346 + * @param event Action to be performed by TA
  1347 + * @param data Corresponding information for the correct execution of the given action
  1348 + * @verdict
  1349 + */
  1350 + function f_checkAeTesterStatus() runs on AeTester {
  1351 +
  1352 + if (getverdict != pass) {
  1353 + //f_ae_postamble_deleteResources();
  1354 + // Tear down
  1355 + f_cfAeTesterDown();
  1356 + }
  1357 + }
  1358 +
1284 1359 /**
1285 1360 * @desc Sending of an Adapter Control primitive
1286 1361 * @param event Action to be performed by TA
... ...
... ... @@ -7,13 +7,14 @@
7 7 *
8 8 * @author ETSI
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $
10   - * $Id: OneM2M_TestSystem.ttcn 202 2016-12-15 15:08:33Z reinaortega $
  10 + * $Id: OneM2M_TestSystem.ttcn 224 2017-02-10 10:40:40Z reinaortega $
11 11 * @desc Test System module for oneM2M
12 12 *
13 13 */
14 14 module OneM2M_TestSystem {
15 15  
16 16 import from OneM2M_Types all;
  17 + import from OneM2M_TypesAndValues all;
17 18 import from LibCommon_Time {modulepar all};
18 19  
19 20 /* Ports */
... ... @@ -44,6 +45,7 @@ module OneM2M_TestSystem {
44 45 timer tc_ac := PX_TAC;
45 46 timer tc_wait;
46 47 //global variables
  48 + var Configurations vc_config;
47 49 var MyResourcesList vc_resourcesList;
48 50 var IntegerList vc_resourcesIndexToBeDeleted := {};
49 51 }
... ...
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author ETSI
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $
10   - * $Id: OneM2M_TypesAndValues.ttcn 147 2016-10-25 07:52:22Z carres $
  10 + * $Id: OneM2M_TypesAndValues.ttcn 224 2017-02-10 10:40:40Z reinaortega $
11 11 * @desc Module containing types and values for oneM2M
12 12 *
13 13 */
... ... @@ -92,5 +92,11 @@ module OneM2M_TypesAndValues {
92 92 type NhURI ParentID;
93 93 type record length(0 .. infinity) of RequestPrimitive RequestPrimitiveList;
94 94 type record length(1 .. infinity) of RequestPrimitiveList RequestPrimitiveMatrix;
  95 +
  96 + type enumerated Configurations {
  97 + e_cf01,
  98 + e_cf02,
  99 + e_cf03
  100 + }
95 101 }
96 102 // end of module
... ...
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author ETSI
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
10   - * $Id: OneM2M_Testcases.ttcn 218 2017-02-07 09:36:53Z carres $
  10 + * $Id: OneM2M_Testcases.ttcn 224 2017-02-10 10:40:40Z reinaortega $
11 11 * @desc Module containing test cases for oneM2M
12 12 *
13 13 */
... ... @@ -127,9 +127,9 @@ module OneM2M_Testcases {
127 127 // Test component configuration
128 128 f_cf01Up();
129 129  
130   - //Preambule
  130 + //Preamble
131 131 v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi);
132   -
  132 +
133 133 //Test Body
134 134 v_request := valueof(m_createAe(PX_APP_ID, omit, omit));
135 135  
... ... @@ -4113,6 +4113,10 @@ module OneM2M_Testcases {
4113 4113 p_createRequestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};
4114 4114 } else {
4115 4115 f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});
  4116 + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2};
  4117 + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
  4118 + v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest);
  4119 + f_cse_updateResource(v_updateRequest);
4116 4120 }
4117 4121  
4118 4122 //Creation of resource
... ... @@ -7050,6 +7054,7 @@ module OneM2M_Testcases {
7050 7054  
7051 7055 v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex);
7052 7056  
  7057 + // Test Body
7053 7058 mcaPort.send(m_request(v_request));
7054 7059 tc_ac.start;
7055 7060 alt {
... ... @@ -7103,7 +7108,8 @@ module OneM2M_Testcases {
7103 7108 v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance
7104 7109  
7105 7110 v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex);
7106   -
  7111 +
  7112 + // Test Body
7107 7113 mcaPort.send(m_request(v_request));
7108 7114 tc_ac.start;
7109 7115 alt {
... ... @@ -7161,7 +7167,8 @@ module OneM2M_Testcases {
7161 7167 v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
7162 7168  
7163 7169 v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription
7164   -
  7170 +
  7171 + // Test Body
7165 7172 mcaPort.send(m_request(v_request));
7166 7173 tc_ac.start;
7167 7174 alt {
... ... @@ -7214,7 +7221,7 @@ module OneM2M_Testcases {
7214 7221 v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription
7215 7222 //v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {"Not Initialized"};
7216 7223  
7217   -
  7224 + // Test Body
7218 7225 mcaPort.send(m_request(v_request));
7219 7226 tc_ac.start;
7220 7227 alt {
... ... @@ -7271,7 +7278,8 @@ module OneM2M_Testcases {
7271 7278 v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)};
7272 7279  
7273 7280 notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int4101));
7274   -
  7281 +
  7282 + // Test Body
7275 7283 mcaPort.send(m_request(v_request));
7276 7284  
7277 7285 tc_ac.start;
... ... @@ -7329,7 +7337,8 @@ module OneM2M_Testcases {
7329 7337 v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)};
7330 7338  
7331 7339 notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int5205));
7332   -
  7340 +
  7341 + // Test Body
7333 7342 mcaPort.send(m_request(v_request));
7334 7343  
7335 7344 tc_ac.start;
... ...