source: trunk/ETSI-Testsuites/ETSI_auto_IOT/adapter/validation/TestExecution.ttcn @ 55

Last change on this file since 55 was 22, checked in by rings, 14 years ago
  • Property svn:executable set to *
File size: 32.4 KB
Line 
1module TestExecution {
2
3  import from LibIot_TestInterface {type IotEquipmentUser;}
4  import from LibIot_TypesAndValues {type SetFilterReq, SetFilterRsp;}
5
6  import from LibIot_TestConfiguration {
7    function f_cf_create_IotEquipmentUser;
8  }
9
10  import from AtsImsIot_TestConfiguration {
11    function
12      f_cf_create_monitor,
13      f_cf_monitor_down,
14      f_cf_monitor_up,
15      f_cf_user_down,
16      f_cf_user_up,
17      f_cf_adapter_up,
18      f_cf_adapter_down;
19  }
20
21  import from AtsImsIot_TestSystem {
22    type ImsInterfaceMonitor, ImsTestCoordinator, IotSystemInterface;
23  }
24
25  import from LibIms_UpperTester {type ImsUserInfo;}
26
27  import from AtsImsIot_Functions {function all;}
28
29  import from LibIot_TypesAndValues {const all type StartTrafficCaptureRsp, StopTrafficCaptureRsp; }
30
31  import from LibIot_PIXITS all;
32
33  import from AtsImsIot_Templates all;
34
35  import from LibSip_SIPTypesAndValues {type Request, Response;}
36
37  template Request mw_request := ?;
38  template Response mw_response := ?;
39 
40  group constantDefinitions {
41    //* interface monitor name Gm A
42    const charstring c_gm_A := "Gm A";
43    //* interface monitor name Gm B
44    const charstring c_gm_B := "Gm B";
45    //* interface monitor name Mw
46    const charstring c_mw := "Mw";
47    //* interface monitor name Isc A
48    const charstring c_isc_A := "Isc A";
49    //* interface monitor name Isc B
50    const charstring c_isc_B := "Isc B";
51    //* eut trigger name User A
52    const charstring c_userUE_A := "User A";
53    //* eut trigger name User B
54    const charstring c_userUE_B := "User B";
55    const charstring c_userUE_B2 := "User B2";
56  }
57
58function f_monitor(template SetFilterReq p_filter) runs on ImsInterfaceMonitor {
59 
60    var SetFilterRsp setFilterRsp;
61    timer tc_configureGuard;
62 
63  acPort.send(p_filter);     
64  tc_configureGuard.start(PX_MAX_MSG_WAIT);
65  alt {
66    [] acPort.receive (m_setFilterRspAny) -> value setFilterRsp {
67      if (setFilterRsp.status.code != e_success) {
68        log("**** f_monitor: SetFilterReq unsuccessfull! ****");
69            setverdict(fail);
70            stop;
71          }   
72    }
73    [] tc_configureGuard.timeout {
74        log("**** f_monitor: SetFilterReq not answered. ****");
75          setverdict (inconc);
76          stop;
77      }
78    }   
79
80  // Receive loop   
81   alt {
82     [] dPort.receive (mw_request) {
83        log(self, "Received request");
84          repeat;
85     }
86     [] dPort.receive (mw_response) {
87        log(self, "Received response");
88          repeat;
89     }
90     [] dPort.receive {
91        log(self, "Received default");
92          repeat;
93     }
94   }     
95}
96
97  testcase TC_GeneralConfigurationMessageOffLineMode() runs on ImsTestCoordinator system IotSystemInterface {
98
99    timer tc_configureGuard;
100   
101    // map/connect component ports
102    f_cf_adapter_up();
103   
104    // preamble
105    tc_configureGuard.start(PX_MAX_MSG_WAIT);
106    acPort.send(m_generalConfigurationReq_offline);
107    alt {
108      [] acPort.receive (m_generalConfigurationRsp_success) {
109        log("General configuration succeed.");
110        tc_configureGuard.stop;
111        setverdict(pass);
112      }
113      [] acPort.receive (m_generalConfigurationRsp_timeout) {
114        setverdict(fail);
115        tc_configureGuard.stop;
116        stop;
117      }
118      [] acPort.receive (m_generalConfigurationRsp_error) {
119        setverdict(fail);
120        tc_configureGuard.stop;
121        stop;
122      }
123      [] acPort.receive {
124        log("Unknown response.");
125        tc_configureGuard.stop;
126        setverdict (inconc);
127        stop;
128      }
129      [] tc_configureGuard.timeout {
130        log("Timeout.");
131        setverdict (inconc);
132        stop;
133      }
134    }
135    log("Preamble done.");
136   
137    // test body
138    log("Test body done.");
139
140    // postamble
141    log("Postamble done.");
142
143    f_cf_adapter_down();
144 }
145
146  testcase TC_GeneralConfigurationMessageOnLineMode() runs on ImsTestCoordinator system IotSystemInterface {
147    // create components
148    timer tc_configureGuard;
149   
150    // map/connect component ports
151    f_cf_adapter_up();
152   
153    // preamble
154    tc_configureGuard.start(PX_MAX_MSG_WAIT);
155    acPort.send(m_generalConfigurationReq_online);
156    alt {
157      [] acPort.receive (m_generalConfigurationRsp_success) {
158        log("General configuration succeed.");
159        tc_configureGuard.stop;
160        setverdict(pass);
161      }
162      [] acPort.receive (m_generalConfigurationRsp_timeout) {
163        setverdict(fail);
164        tc_configureGuard.stop;
165        stop;
166      }
167      [] acPort.receive (m_generalConfigurationRsp_error) {
168        setverdict(fail);
169        tc_configureGuard.stop;
170        stop;
171      }
172      [] acPort.receive {
173        log("Unknown response.");
174        tc_configureGuard.stop;
175        setverdict (inconc);
176        stop;
177      }
178      [] tc_configureGuard.timeout {
179        log("Timeout.");
180        setverdict (inconc);
181        stop;
182      }
183    }
184    log("Preamble done.");
185   
186    // test body
187    log("Test body done.");
188
189    // postamble
190    log("Postamble done.");
191
192    //unmap/disconnet component ports
193    f_cf_adapter_down();
194  }
195
196  testcase TC_GeneralConfigurationMessageMerge() runs on ImsTestCoordinator system IotSystemInterface {
197    // create components
198    timer tc_configureGuard;
199   
200    // map/connect component ports
201    f_cf_adapter_up();
202   
203    // preamble
204    tc_configureGuard.start(PX_MAX_MSG_WAIT);
205    acPort.send(m_generalConfigurationReq_merge);
206    alt {
207      [] acPort.receive (m_generalConfigurationRsp_success) {
208        log("General configuration succeed.");
209        tc_configureGuard.stop;
210        setverdict(pass);
211      }
212      [] acPort.receive (m_generalConfigurationRsp_timeout) {
213        setverdict(fail);
214        tc_configureGuard.stop;
215        stop;
216      }
217      [] acPort.receive (m_generalConfigurationRsp_error) {
218        setverdict(fail);
219        tc_configureGuard.stop;
220        stop;
221      }
222      [] acPort.receive {
223        log("Unknown response.");
224        tc_configureGuard.stop;
225        setverdict (inconc);
226        stop;
227      }
228      [] tc_configureGuard.timeout {
229        log("Timeout.");
230        setverdict (inconc);
231        stop;
232      }
233    }
234    log("Preamble done.");
235   
236    // test body
237    log("Test body done.");
238
239    // postamble
240    log("Postamble done.");
241
242    //unmap/disconnet component ports
243    f_cf_adapter_down();
244  }
245
246  testcase TC_TriggerUERegisterOffLineMode() runs on ImsTestCoordinator system IotSystemInterface {
247   
248    // create components
249    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
250    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
251    timer tc_configureGuard;
252   
253    // map/connect component ports
254    f_cf_adapter_up();
255    f_cf_user_up(v_ueA);
256    f_cf_user_up(v_ueB);
257   
258    // preamble
259    tc_configureGuard.start(PX_MAX_MSG_WAIT);
260    acPort.send(m_generalConfigurationReq_offline);
261    alt {
262      [] acPort.receive (m_generalConfigurationRsp_success) {
263        log("General configuration succeed.");
264        tc_configureGuard.stop;
265      }
266      [] acPort.receive (m_generalConfigurationRsp_timeout) {
267        setverdict(fail);
268        tc_configureGuard.stop;
269        stop;
270      }
271      [] acPort.receive (m_generalConfigurationRsp_error) {
272        setverdict(fail);
273        tc_configureGuard.stop;
274        stop;
275      }
276      [] acPort.receive {
277        log("Unknown response.");
278        tc_configureGuard.stop;
279        setverdict (inconc);
280        stop;
281      }
282      [] tc_configureGuard.timeout {
283        log("Timeout.");
284        setverdict (inconc);
285        stop;
286      }
287    }
288    log("Preamble done.");
289   
290    // test body
291    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
292    f_PR_user_home_registration(v_ueB, f_getAnyValidUser(PX_EUT_B));
293    //setverdict(pass);
294    log("Test body done.");
295
296    // postamble
297    log("Postamble done.");
298
299    //unmap/disconnet component ports
300    f_cf_user_down(v_ueA);
301    //f_cf_user_down(v_ueB);
302    f_cf_adapter_down();
303  }
304
305  testcase TC_TriggerOneUERegisterOnLineMode() runs on ImsTestCoordinator system IotSystemInterface {
306    // create components
307    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
308    timer tc_configureGuard;
309   
310    // map/connect component ports
311    f_cf_adapter_up();
312    f_cf_user_up(v_ueA);
313   
314    // preamble
315    tc_configureGuard.start(PX_MAX_MSG_WAIT);
316    acPort.send(m_generalConfigurationReq_online);
317    alt {
318      [] acPort.receive (m_generalConfigurationRsp_success) {
319        log("General configuration succeed.");
320        tc_configureGuard.stop;
321      }
322      [] acPort.receive (m_generalConfigurationRsp_timeout) {
323        setverdict(fail);
324        tc_configureGuard.stop;
325        stop;
326      }
327      [] acPort.receive (m_generalConfigurationRsp_error) {
328        setverdict(fail);
329        tc_configureGuard.stop;
330        stop;
331      }
332      [] acPort.receive {
333        log("Unknown response.");
334        tc_configureGuard.stop;
335        setverdict (inconc);
336        stop;
337      }
338      [] tc_configureGuard.timeout {
339        log("Timeout.");
340        setverdict (inconc);
341        stop;
342      }
343    }
344    log("Preamble done.");
345   
346    // test body
347    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
348    //setverdict(pass);
349    log("Test body done.");
350
351    // postamble
352    log("Postamble done.");
353
354    //unmap/disconnet component ports
355    f_cf_user_down(v_ueA);
356    f_cf_adapter_down();
357  }
358
359  testcase TC_TriggerTwoUERegisterOnLineMode() runs on ImsTestCoordinator system IotSystemInterface {
360    // create components
361    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
362    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
363    timer tc_configureGuard;
364   
365    // map/connect component ports
366    f_cf_adapter_up();
367    f_cf_user_up(v_ueA);
368    f_cf_user_up(v_ueB);
369   
370    // preamble
371    tc_configureGuard.start(PX_MAX_MSG_WAIT);
372    acPort.send(m_generalConfigurationReq_online);
373    alt {
374      [] acPort.receive (m_generalConfigurationRsp_success) {
375        log("General configuration succeed.");
376        tc_configureGuard.stop;
377      }
378      [] acPort.receive (m_generalConfigurationRsp_timeout) {
379        setverdict(fail);
380        tc_configureGuard.stop;
381        stop;
382      }
383      [] acPort.receive (m_generalConfigurationRsp_error) {
384        setverdict(fail);
385        tc_configureGuard.stop;
386        stop;
387      }
388      [] acPort.receive {
389        log("Unknown response.");
390        tc_configureGuard.stop;
391        setverdict (inconc);
392        stop;
393      }
394      [] tc_configureGuard.timeout {
395        log("Timeout.");
396        setverdict (inconc);
397        stop;
398      }
399    }
400    log("Preamble done.");
401   
402    // test body
403    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
404    f_PR_user_home_registration(v_ueB, f_getAnyValidUser(PX_EUT_B));
405    //setverdict(pass);
406    log("Test body done.");
407
408    // postamble
409    log("Postamble done.");
410
411    //unmap/disconnet component ports
412    f_cf_user_down(v_ueA);
413    f_cf_user_down(v_ueB);
414    f_cf_adapter_down();
415  }
416
417  testcase TC_TriggerUERegister3UsersOnLineMode() runs on ImsTestCoordinator system IotSystemInterface {
418    // create components
419    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
420    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
421    var IotEquipmentUser v_ueB2 := f_cf_create_IotEquipmentUser(c_userUE_B2);
422    timer tc_configureGuard;
423    timer tc_ac;
424   
425    // map/connect component ports
426    f_cf_adapter_up();
427    f_cf_user_up(v_ueA);
428    f_cf_user_up(v_ueB);
429   
430    // preamble
431    tc_configureGuard.start(PX_MAX_MSG_WAIT);
432    acPort.send(m_generalConfigurationReq_online);
433    alt {
434      [] acPort.receive (m_generalConfigurationRsp_success) {
435        log("General configuration succeed.");
436        tc_configureGuard.stop;
437      }
438      [] acPort.receive (m_generalConfigurationRsp_timeout) {
439        setverdict(fail);
440        tc_configureGuard.stop;
441        stop;
442      }
443      [] acPort.receive (m_generalConfigurationRsp_error) {
444        setverdict(fail);
445        tc_configureGuard.stop;
446        stop;
447      }
448      [] acPort.receive {
449        log("Unknown response.");
450        tc_configureGuard.stop;
451        setverdict (inconc);
452        stop;
453      }
454      [] tc_configureGuard.timeout {
455        log("Timeout.");
456        setverdict (inconc);
457        stop;
458      }
459    }
460    log("Preamble done.");
461   
462    // test body
463    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
464    f_PR_user_home_registration(v_ueB, f_getAnyValidUser(PX_EUT_B));
465    f_PR_user_home_registration(v_ueB2, f_getAnyValidUser(PX_EUT_B_B2));
466    // do-nothing loop
467    tc_ac.start(10.0);
468    tc_ac.timeout;
469    //setverdict(pass);
470    log("Test body done.");
471
472    // postamble
473    log("Postamble done.");
474
475    //unmap/disconnet component ports
476    f_cf_user_down(v_ueA);
477    f_cf_user_down(v_ueB);
478    f_cf_user_down(v_ueB2);
479    f_cf_adapter_down();
480  }
481
482  testcase TC_TriggerUEDeRegister() runs on ImsTestCoordinator system IotSystemInterface {
483    // create components
484    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
485    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
486    timer tc_configureGuard;
487    timer tc_ac;
488   
489    // map/connect component ports
490    f_cf_adapter_up();
491    f_cf_user_up(v_ueA);
492    f_cf_user_up(v_ueB);
493   
494    // preamble
495    tc_configureGuard.start(PX_MAX_MSG_WAIT);
496    acPort.send(m_generalConfigurationReq_online);
497    alt {
498      [] acPort.receive (m_generalConfigurationRsp_success) {
499        log("General configuration succeed.");
500        tc_configureGuard.stop;
501      }
502      [] acPort.receive (m_generalConfigurationRsp_timeout) {
503        setverdict(fail);
504        tc_configureGuard.stop;
505        stop;
506      }
507      [] acPort.receive (m_generalConfigurationRsp_error) {
508        setverdict(fail);
509        tc_configureGuard.stop;
510        stop;
511      }
512      [] acPort.receive {
513        log("Unknown response.");
514        tc_configureGuard.stop;
515        setverdict (inconc);
516        stop;
517      }
518      [] tc_configureGuard.timeout {
519        log("Timeout.");
520        setverdict (inconc);
521        stop;
522      }
523    }
524    log("Preamble done.");
525   
526    // test body
527    f_PO_user_home_deregistration(v_ueA);
528    f_PO_user_home_deregistration(v_ueB);
529    setverdict(pass);
530    log("Test body done.");
531
532    // postamble
533    log("Postamble done.");
534
535    //unmap/disconnet component ports
536    f_cf_user_down(v_ueA);
537    f_cf_user_down(v_ueB);
538    f_cf_adapter_down();
539  }
540
541  testcase TC_TriggerUERegisterUEDeRegister() runs on ImsTestCoordinator system IotSystemInterface {
542    // create components
543    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
544    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
545    timer tc_configureGuard;
546    timer tc_ac;
547   
548    // map/connect component ports
549    f_cf_adapter_up();
550    f_cf_user_up(v_ueA);
551    f_cf_user_up(v_ueB);
552   
553    // preamble
554    tc_configureGuard.start(PX_MAX_MSG_WAIT);
555    acPort.send(m_generalConfigurationReq_online);
556    alt {
557      [] acPort.receive (m_generalConfigurationRsp_success) {
558        log("General configuration succeed.");
559        tc_configureGuard.stop;
560      }
561      [] acPort.receive (m_generalConfigurationRsp_timeout) {
562        setverdict(fail);
563        tc_configureGuard.stop;
564        stop;
565      }
566      [] acPort.receive (m_generalConfigurationRsp_error) {
567        setverdict(fail);
568        tc_configureGuard.stop;
569        stop;
570      }
571      [] acPort.receive {
572        log("Unknown response.");
573        tc_configureGuard.stop;
574        setverdict (inconc);
575        stop;
576      }
577      [] tc_configureGuard.timeout {
578        log("Timeout.");
579        setverdict (inconc);
580        stop;
581      }
582    }
583    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
584    f_PR_user_home_registration(v_ueB, f_getAnyValidUser(PX_EUT_B));
585    log("Preamble done.");
586   
587    // test body
588    // do-nothing loop
589    tc_ac.start(10.0);
590    tc_ac.timeout; 
591    log("Test body done.");
592
593    // postamble
594    f_PO_user_home_deregistration(v_ueA);
595    f_PO_user_home_deregistration(v_ueB);
596    setverdict(pass);
597    log("Postamble done.");
598
599    //unmap/disconnet component ports
600    f_cf_user_down(v_ueA);
601    f_cf_user_down(v_ueB);
602    f_cf_adapter_down();
603  }
604
605  testcase TC_TriggerUERegisterOnLineModeWithoutEUTsSettings() runs on ImsTestCoordinator system IotSystemInterface {
606    // create components
607    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
608    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
609    timer tc_configureGuard;
610   
611    // map/connect component ports
612    f_cf_adapter_up();
613    f_cf_user_up(v_ueA);
614    f_cf_user_up(v_ueB);
615   
616    // preamble
617    tc_configureGuard.start(PX_MAX_MSG_WAIT);
618    acPort.send(m_generalConfigurationReq_onlinewithoutEUTs);
619    alt {
620      [] acPort.receive (m_generalConfigurationRsp_success) {
621        setverdict(fail);
622        tc_configureGuard.stop;
623        stop;
624      }
625      [] acPort.receive (m_generalConfigurationRsp_timeout) {
626        setverdict(fail);
627        tc_configureGuard.stop;
628        stop;
629      }
630      [] acPort.receive (m_generalConfigurationRsp_error) {
631        tc_configureGuard.stop;
632        setverdict(pass);
633      }
634      [] acPort.receive {
635        log("Unknown response.");
636        tc_configureGuard.stop;
637        setverdict (inconc);
638        stop;
639      }
640      [] tc_configureGuard.timeout {
641        log("Timeout.");
642        setverdict (inconc);
643        stop;
644      }
645    }
646    log("Preamble done.");
647   
648    // test body
649    log("Test body done.");
650
651    // postamble
652    log("Postamble done.");
653
654    //unmap/disconnet component ports
655    f_cf_user_down(v_ueA);
656    f_cf_user_down(v_ueB);
657    f_cf_adapter_down();
658  }
659
660  testcase TC_TriggerUERegisterOnLineModeBadEUTsInfo() runs on ImsTestCoordinator system IotSystemInterface {
661    // create components
662    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
663    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
664    timer tc_configureGuard;
665   
666    // map/connect component ports
667    f_cf_adapter_up();
668    f_cf_user_up(v_ueA);
669    f_cf_user_up(v_ueB);
670   
671    // preamble
672    tc_configureGuard.start(PX_MAX_MSG_WAIT);
673    acPort.send(m_generalConfigurationReq_onlinewithbadEUTs);
674    alt {
675      [] acPort.receive (m_generalConfigurationRsp_success) {
676        setverdict(fail);
677        tc_configureGuard.stop;
678        stop;
679      }
680      [] acPort.receive (m_generalConfigurationRsp_timeout) {
681        setverdict(fail);
682        tc_configureGuard.stop;
683        stop;
684      }
685      [] acPort.receive (m_generalConfigurationRsp_error) {
686        setverdict(pass);
687        tc_configureGuard.stop;
688      }
689      [] acPort.receive {
690        tc_configureGuard.stop;
691        setverdict (inconc);
692        stop;
693      }
694      [] tc_configureGuard.timeout {
695        setverdict (inconc);
696        stop;
697      }
698    }
699    log("Preamble done.");
700   
701    // test body
702    log("Test body done.");
703
704    // postamble
705    log("Postamble done.");
706
707    //unmap/disconnet component ports
708    f_cf_user_down(v_ueA);
709    f_cf_user_down(v_ueB);
710    f_cf_adapter_down();
711  }
712
713  testcase TC_SetFilter() runs on ImsTestCoordinator system IotSystemInterface {
714
715    timer tc_configureGuard, tc_ac;
716    var StartTrafficCaptureRsp startResult;
717    var StartTrafficCaptureRsp stopResult;
718    var ImsInterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
719    var ImsInterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
720   
721    // map/connect component ports
722    f_cf_adapter_up();
723    f_cf_monitor_up(v_gmA);
724    f_cf_monitor_up(v_mw);
725   
726    // preamble
727    tc_configureGuard.start(PX_MAX_MSG_WAIT);
728    acPort.send(m_generalConfigurationReq_offline);
729    alt {
730      [] acPort.receive (m_generalConfigurationRsp_success) {
731        log("General configuration succeed.");
732        tc_configureGuard.stop;
733        setverdict(pass);
734      }
735      [] acPort.receive (m_generalConfigurationRsp_timeout) {
736        setverdict(fail);
737        tc_configureGuard.stop;
738        stop;
739      }
740      [] acPort.receive (m_generalConfigurationRsp_error) {
741        setverdict(fail);
742        tc_configureGuard.stop;
743        stop;
744      }
745      [] acPort.receive {
746        tc_configureGuard.stop;
747        setverdict (inconc);
748        stop;
749      }
750      [] tc_configureGuard.timeout {
751        setverdict (inconc);
752        stop;
753      }
754    }
755    log("Preamble done.");
756   
757    // test body
758     // Filters are set by interface monitor components
759    v_gmA.start(f_monitor(m_setFilterReqMonitor1));
760    v_mw.start(f_monitor(m_setFilterReqMonitor2));
761   
762   // do-nothing loop
763    tc_ac.start(10.0);
764    tc_ac.timeout; 
765    log("Test body done.");
766
767    // postamble
768    v_gmA.stop;
769    v_mw.stop;
770    log("Postamble done.");
771
772    //unmap/disconnet component ports
773    f_cf_monitor_down(v_gmA);
774    f_cf_monitor_down(v_mw);
775    f_cf_adapter_down();
776  }
777
778  testcase TC_StartStopCapture() runs on ImsTestCoordinator system IotSystemInterface {
779    // create components
780    var StartTrafficCaptureRsp startResult;
781    var StopTrafficCaptureRsp stopResult;
782    var ImsInterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
783    var ImsInterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
784    timer tc_ac;
785    timer tc_configureGuard;
786   
787    // map/connect component ports
788    f_cf_adapter_up();
789    f_cf_monitor_up(v_gmA);
790    f_cf_monitor_up(v_mw);
791   
792    // preamble
793    tc_configureGuard.start(PX_MAX_MSG_WAIT);
794    acPort.send(m_generalConfigurationReq_offline);
795    alt {
796      [] acPort.receive (m_generalConfigurationRsp_success) {
797        log("General configuration succeed.");
798        tc_configureGuard.stop;
799        setverdict(pass);
800      }
801      [] acPort.receive (m_generalConfigurationRsp_timeout) {
802        setverdict(fail);
803        tc_configureGuard.stop;
804        stop;
805      }
806      [] acPort.receive (m_generalConfigurationRsp_error) {
807        setverdict(fail);
808        tc_configureGuard.stop;
809        stop;
810      }
811     [] tc_configureGuard.timeout {
812        setverdict (inconc);
813        stop;
814      }
815    }
816    log("Preamble done.");
817   
818    // test body
819    v_gmA.start(f_monitor(m_setFilterReqMonitor1));
820    v_mw.start(f_monitor(m_setFilterReqMonitor2));
821    tc_configureGuard.start(PX_MAX_MSG_WAIT);
822    acPort.send(m_startTrafficCaptureReq);
823    alt {
824      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value startResult {
825        tc_configureGuard.stop;
826        if (startResult.status.code != e_success)
827        {
828          log("**** TC_StartStopCapture: startTrafficCaptureReq unsuccessfull! ****");
829          setverdict(fail);
830          stop;
831        }
832      }
833      [] tc_configureGuard.timeout {
834        log("**** TC_StartStopCapture: startTrafficCaptureReq not answered. ****");
835        setverdict (inconc);
836        stop;
837      }
838    }
839
840   // do-nothing loop   
841    tc_ac.start(20.0);
842   tc_ac.timeout;
843
844    log("Test body done.");
845
846    // postamble
847    tc_configureGuard.start(PX_MAX_MSG_WAIT);
848    acPort.send(m_stopTrafficCaptureReq);
849    alt {
850      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value stopResult {
851        tc_configureGuard.stop;
852        if (stopResult.status.code != e_success)
853        {
854          setverdict(fail);
855        }
856        else
857        {
858          setverdict(pass);
859       }
860      }
861      [] tc_configureGuard.timeout {
862        setverdict (inconc);
863        stop;
864      }
865    }
866    v_gmA.stop;
867    v_mw.stop;
868    log("Postamble done.");
869
870    //unmap/disconnet component ports
871    f_cf_monitor_down(v_gmA);
872    f_cf_monitor_down(v_mw);
873    f_cf_adapter_down();
874  }
875
876  testcase TC_IMS_MESS_0001() runs on ImsTestCoordinator system IotSystemInterface {
877    var StartTrafficCaptureRsp startResult;
878    var StopTrafficCaptureRsp stopResult;
879    // create components
880    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
881    var IotEquipmentUser v_ueB := f_cf_create_IotEquipmentUser(c_userUE_B);
882    var ImsInterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
883    var ImsInterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
884    timer tc_ac;
885    timer tc_configureGuard;
886   
887    // map/connect component ports
888    f_cf_adapter_up();
889    f_cf_user_up(v_ueA);
890    f_cf_user_up(v_ueB);
891    f_cf_monitor_up(v_gmA);
892    f_cf_monitor_up(v_mw);
893   
894    // preamble
895    tc_configureGuard.start(PX_MAX_MSG_WAIT);
896    acPort.send(m_generalConfigurationReq_offline);
897    alt {
898      [] acPort.receive (m_generalConfigurationRsp_success) {
899        log("**** TC_IMS_MESS_0001: General configuration succeed. ****");
900        tc_configureGuard.stop;
901      }
902      [] acPort.receive (m_generalConfigurationRsp_timeout) {
903        setverdict(fail);
904        tc_configureGuard.stop;
905        stop;
906      }
907      [] acPort.receive (m_generalConfigurationRsp_error) {
908        setverdict(fail);
909        tc_configureGuard.stop;
910        stop;
911      }
912      [] acPort.receive {
913        log("**** TC_IMS_MESS_0001: General configuration unknown response. ****");
914        tc_configureGuard.stop;
915        setverdict (inconc);
916        stop;
917      }
918      [] tc_configureGuard.timeout {
919        log("**** TC_IMS_MESS_0001: General configuration timeout. ****");
920        setverdict (inconc);
921        stop;
922      }
923    }
924    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
925    f_PR_user_home_registration(v_ueB, f_getAnyValidUser(PX_EUT_B));
926    v_gmA.start(f_monitor(m_setFilterReqMonitor1));
927    v_mw.start(f_monitor(m_setFilterReqMonitor2));
928    log("**** TC_IMS_MESS_0001: Preamble done. ****");
929   
930    // test body
931    tc_configureGuard.start(PX_MAX_MSG_WAIT);
932    acPort.send(m_startTrafficCaptureReq);
933    alt {
934      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value startResult {
935        tc_configureGuard.stop;
936        if (startResult.status.code != e_success)
937        {
938          log("**** TC_IMS_MESS_0001: StartTrafficCaptureReq unsuccessfull! ****");
939          setverdict(fail);
940          stop;
941        }
942      }
943      [] tc_configureGuard.timeout {
944        log("**** TC_IMS_MESS_0001: StartTrafficCaptureReq not answered. ****");
945        setverdict (inconc);
946        stop;
947      }
948    }
949
950    f_mtc_userSendMessage(v_ueA, "body>1300Bytes"); // TODO add body here
951    //f_mtc_check_TP_IMS_4002_01_gm(v_gmA);
952    //f_mtc_check_TP_IMS_4002_01_mw(v_mw);
953    // *** Simulation part
954    tc_ac.start(15.0);
955    alt {
956     
957      [] tc_ac.timeout {
958        setverdict(inconc);
959      }
960    }
961    // *** Simulation part
962    f_mtc_userCheckMessageReceipt(v_ueB);
963    log("**** TC_IMS_MESS_0001: Test body done. ****");
964   
965    // postamble
966    tc_configureGuard.start(PX_MAX_MSG_WAIT);
967    acPort.send(m_stopTrafficCaptureReq);
968    alt {
969      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value stopResult {
970        tc_configureGuard.stop;
971        if (stopResult.status.code != e_success)
972        {
973          log("**** TC_IMS_MESS_0001: StartTrafficCaptureReq unsuccessfull! ****");
974          setverdict(fail);
975        }
976        else
977        {
978          setverdict(pass);
979       }
980      }
981      [] tc_configureGuard.timeout {
982        log("**** TC_IMS_MESS_0001: StartTrafficCaptureReq not answered. ****");
983        setverdict (inconc);
984      }
985    }
986    v_gmA.stop;
987    v_mw.stop;
988    f_PO_user_home_deregistration(v_ueA);
989    f_PO_user_home_deregistration(v_ueB);
990    log("**** TC_IMS_MESS_0001: Postamble done. ****");
991
992    //unmap/disconnet component ports
993    f_cf_user_down(v_ueA);
994    f_cf_user_down(v_ueB);
995    f_cf_monitor_down(v_gmA);
996    f_cf_monitor_down(v_mw);
997    f_cf_adapter_down();
998  }
999
1000  testcase TC_IMS_MESS_0006() runs on ImsTestCoordinator system IotSystemInterface {
1001    var StartTrafficCaptureRsp startResult;
1002    var StopTrafficCaptureRsp stopResult;
1003    // create components
1004    var IotEquipmentUser v_ueA := f_cf_create_IotEquipmentUser(c_userUE_A);
1005    var ImsInterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
1006    var ImsInterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
1007    timer tc_ac;
1008    timer tc_configureGuard;
1009   
1010    // map/connect component ports
1011    f_cf_adapter_up();
1012    f_cf_user_up(v_ueA);
1013    f_cf_monitor_up(v_gmA);
1014    f_cf_monitor_up(v_mw);
1015   
1016    // preamble
1017    tc_configureGuard.start(PX_MAX_MSG_WAIT);
1018    acPort.send(m_generalConfigurationReq_offline);
1019    alt {
1020      [] acPort.receive (m_generalConfigurationRsp_success) {
1021        log("**** TC_IMS_MESS_0006: General configuration succeed. ****");
1022        tc_configureGuard.stop;
1023      }
1024      [] acPort.receive (m_generalConfigurationRsp_timeout) {
1025        setverdict(fail);
1026        tc_configureGuard.stop;
1027        stop;
1028      }
1029      [] acPort.receive (m_generalConfigurationRsp_error) {
1030        setverdict(fail);
1031        tc_configureGuard.stop;
1032        stop;
1033      }
1034      [] acPort.receive {
1035        log("**** TC_IMS_MESS_0006: General configuration unknown response. ****");
1036        tc_configureGuard.stop;
1037        setverdict (inconc);
1038        stop;
1039      }
1040      [] tc_configureGuard.timeout {
1041        log("**** TC_IMS_MESS_0006: General configuration timeout. ****");
1042        setverdict (inconc);
1043        stop;
1044      }
1045    }
1046    f_PR_user_home_registration(v_ueA, f_getAnyValidUser(PX_EUT_A));
1047    v_gmA.start(f_monitor(m_setFilterReqMonitor1));
1048    v_mw.start(f_monitor(m_setFilterReqMonitor2));
1049    log("**** TC_IMS_MESS_0006: Preamble done. ****");
1050   
1051    // test body
1052    tc_configureGuard.start(PX_MAX_MSG_WAIT);
1053    acPort.send(m_startTrafficCaptureReq);
1054    alt {
1055      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value startResult {
1056        tc_configureGuard.stop;
1057        if (startResult.status.code != e_success)
1058        {
1059          log("**** TC_IMS_MESS_0006: StartTrafficCaptureReq unsuccessfull! ****");
1060          setverdict(fail);
1061          stop;
1062        }
1063      }
1064      [] tc_configureGuard.timeout {
1065        log("**** TC_IMS_MESS_0006: StartTrafficCaptureReq not answered. ****");
1066        setverdict (inconc);
1067        stop;
1068      }
1069    }
1070    f_mtc_userSendMessage(v_ueA, "test");
1071    //f_mtc_check_TP_IMS_5114_02_gm(v_gmA);
1072    //f_mtc_check_TP_IMS_5114_02_mw(v_mw);
1073    tc_ac.start(15.0);
1074    alt {
1075     
1076      [] tc_ac.timeout {
1077        setverdict(inconc);
1078      }
1079    }
1080    // *** Simulation part
1081    f_mtc_userCheckMessageNotDelivered(v_ueA);
1082   
1083    // postabmle
1084    tc_configureGuard.start(PX_MAX_MSG_WAIT);
1085    acPort.send(m_stopTrafficCaptureReq);
1086    alt {
1087      [] acPort.receive (m_startTrafficCaptureRsp_any) -> value stopResult {
1088        tc_configureGuard.stop;
1089        if (stopResult.status.code != e_success)
1090        {
1091          log("**** TC_IMS_MESS_0006: StartTrafficCaptureReq unsuccessfull! ****");
1092          setverdict(fail);
1093        }
1094        else
1095        {
1096          setverdict(pass);
1097       }
1098      }
1099      [] tc_configureGuard.timeout {
1100        log("**** TC_IMS_MESS_0006: StartTrafficCaptureReq not answered. ****");
1101        setverdict (inconc);
1102      }
1103    }
1104    v_gmA.stop;
1105    v_mw.stop;
1106    f_PO_user_home_deregistration(v_ueA);
1107   
1108    //unmap/disconnet component ports
1109    f_cf_user_down(v_ueA);
1110    f_cf_monitor_down(v_gmA);
1111    f_cf_monitor_down(v_mw);
1112    f_cf_adapter_down();
1113  }
1114
1115  control {
1116    //execute(TC_GeneralConfigurationMessageOffLineMode());
1117    //execute(TC_GeneralConfigurationMessageOnLineMode());
1118    //execute(TC_GeneralConfigurationMessageMerge());
1119    //execute(TC_TriggerUERegisterOffLineMode());
1120    //execute(TC_TriggerOneUERegisterOnLineMode());
1121    //execute(TC_TriggerTwoUERegisterOnLineMode());
1122    //execute(TC_TriggerUEDeRegister());
1123    //execute(TC_TriggerUERegister3UsersOnLineMode());
1124    //execute(TC_TriggerUERegisterUEDeRegister());
1125    //execute(TC_TriggerUERegisterOnLineModeWithoutEUTsSettings());
1126    //execute(TC_TriggerUERegisterOnLineModeBadEUTsInfo());
1127    //execute(TC_SetFilter());
1128    //execute(TC_StartStopCapture());
1129    execute(TC_IMS_MESS_0001());
1130    //execute(TC_IMS_MESS_0006());
1131  }
1132}
Note: See TracBrowser for help on using the repository browser.