Commit b8e235a6 authored by garciay's avatar garciay
Browse files

STF500-Week#49:

  - Validation Cx/HSS: Add full Cx register/de-register
  - Validation Cx/CSCF: Add full Cx register/de-register
  - Bug fixed in Codec
parent 5d4136fc
Loading
Loading
Loading
Loading
+93 −124

File changed.

Preview size limit exceeded, changes collapsed.

+218 −141
Original line number Diff line number Diff line
@@ -14,10 +14,7 @@

    // LibDiameter
    import from LibDiameter_Types_Base_AVPs all;
    import from LibDiameter_TypesAndValues {
        const c_applId3GPPCxDx;
        type MAA_Body_AVP, UAA_Body_AVP;
    }
    import from LibDiameter_TypesAndValues all;
    import from LibDiameter_Templates all;
    import from LibDiameter_Steps all;
    import from LibDiameter_PIXITS all;
@@ -404,6 +401,156 @@

    group GeneralFunctions {
        
    } // End of group GeneralFunctions

    group Scscf_Functions {
        
        /**
         * @desc Initiate a full CSCF registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.1 Registration– user not registered
         */
        function f_cscfRegistrationCx() runs on DiameterCx {
            f_cscfInitialRegistrationCx();
            f_w_MAR_MAA(DIAMETER_SUCCESS_E);
            f_cscfSecondRegistratonCx();
            f_w_SAR_SAA(DIAMETER_SUCCESS_E);
        } // End of function f_cscfRegistrationCx 
        
        /**
         * @desc Initiate the first registration with DIAMETER_FIRST_REGISTRATION experimental result
         * @param p_userName
         * @param p_publicIdentity
         * @param p_uar_Flags_Cx
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.1 Registration– user not registered
         */
        function f_cscfInitialRegistrationCx() runs on DiameterCx {
            
            f_w_UAR_UAA(
                        -, 
                        omit, 
                        DIAMETER_FIRST_REGISTRATION_E
            );
            
        } // End of function f_cscfInitialRegistrationCx
        
        /**
         * @desc Initiate the second registration with SUBEQUENT_REGISTRATION experimental result
         * @param p_uar_Flags_Cx 
         * @verdict pass on success, fail otherwise
         */
        function f_cscfSecondRegistratonCx() runs on DiameterCx {
            
            f_w_UAR_UAA(
                        -, 
                        omit, 
                        DIAMETER_FIRST_REGISTRATION_E
            );
            
        } // End of function f_cscfSecondRegistratonCx 
        
        /**
         * @desc Initiate a full CSCF de-registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.1 Registration– user not registered
         */
        function f_cscfDeregistrationCx() runs on DiameterCx {
            f_w_UAR_UAA(mw_UAR_Body_dummy, DIAMETER_SUCCESS_E);
            f_w_SAR_SAA(DIAMETER_SUCCESS_E);
        } // End of function f_cscfRegistrationCx 
        
        function f_s_MAR_MAA () runs on DiameterCx {
            f_send_MAR(m_MAR_Msg( 
                            vc_sessionId, 
                            m_MAR_withServerName(
                                vc_originHost,
                                vc_originRealm,
                                vc_destinationRealm,
                                vc_userName,
                                vc_publicIdentity,
                                m_sIPNumberAuthItems(1),
                                m_sIPAuthDataItem_authScheme(m_sIPAuthenticationScheme("DIGEST")), //TODO: DIGEST_E or DIGEST_AKAv1_MD5_E need to be set
                                vc_serverName
                            )
            ));
            f_awaiting_MAA(mw_MAA_Msg(vc_sessionId, mw_MAA_basic))
        }
        
        function f_s_SAR_SAA (
                              in Srv_Assgmt_Type_Code p_serverAssignmentType := UNREGISTERED_USER_E
        ) runs on DiameterCx {
            f_send_SAR(m_SAR_Msg( 
                            vc_sessionId, 
                            m_SAR_withUserNameAndPID(
                                vc_originHost,
                                vc_originRealm,
                                vc_destinationRealm,
                                vc_serverName,
                                m_serverAssignmentType(p_serverAssignmentType),
                                m_userDataAlreadyAvailable(USER_DATA_NOT_AVAILABLE_E),
                                omit,
                                valueof(vc_publicIdentity)
                            )
            ));
            f_awaiting_SAA(mw_SAA_Msg(vc_sessionId, mw_SAA_basic))
        }
        
        /**
         * @desc Initiate an UAR/UAA de-registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.3 Registration– user not registered
         */
        function f_s_UAR_UAA_deRegistration() runs on DiameterCx {
            
            f_send_UAR(
                m_UAR_Msg(
                    vc_sessionId, 
                    m_UAR_UauthDhostFlags(
                        vc_originHost, 
                        vc_originRealm, 
                        vc_destinationRealm, 
                        vc_userName, 
                        vc_publicIdentity, 
                        vc_visitedNetworkId, 
                        m_user_Authorization_Dereg_Cx, 
                        vc_destinationHost, 
                        m_uar_Flags_Cx
            )));
            
            f_awaiting_UAA(
                mw_UAA_Msg(
                    vc_sessionId, 
                    mw_UAA_ResulExpreSernaSerca(
                        mw_resultCode(
                            DIAMETER_SUCCESS_E
                        ),
                        *,
                        *,
                        *
            )));
            
        } // End of function f_s_UAR_UAA_deRegistration 
        
        /**
         * @desc Initiate an SAR/SAA de-registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.3 Registration– user not registered
         */
        function f_s_SAR_SAA_deRegistration() runs on DiameterCx {
            
            f_s_SAR_SAA(USER_DEREGISTRATION_E);                                         // SAR de-registration
            
        } // End of function f_s_SAR_SAA_deRegistration 
        
    } // End of group ScscfFunctions
    group Hss_Functions {
        
        /**
         * @desc Initiate a full HSS registration
         * @param p_userName
@@ -418,10 +565,10 @@
                                     in charstring p_publicIdentity := PX_PublicIdentity,
                                     in template (omit) UAR_Flags_AVP p_uar_Flags_Cx := omit
        ) runs on DiameterCx {
            f_initialRegistrationCx(p_userName, p_publicIdentity, p_uar_Flags_Cx);   // With DIAMETER_FIRST_REGISTRATION
            f_hssInitialRegistrationCx(p_userName, p_publicIdentity, p_uar_Flags_Cx);   // With DIAMETER_FIRST_REGISTRATION
            f_s_MAR_MAA();
            f_secondRegistratonCx(p_uar_Flags_Cx);                                   // With SUBEQUENT_REGISTRATION
            f_s_SAR_SAA(REGISTRATION_E);                                             // SAR registration
            f_hssSecondRegistratonCx(p_uar_Flags_Cx);                                   // With SUBEQUENT_REGISTRATION
            f_s_SAR_SAA(UNREGISTERED_USER_E);                                        // SAR registration
        } // End of function f_hssRegistrationCx 
        
        /**
@@ -433,7 +580,7 @@
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.1 Registration– user not registered
         */
        function f_initialRegistrationCx(
        function f_hssInitialRegistrationCx(
                                         in charstring p_userName := PX_UserName,
                                         in charstring p_publicIdentity := PX_PublicIdentity,
                                         in template (omit) UAR_Flags_AVP p_uar_Flags_Cx := omit
@@ -472,14 +619,14 @@
                                ?, 
                                DIAMETER_FIRST_REGISTRATION_E
            )))));
        } // End of function f_initialRegistrationCx
        } // End of function f_hssInitialRegistrationCx
        
        /**
         * @desc Initiate the second registration with SUBEQUENT_REGISTRATION experimental result
         * @param p_uar_Flags_Cx 
         * @verdict pass on success, fail otherwise
         */
        function f_secondRegistratonCx(
        function f_hssSecondRegistratonCx(
                                       in template (omit) UAR_Flags_AVP p_uar_Flags_Cx := omit
        ) runs on DiameterCx {
            
@@ -509,7 +656,7 @@
                                ?, 
                                DIAMETER_SUBSEQUENT_REGISTRATION_E
            )))));
        } // End of function f_secondRegistratonCx 
        } // End of function f_hssSecondRegistratonCx 
        
        /**
         * @desc Initiate a full HSS de-registration
@@ -525,101 +672,11 @@
            
        } // End of function f_hssRegistrationCx
        
        /**
         * @desc Initiate an UAR/UAA de-registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.3 Registration– user not registered
         */
        function f_s_UAR_UAA_deRegistration() runs on DiameterCx {
            
            f_send_UAR(
                m_UAR_Msg(
                    vc_sessionId, 
                    m_UAR_UauthDhostFlags(
                        vc_originHost, 
                        vc_originRealm, 
                        vc_destinationRealm, 
                        vc_userName, 
                        vc_publicIdentity, 
                        vc_visitedNetworkId, 
                        m_user_Authorization_Dereg_Cx, 
                        vc_destinationHost, 
                        m_uar_Flags_Cx
            )));
            
            f_awaiting_UAA(
                mw_UAA_Msg(
                    vc_sessionId, 
                    mw_UAA_ResulExpreSernaSerca(
                        mw_resultCode(
                            DIAMETER_SUCCESS_E
                        ),
                        *,
                        *,
                        *
            )));
            
        } // End of function f_s_UAR_UAA_deRegistration 
        
        /**
         * @desc Initiate an SAR/SAA de-registration
         * @verdict pass on success, fail otherwise
         * 
         * @see ETSI TS 129 228 V12.7.0 (2015-10) Clause A.4.3 Registration– user not registered
         */
        function f_s_SAR_SAA_deRegistration() runs on DiameterCx {
            
            f_s_SAR_SAA(USER_DEREGISTRATION_E);
            
        } // End of function f_s_SAR_SAA_deRegistration 
        
    } // End of group GeneralFunctions

    group Scscf_Functions {
        
        function f_s_MAR_MAA () runs on DiameterCx {
            f_send_MAR(m_MAR_Msg( 
                            vc_sessionId, 
                            m_MAR_withServerName(
                                vc_originHost,
                                vc_originRealm,
                                vc_destinationRealm,
                                vc_userName,
                                vc_publicIdentity,
                                m_sIPNumberAuthItems(1),
                                m_sIPAuthDataItem_authScheme(m_sIPAuthenticationScheme("DIGEST")), //TODO: DIGEST_E or DIGEST_AKAv1_MD5_E need to be set
                                vc_serverName
                            )
            ));
            f_awaiting_MAA(mw_MAA_Msg(vc_sessionId, mw_MAA_basic))
        }
        
        function f_s_SAR_SAA (
                              in Srv_Assgmt_Type_Code p_serverAssignmentType := UNREGISTERED_USER_E
        function f_w_UAR_UAA(
                              template (present) UAR_Body_AVP p_uAR := mw_UAR,
                              template  Result_Code_Type p_resultCode,
                              template  Experimental_Result_Type p_expResultCode := omit
        ) runs on DiameterCx {
            f_send_SAR(m_SAR_Msg( 
                            vc_sessionId, 
                            m_SAR_withUserNameAndPID(
                                vc_originHost,
                                vc_originRealm,
                                vc_destinationRealm,
                                vc_serverName,
                                m_serverAssignmentType(p_serverAssignmentType),
                                m_userDataAlreadyAvailable(USER_DATA_NOT_AVAILABLE_E),
                                omit,
                                valueof(vc_publicIdentity)
                            )
            ));
            f_awaiting_SAA(mw_SAA_Msg(vc_sessionId, mw_SAA_basic))
        }
        
    } // End of group ScscfFunctions
    group Hss_Functions {
        
		function f_w_UAR_UAA (in template  Result_Code_Type p_resultCode,
							  in template  Experimental_Result_Type p_expResultCode := omit )
		runs on DiameterCx {
            var template (omit) Result_Code_AVP         v_resultCodeAvp := omit;
            var template (omit) Experimental_Result_AVP v_expResultAvp  := omit;
            var template (value) UAA_Body_AVP            v_UAA;
@@ -633,7 +690,7 @@
            v_UAA := m_UAA_basic(vc_originHost, vc_originRealm,
                                 v_resultCodeAvp, v_expResultAvp);
            
			f_awaiting_UAR(mw_UAR_Msg(?, mw_UAR_Body_dummy));
            f_awaiting_UAR(mw_UAR_Msg(?, p_uAR));
            f_send_UAA(m_UAA_Msg(vc_sessionId, v_UAA));
        }

@@ -653,10 +710,30 @@
            v_MAA := m_MAA_basic(vc_originHost, vc_originRealm,
                                 v_resultCodeAvp, v_expResultAvp);
            
            f_awaiting_MAR(mw_MAR_Msg(?, mw_MAR_basic));
            f_awaiting_MAR(mw_MAR_Msg(?, mw_MAR)); // TODO To be refined a little beat
            f_send_MAA(m_MAA_Msg(vc_sessionId, v_MAA));
        }
        
        function f_w_SAR_SAA (in template (omit) Result_Code_Type p_resultCode,
                              in template (omit) Experimental_Result_Type p_expResultCode := omit )
        runs on DiameterCx {
            var template (omit)  Result_Code_AVP         v_resultCodeAvp := omit;
            var template (omit)  Experimental_Result_AVP v_expResultAvp  := omit;
            var template (value) MAA_Body_AVP            v_MAA;
            
            if(ispresent(p_resultCode)){
                v_resultCodeAvp := m_resultCode(valueof(p_resultCode));
            }else if(ispresent(p_expResultCode)){
                v_expResultAvp := m_experimentalResult(valueof(p_expResultCode));
            }
            
            v_MAA := m_MAA_basic(vc_originHost, vc_originRealm,
                                 v_resultCodeAvp, v_expResultAvp);
            
            f_awaiting_SAR(mw_SAR_Msg(?, mw_SAR)); // TODO To be refined a little beat
            f_send_SAA(m_SAA_Msg(vc_sessionId, m_SAA_basic(vc_originHost, vc_originRealm, m_resultCode(DIAMETER_SUCCESS_E))));
        }
        
    } // End of group ScscfFunctions
    
} // end module DiameterCx_Steps
 No newline at end of file
+17 −17
Original line number Diff line number Diff line
@@ -1323,7 +1323,7 @@ module DiameterCxDx_Templates {
                destination_Realm := ?,                   // mandatory in TS129 229
                user_Name := ?,                           // mandatory in TS129 229
                sIP_User_Data := *,                       // not in TS129 229
                sIP_Accounting_Information := ?,          // not in TS129 229
                sIP_Accounting_Information := *,          // not in TS129 229
                authorization_Lifetime := *,              // not in TS129 229
                auth_Grace_Period := *,                   // not in TS129 229
                supported_Features := *,                  // optional in TS129 229
@@ -1528,13 +1528,13 @@ module DiameterCxDx_Templates {
                }
                
                template (present) RTR_Body_AVP mw_RTR_publicIdentity(
                                                                      template (present) Origin_Host_AVP           p_originHost,
                                                                      template (present) Origin_Realm_AVP          p_originRealm,
                                                                      template (present) Destination_Host_AVP      p_destinationHost,
                                                                      template (present) Destination_Realm_AVP     p_destinationRealm,
                                                                      template (present) User_Name_AVP             p_userName,
                                                                      template (present) Deregistration_Reason_AVP p_deregistrationReason,
                                                                      template (present) Public_Identity_AVPs p_publicIdentity
                                                                      template (present) Origin_Host_AVP           p_originHost := ?,
                                                                      template (present) Origin_Realm_AVP          p_originRealm := ?,
                                                                      template (present) Destination_Host_AVP      p_destinationHost := ?,
                                                                      template (present) Destination_Realm_AVP     p_destinationRealm := ?,
                                                                      template (present) User_Name_AVP             p_userName := ?,
                                                                      template (present) Deregistration_Reason_AVP p_deregistrationReason := ?,
                                                                      template (present) Public_Identity_AVPs      p_publicIdentity := ?
                ) modifies mw_RTR_basic := {
                    public_Identity := p_publicIdentity //optional TS129 229
                }
@@ -1546,9 +1546,9 @@ module DiameterCxDx_Templates {

                template (present) MAR_Body_AVP mw_MAR(
                                                       template (present) User_Name_AVP             p_userName:=?,
                                                       template (present) Public_Identity_AVP       p_publicIdentity,
                                                       template (present) SIP_Number_Auth_Items_AVP p_sIpNumberAuthItems,
                                                       template (present) SIP_Auth_Data_Item_AVP p_sIpAuthDataItem,
                                                       template (present) Public_Identity_AVP       p_publicIdentity := ?,
                                                       template (present) SIP_Number_Auth_Items_AVP p_sIpNumberAuthItems := ?,
                                                       template (present) SIP_Auth_Data_Item_AVP    p_sIpAuthDataItem := ?,
                                                       template (present) Server_Name_AVP           p_server_Name := ?
                ) 
                modifies mw_MAR_basic := {
@@ -1560,11 +1560,11 @@ module DiameterCxDx_Templates {
                    server_Name := ?                          // mandatory in TS129 229
                }
                
                template (present) PPR_Body_AVP mw_PPR (template (present) Origin_Host_AVP           p_originHost,
                                                        template (present) Origin_Realm_AVP          p_originRealm,
                                                        template (present) Destination_Host_AVP      p_destinationHost,
                                                        template (present) Destination_Realm_AVP     p_destinationRealm,
                                                        template (present) User_Name_AVP             p_userName,
                template (present) PPR_Body_AVP mw_PPR (template (present) Origin_Host_AVP           p_originHost := ?,
                                                        template (present) Origin_Realm_AVP          p_originRealm := ?,
                                                        template (present) Destination_Host_AVP      p_destinationHost := ?,
                                                        template (present) Destination_Realm_AVP     p_destinationRealm := ?,
                                                        template (present) User_Name_AVP             p_userName := ?,
                                                        template User_Data_AVP                       p_userData := omit,
                                                        template Charging_Information_AVP            p_charging_Information := omit,
                                                        template SIP_Auth_Data_Item_AVP              p_sIP_Auth_Data_Item := omit
+0 −1
Original line number Diff line number Diff line
@@ -5070,7 +5070,6 @@ module DiameterCxDx_TestCases
                    
                    //Start
                    v_diameterComponent_hss.start(f_TC_CX_CSCF_MS_01_HSS());
                    //v_imsComponent_ue1.start(f_TC_CX_CSCF_MS_01_UE());
                    
                    // synchronize PTC on 3 sychronization points
                    f_serverSyncNClients(f_NrofCompsCx(),{c_prDone, c_tbDone, c_poDone});