ItsRSUsSimulator_TestCases.ttcn 4.53 KB
Newer Older
garciay's avatar
garciay committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module ItsRSUsSimulator_TestCases {
    
    // Libcommon
    import from LibCommon_VerdictControl all;
    import from LibCommon_Sync all;
    
    // LibItsCommon
    import from LibItsCommon_Functions all;
    
    // LibItsGeoNetworking
    import from LibItsGeoNetworking_TestSystem all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsGeoNetworking_Templates all;
    
    // LibItsDenm
    import from LibItsDenm_Templates all;
    
    // AtsRSUsSimulator
    import from ItsRSUsSimulator_TypesAndValues all;
    import from ItsRSUsSimulator_Templates all;
    import from ItsRSUsSimulator_TestSystem all;
    import from ItsRSUsSimulator_Functions all;
garciay's avatar
garciay committed
23
    import from ItsRSUsSimulator_Pics all;
garciay's avatar
garciay committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    import from ItsRSUsSimulator_Pixits all;
    
    testcase TC_RSUSIMU_BV_01() runs on ItsRSUsSimulator system ItsGeoNetworkingSystem {
        // Local variables
        var template (value) Payload v_payload;
        var GeoNetworkingInd v_gnInd;
        
        // Test control
        
        // Test component configuration
        f_cf01Up();
            
        // Test adapter configuration
        
        // Preamble
        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
        
        // Test Body
42
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) {
garciay's avatar
garciay committed
43
44
            tc_cam.start;
        }
45
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].denms)) {
garciay's avatar
garciay committed
46
47
            tc_denm.start;
        }
48
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) {
garciay's avatar
garciay committed
49
50
            tc_mapem.start;
        }
51
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems)) {
garciay's avatar
garciay committed
52
53
            tc_spatem.start;
        }
54
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) {
garciay's avatar
garciay committed
55
56
            tc_ivim.start;
        }
garciay's avatar
garciay committed
57

garciay's avatar
garciay committed
58
59
60
61
        alt {
            [] geoNetworkingPort.receive(
                mw_geoNwInd(
                    mw_geoNwPdu(
garciay's avatar
garciay committed
62
63
                        // FIXM Geobroadcast or TSB? mw_geoNwBroadcastPacketWithNextHeader_srem
                        mw_geoNwTsbPacketWithNextHeader_srem(
garciay's avatar
garciay committed
64
65
66
67
                            ?,
                            ?,
                            e_btpB
            )))) -> value v_gnInd { // Receive a SREM message
68
                log("*** " & testcasename() & ": DEBUG: Processing SREM ***");
garciay's avatar
garciay committed
69
70
71
72
                f_processSrem(v_gnInd.msgIn);
                repeat;
            }
            [] geoNetworkingPort.receive(mw_geoNwInd(?)) -> value v_gnInd { // Receive a message
73
                log("*** " & testcasename() & ": DEBUG: Recieving unsollicited message ***");
garciay's avatar
garciay committed
74
75
76
                // Nothing to do, just for logging purposes
                repeat;
            }
garciay's avatar
garciay committed
77
            [PICS_GENERATE_CAM] tc_cam.timeout {
garciay's avatar
garciay committed
78
                log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
garciay's avatar
garciay committed
79
                f_prepare_cam(v_payload);
80
                f_send(v_payload, PICS_CAM_ITS_AID);
garciay's avatar
garciay committed
81
82
83
                tc_cam.start;
                repeat;
            }
garciay's avatar
garciay committed
84
            [PICS_GENERATE_DENM] tc_denm.timeout {
garciay's avatar
garciay committed
85
                log("*** " & testcasename() & ": DEBUG: Processing DENM ***");
garciay's avatar
garciay committed
86
                f_prepare_denm(v_payload);
87
                f_send(v_payload, PICS_DENM_ITS_AID);
garciay's avatar
garciay committed
88
                tc_denm.start;
garciay's avatar
garciay committed
89
90
                repeat;
            }
garciay's avatar
garciay committed
91
92
93
            [PICS_GENERATE_MAPEM] tc_mapem.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing MAPEM ***");
                f_prepare_mapem(v_payload);
94
                f_send(v_payload, PICS_MAPEM_ITS_AID);
garciay's avatar
garciay committed
95
96
97
98
99
                tc_mapem.start;
                repeat;
            }
            [PICS_GENERATE_SPATEM] tc_spatem.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing SPATEM ***");
100
101
                for (var integer v_counter := 0; v_counter < lengthof(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems); v_counter := v_counter + 1) {
                    f_prepare_spatem(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems[v_counter], v_payload);
102
                    f_send(v_payload, PICS_SPATEM_ITS_AID);
103
                }
garciay's avatar
garciay committed
104
105
106
107
108
109
                tc_spatem.start;
                repeat;
            }
            [PICS_GENERATE_IVIM] tc_ivim.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing IVIM ***");
                f_prepare_ivim(v_payload);
110
                f_send(v_payload, PICS_IVIM_ITS_AID);
garciay's avatar
garciay committed
111
112
113
                tc_ivim.start;
                repeat;
            }
garciay's avatar
garciay committed
114
115
116
117
118
119
120
121
122
        } // End of 'alt' statement
        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
        
        // Postamble
        f_cf01Down();
        
    }
    
} // End of module ItsRSUsSimulator_TestCases