Commit 887b0ddb authored by garciay's avatar garciay
Browse files

Implemented test case function f_TC_HSS_UL_03()

parent a43dfe43
Loading
Loading
Loading
Loading
+80 −8
Original line number Diff line number Diff line
@@ -16,14 +16,15 @@ module DiameterS6a_HSS_TCFunctions {
    //import from LibCommon_VerdictControl all;
    
    // LibDiameter 
    import from LibDiameter_Templates {
        template mw_resultCode
    };
    import from LibDiameter_Steps {
        function f_getVerdict
    };
    
    // DiameterS6a
    import from DiameterS6a_TypesAndValues {
        type 
            DIAMETER_S6a_HSS_Initiated_Message
    };
    import from DiameterS6a_Templates all; 
    import from DiameterS6a_PIXITS all;
    import from DiameterS6a_Steps {
@@ -33,7 +34,8 @@ module DiameterS6a_HSS_TCFunctions {
        altstep hss_default
    };
    import from DiameterS6a_TestSystem {
        type TestAdapter
        type 
            TestAdapter
    };
    
    // 5.2.2.1 Update Location
@@ -143,8 +145,8 @@ module DiameterS6a_HSS_TCFunctions {
                             ),
                             m_visited_Network_Identifier_AVP(PX_VISITED_NTW_ID) //     containing Visited-Network-Identifier AVP
                        )
                    ) // End of md_ulrBodyAvps_TC_01
                ) // // End of md_ULR_TC_01
                    ) // End of md_ulrBodyAvps_TC_02
                ) // // End of md_ULR_TC_02
            );
            
            // Clause 'then': the IUT sends a UL-Answer
@@ -173,12 +175,20 @@ module DiameterS6a_HSS_TCFunctions {
            } // End of 'altstep' statement
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_02
        
        /**
         * @desc Verify that the IUT shall check whether subscription data exists for IMSI and if not IUT shall return appropriate Result-Code AVP
         * @verdict pass on success, fail on error or inconc on timeout only 
         */
        function f_TC_HSS_UL_03() runs on TestAdapter {
            
            // Local variables
            var DIAMETER_S6a_HSS_Initiated_Message v_result;
            
            // Preamble
            f_preamble_HSS();
@@ -186,11 +196,52 @@ module DiameterS6a_HSS_TCFunctions {
            log("*** " & __SCOPE__ & ": INFO: Preamblue done. ***");
            
            // Test Body
            // Clause 'when'
            // Clause 'when': the IUT receives a UL-Request
            f_triggerUlrMessage(
                md_ULR_TCs( 
                    vc_sessionId,
                    md_ulrBodyAvps_TC_03(
                        m_user_Name(PX_INVALID_USR_NAME)    // containing a User-Name AVP indicating not existing IMSI
                    ) // End of md_ulrBodyAvps_TC_03
                ) // // End of md_ULR_TC_03
            );
            
            // Clause 'then'
            // Clause 'then': the IUT sends a UL-Answer
            tc_ac.start;
            alt {
                [] MME_S6a.receive( 
                    mw_mmeUpdateLocationRequest(
                        mdw_ULA_TCs( 
                            ?,
                            mdw_ulaBodyAvps_TC_03( 
                                mw_experimentalResult(                  // containing an Experimental-Result AVP
                                    mw_experimentalResultCode(          //     containing an Experimental-Result-Code AVP
                                        DIAMETER_ERROR_USER_UNKNOWN_E   //     indicating DIAMETER_ERROR_USER_UNKNOWN
                )))))) -> value v_result { // Expected ULR-Answer message 
                    if (ispresent(v_result.s6a_CCA_MSG.uLA_Body.result_Code)) { // not containing a Result-Code AVP
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        log("*** " & __SCOPE__ & ": FAIL: Result-Code AVP was not expected here. ***");
                    } else if(ispresent(v_result.s6a_CCA_MSG.uLA_Body.ula_Flags)) { // not containing a ULA-Flags AVP
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        log("*** " & __SCOPE__ & ": FAIL: ULA-Flags AVP was not expected here. ***");
                    } else if(ispresent(v_result.s6a_CCA_MSG.uLA_Body.subscription_Data)) { // not containing a Subscription-Data AVP
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        log("*** " & __SCOPE__ & ": FAIL: Subscription-Data AVP was not expected here. ***");
                    } else {
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        log("*** " & __SCOPE__ & ": PASS: Unexpected was received. ***");
                    }
                }
                [] tc_ac.timeout {
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***");
                }
            } // End of 'altstep' statement
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_03
        
@@ -227,6 +278,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_05
        
@@ -263,6 +317,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_07
        
@@ -281,6 +338,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_08
        
@@ -299,6 +359,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_09
        
@@ -317,6 +380,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_10
        
@@ -335,6 +401,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_11
        
@@ -353,6 +422,9 @@ module DiameterS6a_HSS_TCFunctions {
            // Clause 'then'
            
            // Postamble
            f_postamble_HSS();
            f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
            log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            
        } // End of TC function f_TC_HSS_UL_12
        
+7 −2
Original line number Diff line number Diff line
@@ -116,8 +116,13 @@ module DiameterS6a_PIXITS {
         * @desc The user name
         * @see  ETSI DTS/INT-094-1 V0.0.3 (2013-11) A.x/x 
         */
        modulepar charstring PX_USR_NAME := "userName";
        modulepar UTF8String PX_USR_NAME := "userName";
        
        /**
         * @desc An invalid user name
         * @see  ETSI DTS/INT-094-1 V0.0.3 (2013-11) A.x/x 
         */
        modulepar UTF8String PX_INVALID_USR_NAME := "unknown";
        /**
         * @desc The user name
         * @see  ETSI DTS/INT-094-1 V0.0.3 (2013-11) A.x/x 
+76 −23
Original line number Diff line number Diff line
@@ -22,15 +22,18 @@ module DiameterS6a_Templates {
    import from LibDiameter_TypesAndValues  {
        type        Command_Flags, Diameter_Identity, UTF8String, RAT_Type_AVP, Destination_Host_AVP,
                    Destination_Realm_AVP, Origin_Host_AVP, Origin_Realm_AVP, Session_Id_AVP,
                    Auth_Session_State_AVP, User_Name_AVP, RAT_Type, Result_Code_AVP,
                    IpAddress;
                    Auth_Session_State_AVP, User_Name_AVP, RAT_Type, 
                    Result_Code_Type, Experimental_Result_Type, Result_Code_AVP, Experimental_Result_AVP, Experimental_Result_Code_AVP,
                    IpAddress, UTF8String;
        const       c_versionId, c_vendId3gpp, c_destination_Host_AVP_Code, c_destination_Realm_AVP_Code,
                    c_origin_Host_AVP_Code, c_origin_Realm_AVP_Code, c_session_Id_AVP_Code, c_rAT_Type_AVP_Code
                    c_origin_Host_AVP_Code, c_origin_Realm_AVP_Code, c_session_Id_AVP_Code, c_rAT_Type_AVP_Code,
                    c_result_Code_AVP_Code, c_experimental_Result_AVP_Code, c_experimental_Result_Code_AVP_Code
    };
    import from LibDiameter_Templates  {
        template    m_sessionId_dummy, m_auth_Session_State_dummy, m_originHost_dummy, m_originRealm_dummy,
                    m_destinationRealm_dummy, m_destinationHost_dummy, m_user_Name_dummy, m_aVP_HeaderVid_Mbit1, m_cmdFlagsReq,
                    mw_cmdFlags, m_cmdFlagsAns, m_aVP_HeaderVid_Mbit0
                    mw_cmdFlags, m_cmdFlagsAns, 
                    m_aVP_Header_Mbit1, m_aVP_HeaderVid_Mbit0 
    };
    
    // DiameterS6a
@@ -298,6 +301,34 @@ module DiameterS6a_Templates {
            
            group awaitingTemplatesForAVPs{
                
                template (present) Result_Code_AVP mw_resultCode(template (present) Result_Code_Type p_avpData) := {
                    aVP_Header := m_aVP_HeaderVid_Mbit1 ( 
						c_result_Code_AVP_Code, 
						4, 
						c_vendId3gpp 
				    ),
                    aVP_Data := p_avpData
                }
                
                template (present) Experimental_Result_AVP mw_experimentalResult(template (present) Experimental_Result_Code_AVP p_experimental_Result_Code) := {
                    aVP_Header := m_aVP_HeaderVid_Mbit1 ( 
					   c_experimental_Result_AVP_Code, 
                        4, 
                        c_vendId3gpp 
                    ),
                    vendor_Id := ?,
                    experimental_Result_Code := p_experimental_Result_Code
                }
    
                template (present) Experimental_Result_Code_AVP mw_experimentalResultCode(template (present) Experimental_Result_Type p_avpData) := {
                    aVP_Header := m_aVP_HeaderVid_Mbit1 ( 
					   c_experimental_Result_Code_AVP_Code, 
                        4, 
                        c_vendId3gpp 
                    ),
                    aVP_Data := p_avpData
                }
    
            } // End of group awaitingTemplatesForAVPs
            
        } // End of group SpecificAVPHeaders
@@ -1063,7 +1094,7 @@ module DiameterS6a_Templates {
                 * @desc Send template for user name
                 * @param p_aVP_Data The user name
                 */
                template (value) User_Name_AVP m_user_Name( in charstring p_aVP_Data )
                template (value) User_Name_AVP m_user_Name( in UTF8String p_aVP_Data )
                modifies m_user_Name_dummy := {
                    aVP_Data := p_aVP_Data
                } // End of tempate m_user_Name
@@ -1156,23 +1187,6 @@ module DiameterS6a_Templates {
                    aVP_Data := p_aVP_Data
                } // End of template m_visited_Network_Identifier_AVP
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
            } // End of group S6aBasic_request_templates_send

            group S9basic_request_templates_receive {
@@ -1319,6 +1333,27 @@ module DiameterS6a_Templates {
                    
                } // End of group t_TC_HSS_UL_02
                
                /**
                 * @desc Send templates for TC_HSS_UL_03
                 */
                group t_TC_HSS_UL_03 {
                    
                    /**
                     * @desc Send template for ULR message body 
                     * @param p_user_Name           User-Name
                     */
                    template (value) ULR_Body_AVP md_ulrBodyAvps_TC_03(
                                                                       in template (value) User_Name_AVP p_user_Name
                    ) modifies m_S6a_ULR_Body_dummy := {
                        origin_Host         := valueof(m_originHost(PX_ORIGIN_HOST)),
                        origin_Realm        := valueof(m_originRealm(PX_ORIGIN_REALM)),
                        destination_Realm   := valueof(m_destinationRealm(PX_DESTINATION_REALM)),
                        destination_Host    := valueof(m_destinationHost(PX_DESTINATION_HOST)), 
                        user_Name           := p_user_Name
                    } // // End of tempate md_ulrBodyAvps_TC_03
                    
                } // End of group t_TC_HSS_UL_03
                
            } // End of group S6aModified_request_templates_send

            group S6aModified_request_templates_receive {
@@ -1419,6 +1454,24 @@ module DiameterS6a_Templates {
                    
                } // End of group t_TC_HSS_UL_02
                
                group t_TC_HSS_UL_03 {
                    
                    /**
                     * @desc Receive template for ULA message body
                     * @param p_resultCode          Indicates whether a particular request was completed successfully or an error occurred
                     * @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_ula_Flags           ULA Bit mask
                     */
                    template (present) ULA_Body_AVP mdw_ulaBodyAvps_TC_03( 
                                                                in template Experimental_Result_AVP p_experimental_Result
                    ) modifies mw_S6a_ULA_Body_dummy := {
                        experimental_Result := p_experimental_Result
                    } // End of template mdw_ulrBodyAvps_TC_03
                    
                } // End of group t_TC_HSS_UL_03
                
            } // End of group S6aModified_answer_templates_receive
            
        } // End of group S6aModified_templates