Commit daf47778 authored by garciay's avatar garciay
Browse files

Start typing and templates for Tunnel Management

parent d640c151
Loading
Loading
Loading
Loading
+303 −232
Original line number Original line Diff line number Diff line
/**
 * @author      ETSI/STF498
 * @version     $Url$
 *              $Id$
 * @desc        Component configuration functions
 */
module LibGtpv2C_Configuration {
module LibGtpv2C_Configuration {
    
    
    // Libcommon
    // Libcommon
@@ -22,6 +28,7 @@ module LibGtpv2C_Configuration {
         *           - one SGW node (IUT)
         *           - one SGW node (IUT)
         *           - varaibles initialisation
         *           - varaibles initialisation
         * @verdict Unchanged
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 1: Test configuration CF_MME
         */
         */
        function f_cf01_S11Up_MME() runs on Gtpv2CComponent {
        function f_cf01_S11Up_MME() runs on Gtpv2CComponent {
            // Map ports
            // Map ports
@@ -48,6 +55,7 @@ module LibGtpv2C_Configuration {
         *           - one SGW node (IUT)
         *           - one SGW node (IUT)
         *           - varaibles initialisation
         *           - varaibles initialisation
         * @verdict Unchanged
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 2: Test configuration CF_MME_ENB
         */
         */
        function f_cf02_S11Up_MME() runs on Gtpv2CComponent {
        function f_cf02_S11Up_MME() runs on Gtpv2CComponent {
            // Map ports
            // Map ports
@@ -70,6 +78,7 @@ module LibGtpv2C_Configuration {
        /**
        /**
         * @desc Copmenent shutdown
         * @desc Copmenent shutdown
         * @verdict Unchanged
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 1: Test configuration CF_MME
         */
         */
        function f_cf01_S11Down_MME() runs on Gtpv2CComponent {
        function f_cf01_S11Down_MME() runs on Gtpv2CComponent {
            
            
@@ -83,11 +92,14 @@ module LibGtpv2C_Configuration {
            unmap(self:acPort, system:acPort);
            unmap(self:acPort, system:acPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            
            
            vc_gtpv2c_sgw.done;
            
        } // End of function f_cf01_S11Down_MME 
        } // End of function f_cf01_S11Down_MME 
        
        
        /**
        /**
         * @desc Copmenent shutdown
         * @desc Copmenent shutdown
         * @verdict Unchanged
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 2: Test configuration CF_MME_ENB
         */
         */
        function f_cf02_S11Down_MME() runs on Gtpv2CComponent {
        function f_cf02_S11Down_MME() runs on Gtpv2CComponent {
            
            
@@ -101,6 +113,9 @@ module LibGtpv2C_Configuration {
            unmap(self:acPort, system:acPort);
            unmap(self:acPort, system:acPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            
            
            vc_gtpv2c_sgw.done; 
            vc_gtpv2c_s1mme.done; 
            
        } // End of function f_cf01_S11Down_MME 
        } // End of function f_cf01_S11Down_MME 
        
        
        /**
        /**
@@ -111,6 +126,8 @@ module LibGtpv2C_Configuration {
         *           - one MME node (IUT)
         *           - one MME node (IUT)
         *           - one S1-MME node (UT)
         *           - one S1-MME node (UT)
         *           - varaibles initialisation
         *           - varaibles initialisation
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 3: Test configuration CF_SGW
         */
         */
        function f_cf01_S11Up_SGW() runs on Gtpv2CComponent {
        function f_cf01_S11Up_SGW() runs on Gtpv2CComponent {
            // Map ports
            // Map ports
@@ -129,9 +146,39 @@ module LibGtpv2C_Configuration {
            vc_restartCounter := 0;
            vc_restartCounter := 0;
        } // End of function f_cf01_S11Up_SGW 
        } // End of function f_cf01_S11Up_SGW 
        
        
        /**
         * @desc This configuration features:
         *       - Port mapping
         *       - Sync port connection
         *       - Component setup:
         *           - one MME node (IUT)
         *           - one S1-MME node (UT)
         *           - varaibles initialisation
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 2: Test configuration CF_SGW_PGW
         */
        function f_cf02_S11Up_SGW() runs on Gtpv2CComponent {
            // Map ports
            map(self:acPort, system:acPort);
            map(self:gtpv2CPort, system:gtpv2CPort);
            
            // Connect sync ports
            f_connect4SelfOrClientSync();
            
            // Activate sync default for MTC
            activate(a_mtc_shutdown());
            
            vc_gtpv2c_s5 := Gtpv2CComponent.create; 
            vc_gtpv2c_mme := Gtpv2CComponent.create; 
            
            vc_sequenceNumber := 0;
            vc_restartCounter := 0;
        } // End of function f_cf02_S11Up_SGW 
        
        /**
        /**
         * @desc Copmenent shutdown
         * @desc Copmenent shutdown
         * @verdict Unchanged
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 3: Test configuration CF_SGW
         */
         */
        function f_cf01_S11Down_SGW() runs on Gtpv2CComponent {
        function f_cf01_S11Down_SGW() runs on Gtpv2CComponent {
            
            
@@ -145,6 +192,30 @@ module LibGtpv2C_Configuration {
            unmap(self:acPort, system:acPort);
            unmap(self:acPort, system:acPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            
            
            vc_gtpv2c_mme.done;
            
        } // End of function f_cf01_S11Down_SGW 
        
        /**
         * @desc Copmenent shutdown
         * @verdict Unchanged
         * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 3: Test configuration CF_SGW
         */
        function f_cf02_S11Down_SGW() runs on Gtpv2CComponent {
            
             // De-activate all
             deactivate;
             
            // Disconnect sync ports
            f_disconnect4SelfOrClientSync();
            
            // Unmap ports
            unmap(self:acPort, system:acPort);
            unmap(self:gtpv2CPort, system:gtpv2CPort);
            
            vc_gtpv2c_s5.done;
            vc_gtpv2c_mme.done;
            
        } // End of function f_cf01_S11Down_SGW 
        } // End of function f_cf01_S11Down_SGW 
        
        
        /**
        /**
@@ -183,7 +254,7 @@ module LibGtpv2C_Configuration {
        ) return BearerContext {
        ) return BearerContext {
            p_bearer_context.length_ := sizeof(p_bearer_context) - 4/*Size of IE mandatory fields*/; // FIXME To be reviewed
            p_bearer_context.length_ := sizeof(p_bearer_context) - 4/*Size of IE mandatory fields*/; // FIXME To be reviewed
            
            
            return p_bearer_context;
            return valueof(p_bearer_context);
        } // End of function f_calculateInformationElementLength_bearerContext
        } // End of function f_calculateInformationElementLength_bearerContext
        
        
    } // End of group tlviVariableLengthCalculations 
    } // End of group tlviVariableLengthCalculations 
+129 −12
Original line number Original line Diff line number Diff line
@@ -2,14 +2,14 @@
 * @author      ETSI/STF498
 * @author      ETSI/STF498
 * @version     $Url$
 * @version     $Url$
 *              $Id$
 *              $Id$
 * @dec         Testcases and component functions module for INT GTPv2-C protocol - MME role
 * @desc        Testcases and component functions module for INT GTPv2-C protocol - MME role
 */
 */
module LibGtpv2C_MME_Functions {
module LibGtpv2C_MME_Functions {
    
    
    // Libcommon
    // Libcommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    import from LibCommon_DataStrings all;
    import from LibCommon_VerdictControl {type FncRetCode;}
    import from LibCommon_VerdictControl all;
    import from LibCommon_Sync all;
    import from LibCommon_Sync all;
    import from LibCommon_Time all;
    import from LibCommon_Time all;
    
    
@@ -17,6 +17,7 @@ module LibGtpv2C_MME_Functions {
    import from LibGtpv2C_TypesAndValues all;
    import from LibGtpv2C_TypesAndValues all;
    import from LibGtpv2C_TestSystem all;
    import from LibGtpv2C_TestSystem all;
    import from LibGtpv2C_Pics all;
    import from LibGtpv2C_Pics all;
    import from LibGtpv2C_Pixits all;
    import from LibGtpv2C_Configuration all;
    import from LibGtpv2C_Configuration all;
    import from LibGtpv2C_Templates all;
    import from LibGtpv2C_Templates all;
    
    
@@ -132,7 +133,7 @@ module LibGtpv2C_MME_Functions {
                                            f_getNextRestartCounter()
                                            f_getNextRestartCounter()
                                        ),
                                        ),
                                        m_negative_cause(
                                        m_negative_cause(
                                            67 // FIXME Crete constance See 3GPP TS 29.274 version 9.11.0 Release 9 Table 8.4-1: Cause values
                                            c_cause_invalid_length
                                        )
                                        )
                                    )
                                    )
                                )
                                )
@@ -193,7 +194,7 @@ module LibGtpv2C_MME_Functions {
                                            f_getNextRestartCounter()
                                            f_getNextRestartCounter()
                                        ),
                                        ),
                                        m_negative_cause(
                                        m_negative_cause(
                                            66 // FIXME Crete constance See 3GPP TS 29.274 version 9.11.0 Release 9 Table 8.4-1: Cause values
                                            c_cause_version_not_supported
                                        )
                                        )
                                    )
                                    )
                                )
                                )
@@ -256,7 +257,7 @@ module LibGtpv2C_MME_Functions {
                    )
                    )
                ) -> value v_gtpv2Ind { 
                ) -> value v_gtpv2Ind { 
                    tc_ac.stop;
                    tc_ac.stop;
                    // Send echo reply
                    // Send the Create Session Response
                    gtpv2CPort.send(
                    gtpv2CPort.send(
                        m_gtpv2Req_MME( 
                        m_gtpv2Req_MME( 
                            m_gtpv2Pdu(
                            m_gtpv2Pdu(
@@ -267,17 +268,23 @@ module LibGtpv2C_MME_Functions {
                                ),
                                ),
                                m_gtpv2Payload_createSessionResponse(
                                m_gtpv2Payload_createSessionResponse(
                                    m_gtpv2CreateSessionResponse_dummy(
                                    m_gtpv2CreateSessionResponse_dummy(
                                        m_cause(16), // FIXME Crete constance See 3GPP TS 29.274 version 9.11.0 Release 9 Table 8.4-1: Cause values
                                        m_cause(c_cause_request_accepted), 
                                        f_calculateInformationElementLength_bearerContext(
                                        f_calculateInformationElementLength_bearerContext(
                                            m_BearerContexts_dummy // FIXME Create template m_BearerContextsCreated
                                            m_BearerContexts(
                                                m_groupedIes_createdContextWithinCreateSessionRequest( 
                                                    m_createdContextWithinCreateSessionRequest(
                                                        m_EpsBearerId(PX_EBI),
                                                        m_bearerQoS_dummy 
                                                    ) 
                                                ) 
                                            )
                                        )
                                        )
                                    )
                                    )
                                )
                                )
                            )
                            )
                        )
                        )
                    );
                    );
                    log("*** " & testcasename() & ": PASS: Successful Echo Request Procedure ***");
                    log("*** " & testcasename() & ": INFO: IUT sends Create Session Request ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                }
                [] tc_ac.timeout {
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
@@ -285,19 +292,128 @@ module LibGtpv2C_MME_Functions {
                }
                }
            } // End of 'alt' statement 
            } // End of 'alt' statement 
            // 2. Verify that the MME sends Modify Bearer Request and receives the Modify Bearer Response
            // 2. Verify that the MME sends Modify Bearer Request and receives the Modify Bearer Response
            // TODO
            // TODO If S1-MME used, need synchronisation point to trigger Initial Context Setup Response and Attach Commplete messages
            // TODO If S1-MME used, need synchronisation point to trigger Initial Context Setup Response and Attach Commplete messages
            alt {
                [] gtpv2CPort.receive(
                    mw_gtpv2Ind( 
                        mw_gtpv2Pdu(
                            mw_header_teid(
                                e_modifyBearerRequest 
                            ),
                            -,
                            mw_gtpv2Payload_modifyBearerRequest(
                                mw_gtpv2ModifyBearerRequest_dummy
                            ) 
                        ) 
                    )
                ) -> value v_gtpv2Ind { 
                    tc_ac.stop;
                    // Send the Modify Session Response
                    gtpv2CPort.send(
                        m_gtpv2Req_MME( 
                            m_gtpv2Pdu(
                                m_header_noteid(e_modifyBearerResponse),
                                m_gtpv2ExtendedHeader_teid(
                                    f_extract_teid(v_gtpv2Ind.msgIn),
                                    f_extract_sequenceNumber(v_gtpv2Ind.msgIn)
                                ),
                                m_gtpv2Payload_modifyBearerResponse(
                                    m_gtpv2ModifyBearerResponse_dummy(
                                        m_cause(c_cause_request_accepted)
                                    )
                                )
                            )
                        )
                    );
                    log("*** " & testcasename() & ": PASS: IUT sends Modify Session Request ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                }
            } // End of 'alt' statement 
            
            
            // Postamble
            f_postamble_MME();
            f_selfOrClientSyncAndVerdict(c_poDone, e_success);
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of function f_TC_S11_MME_TM_01 
        
        /**
         * @desc Validate that S-GW is able to request the MME to start Create Bearer Request Procedure - MME role
         * @verdict pass on success, inconc on timeout, fail otherwise
         */
        function f_TC_S11_MME_TM_02() runs on Gtpv2CComponent {
            
            
            // Local variables
            var Gtpv2Ind v_gtpv2Ind;
            
            
            // Preamble
            f_preamble_MME();
            gtpv2CPort.send(
                m_gtpv2Req_SGW( 
                    m_gtpv2Pdu(
                        m_header_noteid(e_createSessionRequest),
                        m_gtpv2ExtendedHeader_teid(
                            '00000000'O, // FIXME Use a PIXIT
                            f_getNextSequenceNumber()
                        ),
                        m_gtpv2Payload_createSessionRequest(
                            m_gtpv2CreateSessionRequest_dummy(
                                m_ratType_dummy,
                                m_FullyQualifiedTeid_dummy,
                                m_accessPointName(PX_VISITED_APN), 
                                f_calculateInformationElementLength_bearerContext(
                                    m_BearerContexts(
                                        m_groupedIes_createdContextWithinCreateSessionRequest( 
                                            m_createdContextWithinCreateSessionRequest(
                                                m_EpsBearerId(PX_EBI),
                                                m_bearerQoS_dummy 
                                            ) 
                                        ) 
                                    )
                                )
                            )
                        )
                    )
                )
            );
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
            
            
            // Test Body
            tc_ac.start;
            alt {
                [] gtpv2CPort.receive(
                    mw_gtpv2Ind( 
                        mw_gtpv2Pdu(
                            mw_header_teid(
                                e_createSessionRequest 
                            ),
                            -,
                            mw_gtpv2Payload_createSessionRequest(
                                mw_gtpv2CreateSessionRequest_dummy
                            ) 
                        ) 
                    )
                ) -> value v_gtpv2Ind { 
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: IUT sends Create Session Request ***");
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                }
            } // End of 'alt' statement 
            
            
            // Postamble
            // Postamble
            f_postamble_MME();
            f_postamble_MME();
            f_selfOrClientSyncAndVerdict(c_poDone, e_success);
            f_selfOrClientSyncAndVerdict(c_poDone, e_success);
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
            
        } // End of function f_TC_S11_MME_TM_01 
        } // End of function f_TC_S11_MME_TM_02 
        
        
    } // End of group tunnelManagement 
    } // End of group tunnelManagement 
    
    
@@ -348,6 +464,7 @@ module LibGtpv2C_MME_Functions {
            } else {
            } else {
                // FIXME To be developed
                // FIXME To be developed
            }
            }
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
            
            // Postamble
            // Postamble
            f_selfOrClientSyncAndVerdict(c_poDone, e_success);
            f_selfOrClientSyncAndVerdict(c_poDone, e_success);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * @author      ETSI/STF498
 * @author      ETSI/STF498
 * @version     $Url$
 * @version     $Url$
 *              $Id$
 *              $Id$
 * @dec         PICs module for INT GTPv2-C library
 * @desc        PICs module for INT GTPv2-C library
 */
 */
module LibGtpv2C_Pics { 
module LibGtpv2C_Pics { 
    
    
+10 −2
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * @author      ETSI/STF498
 * @author      ETSI/STF498
 * @version     $Url$
 * @version     $Url$
 *              $Id$
 *              $Id$
 * @dec         Pixits module for INT GTPv2-C library
 * @desc        Pixits module for INT GTPv2-C library
 * @see         ETSI TS 103 202-3 V0.0.1 2 (2015-06)
 * @see         ETSI TS 103 202-3 V0.0.1 2 (2015-06)
 */
 */
module LibGtpv2C_Pixits {
module LibGtpv2C_Pixits {
@@ -61,9 +61,17 @@ module LibGtpv2C_Pixits {
     */
     */
    modulepar charstring PX_GTPC_S11_SUT_SGW_PORT := "12348";
    modulepar charstring PX_GTPC_S11_SUT_SGW_PORT := "12348";
    
    
    /**
     * @desc EPS Bearer ID
     * @see  3GPP TS 29.274 version 9.13.0 Release 9 Clause 8.8   EPS Bearer ID (EBI)
     */
    modulepar Bit4 PX_EBI := '0101'B;
    
    
    
    
    
    
    
    
    modulepar charstring PX_VISITED_APN := "visited.com";
    
    
    modulepar charstring PX_CALLER_IMSI := "33614000000001";
    modulepar charstring PX_CALLER_IMSI := "33614000000001";
    
    
+189 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading