Commit a9368f6e authored by wattelet's avatar wattelet
Browse files

First MME CL TC

parent 2c87e2b7
Loading
Loading
Loading
Loading
+46 −5
Original line number Diff line number Diff line
/**
 *  @author     STF 466
 *  @version    $Id: $
 *  @version    $Id$
 *  @desc       This module provides S6a test functions used by the DiameterS6a test cases with MME acting as SUT.
 */

@@ -19,7 +19,15 @@ module DiameterS6a_MME_TCFunctions {
    import from LibDiameter_Steps {
        function f_getVerdict
    };
    
    import from LibDiameter_Types_Base_AVPs  {
       type all
    };
    import from LibDiameter_Types_S6a_AVPs  {
       type all
    };
    import from LibDiameter_Templates  {
		template m_resultCode_diameterSuccess, m_resultCode
    };
    // DiameterS6a
    import from DiameterS6a_PICS {
        modulepar PX_MME_IUT_SUPPORT_NAS_PROTOCOL
@@ -187,15 +195,48 @@ module DiameterS6a_MME_TCFunctions {
        function f_TC_MME_CL_01() runs on TestAdapter {
            
            // Local variables
			var User_Name_AVP               v_user_Name         := m_user_Name ( PX_INVALID_USR_NAME );
            var Auth_Session_State_AVP		v_noStateMaintained := m_auth_Session_State_noStateMaintained;
			var Cancellation_Type_AVP		v_cancellationType  := m_cancellationType_dummy;
            var Result_Code_AVP		        v_resultCode        := m_resultCode ( DIAMETER_SUCCESS_E );
            
            // Preamble
            f_preamble_MME();
            f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Preamblue done. ***");
            
            // Test Body
            // Clause 'when'
            // TP 'when': 
			HSS_S6a.send ( m_mmeCancelLocationRequest ( md_CLR_TCs ( vc_sessionId, md_clrBodyAvps_01 (
			                    v_noStateMaintained,                    // containing an Auth-Session-State AVP indicating NO_STATE_MAINTAINED
				                vc_originHost,                          // containing an Origin-Host AVP
				                vc_originRealm,                         // containing an Origin-Realm AVP
                                vc_destinationHost,                     // containing a Destination-Host AVP
				                vc_destinationRealm,                    // containing a Destination-Realm AVP
			                    v_user_Name,                            // containing a User-Name AVP
			                    v_cancellationType ))));
			
            // Clause 'then'
            // TP 'then': the IUT sends a CL-Answer 
            tc_ac.start;
            alt {
                []  HSS_S6a.receive ( mw_hssCancelLocationAnswer ( mdw_CLA_TCs ( vc_sessionId, mdw_claBodyAvps_01 (
				                v_resultCode,                           // containing a Result-Code AVP indicating DIAMETER_SUCCESS
				                v_noStateMaintained,                    // containing an Auth-Session-State AVP indicating NO_STATE_MAINTAINED
                                vc_originHost,                          // containing an Origin-Host AVP
                                vc_originRealm )))) {                   // containing an Origin-Realm AVP
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    log("*** " & __SCOPE__ & ": PASS: Expected was received. ***");
                }
                []  tc_ac.timeout {
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***");
                }
            } // End of alt
            
            // Postamble
            f_postamble_MME();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_MME_CL_01
        
+107 −69
Original line number Diff line number Diff line
@@ -1070,6 +1070,14 @@ module DiameterS6a_Templates {
            
            group S6aBasic_request_templates_send {
                
                /**
                 * @desc Main receive template for MME_S6a port
                 * @param p_CLR_MSG CL-Request receive template message
                 */
                template (present) DIAMETER_MSG m_mmeCancelLocationRequest(in template (present) CLR_MSG p_CLR_MSG) := {
                    cLR_MSG := p_CLR_MSG
                } // End of tempate m_mmeCancelLocationRequest
                
                /**
                 * @desc Send template specifying no state maintained
                 */
@@ -1182,15 +1190,13 @@ module DiameterS6a_Templates {
                aVP_Data := p_aVP_Data
                } // End of template m_visitedPLMNId_dummy
                
                
                
            } // End of group S6aBasic_request_templates_send

            group S6basic_request_templates_receive {
                
                /**
                 * @desc Main receive template for MME_S6a port
                 * @param p_uLR_MSG UL-Answer receive template message
                 * @param p_s6a_ULR_MSG UL-Request receive template message
                 */
                template (present) DIAMETER_MSG mw_hssUpdateLocationRequest(in template (present) ULR_MSG p_uLR_MSG) := {
                    uLR_MSG := p_uLR_MSG
@@ -1198,28 +1204,12 @@ module DiameterS6a_Templates {

                /**
                 * @desc Main receive template for MME_S6a port
                 * @param p_uLA_MSG UL-Answer receive template message
                 * @param p_s6a_CCA_MSG UL-Answer receive template message
                 */
                template (present) DIAMETER_MSG mw_mmeUpdateLocationAnswer(in template (present) ULA_MSG p_uLA_MSG) := {
                    uLA_MSG := p_uLA_MSG
                } // End of tempate mw_mmeUpdateLocationAnswer
                
                /**
                 * @desc Main receive template for MME_S6a port
                 * @param p_cLR_MSG CL-Request receive template message
                 */
                template (present) DIAMETER_MSG mw_mmeCancelLocationRequest(in template (present) CLR_MSG p_cLR_MSG) := {
                    cLR_MSG := p_cLR_MSG
                } // End of tempate mw_mmeCancelLocationRequest
                
                /**
                 * @desc Main receive template for MME_S6a port
                 * @param p_cLA_MSG CL-Answer receive template message
                 */
                template (present) DIAMETER_MSG mw_mmeCancelLocationAnswer(in template (present) CLA_MSG p_cLA_MSG) := {
                    cLA_MSG := p_cLA_MSG
                } // End of tempate mw_mmeCancelLocationAnswer
                
            } // End of group S6basic_request_templates_receive

            group S6aBasic_answer_templates_send {
@@ -1227,6 +1217,14 @@ module DiameterS6a_Templates {

            group S6aBasic_answer_templates_receive {

                /**
                 * @desc Main receive template for HSS_S6a port
                 * @param p_s6a_CLA_MSG CL-Answer receive template message
                 */
                template (present) DIAMETER_MSG mw_hssCancelLocationAnswer ( in template (present) CLA_MSG p_CLA_MSG) := {
                    cLA_MSG := p_CLA_MSG
                } // End of tempate mw_hssCancelLocationAnswer
                
                /**
                 * @desc Generic received ULA_Flags_AVP message
                 * @see ETSI TS 129 272 V10.8.0 (2013-07) Clause 7.3.8    ULA-Flags
@@ -1250,21 +1248,6 @@ module DiameterS6a_Templates {
                     aVP_Data := p_aVP_Data
                } // End of tempate mw_ula_Flags_AVP
                
                template (value) Cancellation_Type_AVP mw_cancellationType_dummy := {
                    aVP_Header          := m_aVP_HeaderVid_Mbit1 (
                        c_cancellation_Type_AVP_Code, 
                        4, 
                        c_vendId3gpp 
                    ),
                    cancellation_Type   := PX_CANCELLATION_TYPE
                } // End of template mw_cancellationType_dummy
                
                template (value) Cancellation_Type_AVP mw_cancellationType(
                                                                           in template (value) Cancellation_Type_Code p_cancellation_Type
                ) modifies mw_cancellationType_dummy := {
                    cancellation_Type := p_cancellation_Type
                } // End of template mw_cancellationType
                
            } // End of group S6aBasic_answer_templates_receive

        } // End of group S6aBase_templates
@@ -1287,17 +1270,49 @@ module DiameterS6a_Templates {
                } // End of tempate md_ULR_TCs
                 
                /**
                 * @desc Receive template for CLA 
                 * @desc Send template for CLR 
                 * @param p_sessionId   Session identifier
                 * @param p_claBody     CLA message body
                 * @param p_clrBody     CLR message body
                 */
                template (value) CLA_MSG md_CLA_TCs(
                template (value) CLR_MSG md_CLR_TCs (
                                                       in template (value) Session_Id_AVP p_sessionId, 
                                                    in template (value) CLA_Body_AVP p_claBody
                ) modifies m_S6a_CLA_dummy := {
                                                       in template (value) CLR_Body_AVP p_clrBody
                ) modifies m_S6a_CLR_dummy := {
                    session_Id  := p_sessionId,
                    cLA_Body    := p_claBody
                } // End of template md_CLA_TCs
                    cLR_Body    := p_clrBody
                } // End of tempate md_CLR_TCs

                group t_TC_HSS_CLR {

                     /**
                     * @desc Send template for CLR message body 
                     * @param p_auth_Session_State  Specifies if the state is maintained for a particular session
                     * @param p_originHost          Identifies the endpoint that originated the Diameter message
                     * @param p_originRealm         Realm of the originator
                     * @param p_destinationHost     The Host to which the message is to be routed
                     * @param p_destinationRealm    The realm to which the message is to be routed
                     * @param p_user_Name           User-Name
                     * @param p_cancellation_Type
                     */
                    template (value) CLR_Body_AVP md_clrBodyAvps_01(
                                                                       in template (value) Auth_Session_State_AVP p_auth_Session_State,
                                                                       in template (value) Origin_Host_AVP p_originHost,
                                                                       in template (value) Origin_Realm_AVP p_originRealm,
					                                                   in template (value) Destination_Host_AVP p_destinationHost,
                                                                       in template (value) Destination_Realm_AVP p_destinationRealm,
                                                                       in template (value) User_Name_AVP p_user_Name,
                                                                       in template (value) Cancellation_Type_AVP p_cancellation_Type
                    ) modifies m_S6a_CLR_Body_dummy := {
                        auth_Session_State  := p_auth_Session_State, 
                        origin_Host         := p_originHost,
                        origin_Realm        := p_originRealm,
						destination_Host    := p_destinationHost,
                        destination_Realm   := p_destinationRealm,
                        user_Name           := p_user_Name,
						cancellation_Type   := p_cancellation_Type
                    } // End of tempate md_clrBodyAvps_01
 
                } // End of group t_TC_HSS_CLR

                /**
                 * @desc Send emplates for TC_HSS_UL_01
@@ -1534,17 +1549,40 @@ module DiameterS6a_Templates {
                } // End of template mdw_ULA_TCs
                   
                /**
                 * @desc Receive template for CLR 
                 * @desc Receive template for CLA 
                 * @param p_sessionId   Session identifier
                 * @param p_clrBody     CLR message body
                 * @param p_claBody     CLA message body
                 */
                template (present) CLR_MSG mdw_CLR_TCs(
                template (present) CLA_MSG mdw_CLA_TCs (
                                                       in template (present) Session_Id_AVP p_sessionId, 
                                                         in template (present) CLR_Body_AVP p_clrBody
                ) modifies mw_S6a_CLR_dummy := {
                                                       in template (present) CLA_Body_AVP p_claBody
                ) modifies m_S6a_CLA_dummy := {
                    session_Id  := p_sessionId,
                    cLR_Body    := p_clrBody
                } // End of template mdw_CLR_TCs
                    cLA_Body    := p_claBody
                } // End of tempate mdw_CLA_TCs

                group t_TC_HSS_CLA {

                     /**
                     * @desc Send template for CLR message body 
                     * @param p_auth_Session_State  Specifies if the state is maintained for a particular session
                     * @param p_originHost          Identifies the endpoint that originated the Diameter message
                     * @param p_originRealm         Realm of the originator
                     * @param p_result              Result of CLR execution
                     */
                    template (value) CLA_Body_AVP mdw_claBodyAvps_01 (
                                                                       in template (value) Result_Code_AVP p_result,
                                                                       in template (value) Auth_Session_State_AVP p_auth_Session_State,
                                                                       in template (value) Origin_Host_AVP p_originHost,
                                                                       in template (value) Origin_Realm_AVP p_originRealm
                    ) modifies m_S6a_CLA_Body_dummy := {
                        result_Code         := p_result,
                        auth_Session_State  := p_auth_Session_State, 
                        origin_Host         := p_originHost,
                        origin_Realm        := p_originRealm
                    } // End of tempate mdw_claBodyAvps_01
 
                } // End of group t_TC_HSS_CLA
                
                /**
                 * @desc Receive templates for TC_HSS_UL_01