ItsDenm_TpFunctions.ttcn 180 KB
Newer Older
1
/**
filatov's avatar
filatov committed
2
 *    @author   ETSI / STF484 / STF517 / STF525
3
4
5
 *    @version  $URL$
 *              $Id$
 *    @desc     DENM TP functions
garciay's avatar
garciay committed
6
7
8
9
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
10
11
12
13
14
15
16
 *
 */
module ItsDenm_TpFunctions {
    
    // LibCommon
    import from LibCommon_Sync all;
    import from LibCommon_Time all;
filatov's avatar
filatov committed
17
//    import from LibCommon_VerdictControl all;
18
    import from LibCommon_BasicTypesAndValues all;  
19
    import from LibCommon_DataStrings all;
20
    
21
    // LibItsCommon
filatov's avatar
filatov committed
22
//    import from LibItsCommon_TypesAndValues all;
23
24
    import from LibItsCommon_Templates all;
    import from LibItsCommon_Functions all;
filatov's avatar
filatov committed
25
    import from LibItsCommon_ASN1_NamedNumbers all;
26
27
28
29
30
31
    
    // LibIts
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from ITS_Container language "ASN.1:1997" all;
    
    // LibItsDenm
32
33
34
35
    import from LibItsDenm_TestSystem all;
    import from LibItsDenm_Functions all;
    import from LibItsDenm_Templates all;
    import from LibItsDenm_TypesAndValues all;
36
    import from LibItsDenm_Pics all;
filatov's avatar
filatov committed
37
//    import from LibItsDenm_Pixits all;
38
39

    import from LibItsSecurity_Functions all;
40
41
42
43
44
45
46
47
48
49
50
51
52
    
    // 5.2.1
    group denMessageTransmission {
        
      // 5.2.1.1
      group denMessageFormat {
          
          /**
           * @desc    TP Function for TC_DEN_MSGF_BV_01
           */
          function f_DEN_MSGF_BV_01() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
53
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
              var ActionID v_actionId;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
73
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
74
75
76
77
78
79
80
81
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm,
                              mw_anyStationId, 
garciay's avatar
garciay committed
82
83
                              LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, 
                              LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
                          )
                      ) 
                  ) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect header information. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_MSGF_BV_01
          
          /**
           * @desc    TP Function for TC_DEN_MSGF_BV_02
           */
          function f_DEN_MSGF_BV_02() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
114
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
              var ActionID v_actionId;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
134
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm(
                                  mw_anyDenmMgmtCon,
                                  -,
                                  mw_denmLocationWithTrace({ ?, * })
                              )
                          )
                      ) 
                  ) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect location container information. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_MSGF_BV_02
          
      } // end denMessageFormat
      
      // 5.2.1.2
      group denEventGeneration {
        
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_01
           */
          function f_DEN_EVGN_BV_01() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
181
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
              var ActionID v_actionId;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
201
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (mw_anyDenmMgmtCon)
                          )
                      ) 
                  ) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect header and management information. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_01
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_02
           */
          function f_DEN_EVGN_BV_02() runs on ItsDenm {
              
              // Local variables
              var template (value) SituationContainerList v_situations := {
garciay's avatar
garciay committed
241
242
243
244
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_accident_, LibItsCommon_ASN1_NamedNumbers.AccidentSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_, LibItsCommon_ASN1_NamedNumbers.RoadworksSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_slowVehicle_, LibItsCommon_ASN1_NamedNumbers.SlowVehicleSubCauseCode_unavailable_)
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
              };
              var boolean v_success := true;
              var ActionIDList v_actionIds;
              var DenmInd v_denmInd;
              var integer i;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
265
              for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
filatov's avatar
filatov committed
266
                  f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[i])));
267
268
269
270
271
272
                  f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
                  v_actionIds[i] := v_denmInd.msgIn.denm.management.actionID;
              }
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
filatov's avatar
filatov committed
273
              f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[lengthof(v_situations) - 1])));
274
275
276
277
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionIds[lengthof(v_actionIds) - 1] := v_denmInd.msgIn.denm.management.actionID;
              
              //check the action id
278
              for (i := 0; i < lengthof(v_actionIds) - 1; i := i + 1) {
279
280
281
282
283
284
285
286
287
288
289
290
291
292
                  if (v_actionIds[lengthof(v_actionIds) - 1].sequenceNumber == v_actionIds[i].sequenceNumber) {
                      v_success := false;
                  }
              }
              if (v_success==true) {
                  log("*** " & testcasename() & ": PASS: actionID field indicating unused value. ***");
                  f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
              }
              else {
                  log("*** " & testcasename() & ": FAIL: actionID field indicating used value. ***");
                  f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
              }
              
              // Postamble
293
              for (i := 0; i < lengthof(v_actionIds); i := i + 1) {
294
295
296
297
298
299
300
301
302
303
304
305
                  f_poCancelEvent(e_iut, v_actionIds[i]);
              }
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_02
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_03
           */
          function f_DEN_EVGN_BV_03() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
306
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
327
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
328
329
330
331
332
333
334
335
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm(
                                  mw_denmMgmtConWithActionID(
336
                                      v_actionId
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
                                  )
                              )
                          )
                      )
                  ) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_03
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_04
           */
          function f_DEN_EVGN_BV_04() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
369
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
390
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm(
                                  mw_anyDenmMgmtCon,
                                  v_situation
                              )
                          )
                      )
                  ) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_04
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_05
           */
          function f_DEN_EVGN_BV_05() runs on ItsDenm {
              
              // Local variables
              var template (value) SituationContainerList v_situations := {
garciay's avatar
garciay committed
432
433
434
435
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_accident_, LibItsCommon_ASN1_NamedNumbers.AccidentSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_, LibItsCommon_ASN1_NamedNumbers.RoadworksSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_slowVehicle_, LibItsCommon_ASN1_NamedNumbers.SlowVehicleSubCauseCode_unavailable_)
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
              };
              var ActionIDList v_actionIds;
              var DenmInd v_denmInd;
              var integer i;
              var TimestampIts v_timestampIts;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
456
              for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
filatov's avatar
filatov committed
457
                  f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[i])));
458
459
                  f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
                  v_actionIds[i] := v_denmInd.msgIn.denm.management.actionID;
460
                  v_timestampIts := v_denmInd.msgIn.denm.management.referenceTime;
461
462
463
464
              }
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
filatov's avatar
filatov committed
465
              f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[lengthof(v_situations) - 1])));
466
467
468
469
470
471
472
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm(
473
                                  mw_denmMgmtConWithReferenceTime(?)
474
475
476
477
478
479
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      v_actionIds[lengthof(v_actionIds)] := v_denmInd.msgIn.denm.management.actionID;
480
481
482
483
484
485
486
487
                      if (v_timestampIts<v_denmInd.msgIn.denm.management.referenceTime) {
                          log("*** " & testcasename() & ": PASS: Reference Time has increased since last received DENM. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                      }
                      else {
                          log("*** " & testcasename() & ": FAIL: Reference Time has not increased since last received DENM. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                      }
488
489
490
491
492
493
494
495
496
497
498
499
500
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
501
              for (i := 0; i < lengthof(v_actionIds); i := i + 1) {
502
503
504
505
506
507
508
509
510
511
512
513
514
                  f_poCancelEvent(e_iut, v_actionIds[i]);
              }
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_05
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_07
           */
          function f_DEN_EVGN_BV_07() runs on ItsDenm {
              
              // Local variables
              var template (value) SituationContainerList v_situations := {
garciay's avatar
garciay committed
515
516
517
518
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_accident_, LibItsCommon_ASN1_NamedNumbers.AccidentSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_, LibItsCommon_ASN1_NamedNumbers.RoadworksSubCauseCode_unavailable_),
                  m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_slowVehicle_, LibItsCommon_ASN1_NamedNumbers.SlowVehicleSubCauseCode_unavailable_)
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
              };
              var SequenceNumber v_sequenceNumber;
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              var integer i;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
539
              for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
filatov's avatar
filatov committed
540
                  f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[i])));
541
542
543
544
545
546
547
548
                  f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
                  f_poCancelEvent(e_iut, v_denmInd.msgIn.denm.management.actionID);
              }
              //save the last sequence number
              v_sequenceNumber := v_denmInd.msgIn.denm.management.actionID.sequenceNumber;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
filatov's avatar
filatov committed
549
              f_utTriggerEvent(m_utTriggerEvent(valueof(v_situations[lengthof(v_situations) - 1])));
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm(
                                  mw_denmMgmtConWithActionID(
                                      mw_actionId(-, f_increaseSequenceNumber(v_sequenceNumber))
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      v_actionId := v_denmInd.msgIn.denm.management.actionID;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_07
          
          /**
           * @desc    TP Function for TC_DEN_EVGN_BV_10
           */
          function f_DEN_EVGN_BV_10() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
592
              var template (value) SituationContainer v_situation := m_situation (LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_ );
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
              var StationID v_stationId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_stationId := f_getIutStationId ( );
garciay's avatar
garciay committed
614
              f_utChangePseudonym ( m_utDenmChangePseudonym );
615
              f_utTriggerEvent ( m_utTriggerEvent ( v_situation) );
616
617
618
619
620
621
              
              tc_ac.start;
              alt {
                  [] denmPort.receive ( mw_denmInd ( mw_denmPdu ( mw_denm ( mw_anyDenmMgmtCon ) ) ) ) -> value v_denmInd {
                      tc_ac.stop;
                      if ( v_denmInd.msgIn.denm.management.actionID.originatingStationID != v_stationId ) {
622
623
                          log("*** " & testcasename() & ": PASS: Successfully received expected DENM - Pseudonym changed. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
624
625
                      }
                      else {
626
627
                          log("*** " & testcasename() & ": FAIL: received expected DENM - Pseudonym not changed. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
                      }
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVGN_BV_10
          
      } // end denEventGeneration
      
      // 5.2.1.3
      group denEventUpdate {
          
          /**
           * @desc    TP Function for TC_DEN_EVUP_BV_02
           */
          function f_DEN_EVUP_BV_01() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
657
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_UPDATE) {
                  log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
675
              f_utTriggerEvent(m_utTriggerEvent(v_situation));
676
677
678
679
680
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
garciay's avatar
garciay committed
681
              v_situation.eventType.subCauseCode := LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_engineProblem_;
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
              f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (mw_anyDenmMgmtCon)
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_01
          
          /**
           * @desc    TP Function for TC_DEN_EVUP_BV_02
           */
          function f_DEN_EVUP_BV_02() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
721
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_UPDATE) {
                  log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
739
              f_utTriggerEvent(m_utTriggerEvent(v_situation));
740
741
742
743
744
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
garciay's avatar
garciay committed
745
              v_situation.eventType.subCauseCode := LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_engineProblem_;
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
              f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtConWithActionID(
                                      v_actionId
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_02
          
          /**
           * @desc    TP Function for TC_DEN_EVUP_BV_03
           */
          function f_DEN_EVUP_BV_03() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
789
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
790
              var TimestampIts v_referenceTime1 , v_timestampIts , v_msgtimestamp;
791
              var integer v_diff;
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_UPDATE) {
                  log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
809
              f_utTriggerEvent(m_utTriggerEvent(v_situation));
810
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
811
              v_timestampIts := f_getCurrentTime();
812
              //log("v_timestampIts: ", v_timestampIts);
813
814
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              v_referenceTime1 := v_denmInd.msgIn.denm.management.referenceTime;
815
              //log("v_referenceTime1: ", v_referenceTime1);
816
              v_diff := v_timestampIts - v_referenceTime1;
817
              //log("v_diff: ", v_diff);
818
819
820
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
garciay's avatar
garciay committed
821
              v_situation.eventType.subCauseCode := LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_engineProblem_;
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
              f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtCon(
                                      v_actionId
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      v_timestampIts := f_getCurrentTime();
840
                      //log("v_timestampIts: ", v_timestampIts);
841
                      v_msgtimestamp := v_denmInd.msgIn.denm.management.referenceTime;
842
                      //log("v_msgtimestamp: ", v_msgtimestamp);
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
                      if ( ( ( v_timestampIts + v_diff ) > v_msgtimestamp ) and ( v_msgtimestamp > v_referenceTime1 ) ) {
                          log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                      }
                      else {
                          log("*** " & testcasename() & ": FAIL: ReferenceTime not updated correctly ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                      }
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_03
          
          /**
           * @desc    TP Function for TC_DEN_EVUP_BO_04
           */
          function f_DEN_EVUP_BO_04() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
875
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_UPDATE) {
                  log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
893
              f_utTriggerEvent(m_utTriggerEvent(v_situation));
894
895
896
897
898
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
garciay's avatar
garciay committed
899
              v_situation.eventType.subCauseCode := LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_engineProblem_;
900
901
              f_utUpdateEvent(m_utUpdateEvent(m_actionId(f_increaseSequenceNumber(v_actionId.sequenceNumber), f_getIutStationId()), v_situation));
              
902
              tc_noac.start;
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtCon(
                                      m_actionId(
                                          f_increaseSequenceNumber(v_actionId.sequenceNumber),
                                          f_getIutStationId()
                                      )
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
919
                      tc_noac.stop;
920
921
922
923
                      log("*** " & testcasename() & ": FAIL: Received updated DENM for the actionId which is not in originator ITS-S message table. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
924
                      tc_noac.stop;
925
926
927
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
928
                  [] tc_noac.timeout {
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
                      log("*** " & testcasename() & ": PASS: No DENM was sent. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BO_04
          
      } // end denEventUpdate
      
      // 5.2.1.4
      group denEventTermination {
          
          /**
           * @desc    TP Function for TC_DEN_EVTR_BV_01
           */
          function f_DEN_EVTR_BV_01() runs on ItsDenm {
              
              // Local variables
garciay's avatar
garciay committed
951
              var template (value) SituationContainer v_situation := m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              if (not PICS_DENM_CANCELLATION) {
                  log("*** " & testcasename() & ": PICS_DENM_CANCELLATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
969
970
              f_utTriggerEvent(m_utTriggerEvent(v_situation, c_duration_10sec));
              f_awaitDenMessage ( mw_denmInd ( mw_denmPdu ( mw_denm (  mw_denmMgmtCon ( mw_anyActionId, -, -, c_duration_10sec ) ) ) ) , v_denmInd );
971
972
973
974
975
976
977
978
979
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive ( mw_denmInd ( mw_denmPdu (
980
                                                          mw_denm ( mw_denmMgmtConTermination ( v_actionId, -, -, -, -, isCancellation ))))) -> value v_denmInd {
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_01
          
For faster browsing, not all history is shown. View entire blame