Commit 51a1c434 authored by garciay's avatar garciay
Browse files

STF490:

1) Terminate RO_OCF_CH
2) Built with both TTCN-3 tools
parent 2a78d57e
Loading
Loading
Loading
Loading
+143 −6
Original line number Original line Diff line number Diff line
@@ -2133,10 +2133,147 @@ module DiameterRfRo_TCFunctions {
            
            
            // 5.2.3.1.6 Re-Authorization 
            // 5.2.3.1.6 Re-Authorization 
            group TP_RO_OCF_RE {
            group TP_RO_OCF_RE {
                
                /**
                 * @desc    Verify that the IUT can successfully process all mandatory AVPs in a CC-Request received due to Charging Data Transfer.
                 * @verdict pass on success, fail on error or inconc on timeout only 
                 */
                function f_TC_RO_OCF_RE_01() runs on DiameterRfRo { 
                    // Local variables
                    
                    // Preamble
                    f_preamble_Ro_CTF();
                    // Preamble action: CCR,CCA [Event] direct debeting action are exchanged
                    f_sendCCR_awaitCCA_(
                                        EVENT_REQUEST_E, 
                                        3,
                                        m_service_Context_Id(PX_SERVICE_CONTEXT_ID) 
                                        );
                    f_sendCCR_awaitCCA_(
                                        EVENT_REQUEST_E, 
                                        3,
                                        m_service_Context_Id(PX_SERVICE_CONTEXT_ID) 
                                        
                                        );
                    action("Indicate need for re-authorization"); // FIXME How to do it
                    f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
                    log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                    f_send_RAR(
                        md_rAR(
                            vc_sessionId,                      // containing a Session-ID AVP
                            md_rarBodyAvps(
                                vc_originHost,                 // containing an Origin-Host AVP
                                vc_originRealm,                // containing an Origin-Realm AVP
                                vc_destinationRealm,           // containing a Destination-Realm AVP
                                vc_destinationHost,            // containing a Destination-Host AVP
                                m_auth_Application_Id_AVP(     // containing an Auth-Application-Id AVP
                                    4                          //     indicating the value 4
                                ),
                                m_re_Auth_Request_dummy        // containing a Re-Auth-Request-Type AVP
                                                               //     indicating AUTHORIZE_ONLY
                            )
                        )
                    );

                    f_awaiting_RAA(
                        mdw_rAA(
                            vc_sessionId,                       // containing a Session-ID AVP
                            mdw_raaBodyAvps(
                                mw_resultCode(                  // containing a Result-Code AVP
                                    DIAMETER_SUCCESS_E          //     indicating DIAMETER_SUCCESS
                                ),
                                vc_originHost,                  // containing an Origin-Host AVP
                                vc_originRealm                  // containing an Origin-Realm AVP
                            )
                        )
                    );
                    action("The IUT accepts the message");
                    f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync

                    f_sendCCR_awaitCCA_(
                                        TERMINATION_REQUEST_E, 
                                        3
                                        );
                    f_postamble_Ro_CTF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                    
                } // End of function f_TC_RO_OCF_RE_01
                
            } // End of group TP_RO_OCF_RE
            } // End of group TP_RO_OCF_RE
            
            // 5.2.3.1.7 Failure Handling 
            // 5.2.3.1.7 Failure Handling 
            group TP_RO_OCF_FH {
            group TP_RO_OCF_FH {
                
                /**
                 * @desc    Verify that the IUT can successfully transmit Credit-Control-Failure-Handling AVP (CCFH) with price enquiry
                 * @verdict pass on success, fail on error or inconc on timeout only 
                 */
                function f_TC_RO_OCF_FH_01() runs on DiameterRfRo { 
                    // Local variables
                    
                    // Preamble
                    f_preamble_Ro_CTF();
                    action("Trigger 'temporarily prevented' failure"); // FIXME How to trigger 'temporarily prevented' failure
                    f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync
                    log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                    f_send_CCR(
                        md_cCR(
                            vc_sessionId,
                            md_ccrBodyAvps_TypeOfCharging(
                                vc_originHost,
                                vc_originRealm,
                                vc_destinationRealm,
                                md_cC_Request_Type_AVP(                     // containing a CC-Request-Type AVP 
                                    EVENT_REQUEST_E                         //     indicating EVENT_REQUEST
                                ),
                                m_cC_Request_Number_dummy,
                                -,
                                m_requested_Action_AVP(                     // containing a Requested-Action AVP
                                    PRICE_ENQUIRY_E                         //     indicating PRICE_ENQUIRY
                                ),
                                m_multiple_Services_Credit_Control_AVP(     // containing a Multiple-Services-Credit-Control AVP
                                    -,
                                    -,
                                    m_service_Identifier_AVP(               //     containing a Service-Identifier AVP
                                        0
                                    ) 
                                )
                            )
                        )
                    );

                    f_awaiting_CCA(
                        mdw_cCA(
                            vc_sessionId,
                            mdw_ccaBodyAvps_failure_handling(
                                mw_resultCode(                          // containing a Result-Code AVP
                                    DIAMETER_SUCCESS_E                  //     indicating DIAMETER_SUCCESS
                                ),
                                vc_originHost,
                                vc_originRealm,
                                mw_cC_Request_Type_AVP(                  // containing a CC-Request-Type AVP 
                                    EVENT_REQUEST_E                      //     indicating EVENT_REQUEST
                                ),
                                mw_cC_Request_Number_AVP,
                                mw_credit_Control_Failure_Handling_AVP(  // containing a Credit-Control-Failure-Handling AVP
                                    RETRY_AND_TERMINATE_E                //     indicating what to do if the IUT has been temporarily prevented
                                )
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); // sync

                    f_postamble_Ro_CTF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                    
                } // End of function f_TC_RO_OCF_FH_01
                
            } // End of group TP_RO_OCF_FH
            } // End of group TP_RO_OCF_FH
            
            // 5.2.3.1.8 Failover 
            // 5.2.3.1.8 Failover 
            group TP_RO_OCF_FA {
            group TP_RO_OCF_FA {
            } // End of group TP_RO_OCF_FA
            } // End of group TP_RO_OCF_FA
+82 −1
Original line number Original line Diff line number Diff line
@@ -5032,6 +5032,39 @@ module DiameterRfRo_Templates {
            modifies md_ccrBodyAvps_TypeOfCharging := { 
            modifies md_ccrBodyAvps_TypeOfCharging := { 
            } // End of template md_ccrBodyAvps_TariffChangesUsage
            } // End of template md_ccrBodyAvps_TariffChangesUsage
            
            
            /**
             * @desc Send template for RAR
             * @param p_sessionId   Session identifier
             * @param p_rarBody     RAR message body
             */
            template (value) RAR_MSG md_rAR(
                                            in template (value) Session_Id_AVP  p_sessionId,
                                            in template (value) RAR_Body_AVP    p_rarBody
            ) modifies m_RAR_dummy := {
                header := m_diameterHeaderReq_dummy(RAR_E, c_applIdRfRo),
                session_Id  := p_sessionId,
                rAR_Body    := p_rarBody
            } // End of template md_rAR
            
            /**
             * @desc Send template for RAR message body
             */
            template (value) RAR_Body_AVP md_rarBodyAvps( 
                                                         in template (value) Origin_Host_AVP            p_originHost,
                                                         in template (value) Origin_Realm_AVP           p_originRealm,
                                                         in template (value) Destination_Realm_AVP      p_destination_Realm,
                                                         in template (value) Destination_Host_AVP       p_destination_Host,
                                                         in template (value) Auth_Application_Id_AVP    p_auth_Application_Id,
                                                         in template (value) Re_Auth_Request_Type_AVP   p_re_Auth_Request_Type
            ) modifies m_RAR_Body_dummy := {
                    origin_Host             := p_originHost,
                    origin_Realm            := p_originRealm,
                    destination_Realm       := p_destination_Realm,
                    destination_Host        := p_destination_Host,
                    auth_Application_Id     := p_auth_Application_Id,
                    re_Auth_Request_Type    := p_re_Auth_Request_Type
            } // End of template md_rarBodyAvps
            
        } // End of group Ro_request_message_templates_send
        } // End of group Ro_request_message_templates_send
        
        
        group Ro_answer_message_templates_send { 
        group Ro_answer_message_templates_send { 
@@ -5137,6 +5170,20 @@ module DiameterRfRo_Templates {
                    multiple_Services_Credit_Control    := p_multiple_Services_Credit_Control
                    multiple_Services_Credit_Control    := p_multiple_Services_Credit_Control
            } // End of template mdw_ccrBodyAvps_TypeOfCharging
            } // End of template mdw_ccrBodyAvps_TypeOfCharging
            
            
            /**
             * @desc Receive template for RAA
             * @param p_sessionId   Session identifier
             * @param p_raaBody     RAA message body
             */
            template (present) RAA_MSG mdw_rAA(
                                               template (present) Session_Id_AVP  p_sessionId,
                                               template (present) RAA_Body_AVP    p_raaBody
            ) modifies mw_RAA_dummy := {
                header := mw_diameterHeaderReq_dummy(RAA_E, c_applIdRfRo),
                session_Id  := p_sessionId,
                rAA_Body    := p_raaBody
            } // End of template mdw_rAA
            
        } // End of group Ro_request_message_templates_revceive
        } // End of group Ro_request_message_templates_revceive
        
        
        group Ro_answer_message_templates_receive { 
        group Ro_answer_message_templates_receive { 
@@ -5252,6 +5299,33 @@ module DiameterRfRo_Templates {
                    remaining_Balance                   := p_remaining_Balance ifpresent
                    remaining_Balance                   := p_remaining_Balance ifpresent
                } // End of template mdw_ccaBodyAvps_xxx
                } // End of template mdw_ccaBodyAvps_xxx
                
                
                template (present) CCA_Body_AVP mdw_ccaBodyAvps_failure_handling( 
                                                                                 template (present) Result_Code_AVP                     p_resultCode := ?,
                                                                                 template (present) Origin_Host_AVP                     p_originHost := ?,
                                                                                 template (present) Origin_Realm_AVP                    p_originRealm := ?,
                                                                                 template (present) CC_Request_Type_AVP                 p_cC_Request_Type := ?,
                                                                                 template (present) CC_Request_Number_AVP               p_cC_Request_Number := ?,
                                                                                 template (present) Credit_Control_Failure_Handling_AVP p_credit_Control_Failure_Handling := ?
                ) modifies mw_CCA_Body_dummy := {
                    result_Code                        := p_resultCode,
                    origin_Host                        := p_originHost,
                    origin_Realm                       := p_originRealm,
                    auth_Application_Id                := mw_auth_Application_Id_AVP(4),
                    cC_Request_Type                    := p_cC_Request_Type,
                    cC_Request_Number                  := p_cC_Request_Number,
					credit_Control_Failure_Handling    := p_credit_Control_Failure_Handling
                } // End of template mdw_ccaBodyAvps_failure_handling
                
                template (present) RAA_Body_AVP mdw_raaBodyAvps(
                                                                template (present) Result_Code_AVP              p_resultCode := ?,
                                                                template (present) Origin_Host_AVP              p_originHost := ?,
                                                                template (present) Origin_Realm_AVP             p_originRealm := ?
                ) modifies mw_RAA_Body_dummy := {
                    result_Code                         := p_resultCode,
                    origin_Host                         := p_originHost,
                    origin_Realm                        := p_originRealm
                } // End of template mdw_raaBodyAvps
                
            } // End of group CCA_MSG_ 
            } // End of group CCA_MSG_ 
            
            
        } // End of group Ro_answer_message_templates_receive 
        } // End of group Ro_answer_message_templates_receive 
@@ -5658,6 +5732,13 @@ module DiameterRfRo_Templates {
                aVP_Data    := p_aVP_Data
                aVP_Data    := p_aVP_Data
            } // End of template mw_tariff_Time_Change_AVP
            } // End of template mw_tariff_Time_Change_AVP
            
            
			template (present) Credit_Control_Failure_Handling_AVP mw_credit_Control_Failure_Handling_AVP(
                                                                                                          template (present) Credit_Cont_Fail_Hand_Type p_aVP_Data := ?
            ) := {
                aVP_Header  := mw_aVP_HeaderVid_Mbit1(c_credit_Control_Failure_Handling_AVP_Code, 4, c_vendId3gpp),
                aVP_Data    := p_aVP_Data
            } // End of template mw_credit_Control_Failure_Handling_AVP
            
        } // End of group Ro_avps_templates_receive 
        } // End of group Ro_avps_templates_receive 
        
        
    } // End of group Ro_avps_templates 
    } // End of group Ro_avps_templates 
+125 −0
Original line number Original line Diff line number Diff line
@@ -1050,6 +1050,8 @@ module DiameterRfRo_TestCases
                 *            the IUT sends a CC-Answer
                 *            the IUT sends a CC-Answer
                 *                containing a Result-Code AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                    indicating DIAMETER_SUCCESS
                 *                containing a CC-Request-Type AVP
                 *                    indicating EVENT_REQUEST
                 *                containing a Cost-Information AVP
                 *                containing a Cost-Information AVP
                 *                    containing a Unit-Value AVP
                 *                    containing a Unit-Value AVP
                 *                        containing a Value-Digits AVP
                 *                        containing a Value-Digits AVP
@@ -1105,6 +1107,8 @@ module DiameterRfRo_TestCases
                 *            the IUT sends a CC-Answer
                 *            the IUT sends a CC-Answer
                 *                containing a Result-Code AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                    indicating DIAMETER_SUCCESS
                 *                containing a CC-Request-Type AVP
                 *                    indicating EVENT_REQUEST
                 *                containing a Remaining-Balance AVP
                 *                containing a Remaining-Balance AVP
                 *                    containing a Unit-Value AVP
                 *                    containing a Unit-Value AVP
                 *                        containing a Value-Digits AVP
                 *                        containing a Value-Digits AVP
@@ -1970,10 +1974,131 @@ module DiameterRfRo_TestCases
            
            
            // 5.2.3.1.6 Re-Authorization 
            // 5.2.3.1.6 Re-Authorization 
            group TP_RO_OCF_RE {
            group TP_RO_OCF_RE {
                
                /**
                 * @desc    Verify that the IUT re-authorizes multiple active quotas during Session Charging with Unit Reservation
                 * <pre>
                 * Pics Selection: PICS_OCF_IUT and PICS_RO_OCF_RE_AUTHORIZATION and PICS_RO_OCF_SESSION_CHARGING_WITH_UNIT_RESERVATION
                 * Initial conditions: 
                 *     with {
                 *        CCR,CCA [Initial] and CCR,CCA [Update] are exchanged
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT is indicated for a need for re-authorization
                 *        then {
                 *            the IUT sends an RA-Request
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing a Destination-Host AVP
                 *                containing an Auth-Application-Id AVP
                 *                    indicating the value 4
                 *                containing a Re-Auth-Request-Type AVP
                 *                    indicating AUTHORIZE_ONLY
                 *            the IUT receives an RA-Answer
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                containing an Origin-Host AVP
                 *                    containing an Origin-Realm AVP
                 *            the IUT accepts the message
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RO_OCF_RE_01
                 */
                testcase TC_RO_OCF_RE_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRo_ctf; 
                    
                    // Test control
                    if (not (PICS_RO_OCF_IUT and PICS_RO_OCF_RE_AUTHORIZATION and PICS_RO_OCF_SESSION_CHARGING_WITH_UNIT_RESERVATION)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RO_OCF_IUT and PICS_RO_OCF_RE_AUTHORIZATION and PICS_RO_OCF_SESSION_CHARGING_WITH_UNIT_RESERVATION' required for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Ro_ctfUp(v_diameterRo_ctf);
                    
                    // Start
                    v_diameterRo_ctf.start(f_TC_RO_OCF_RE_01()); 
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Ro_ctfDown(v_diameterRo_ctf);
                    
                } // End of testcase TC_RO_OCF_RE_01
                
            } // End of group TP_RO_OCF_RE
            } // End of group TP_RO_OCF_RE
            
            // 5.2.3.1.7 Failure Handling 
            // 5.2.3.1.7 Failure Handling 
            group TP_RO_OCF_FH {
            group TP_RO_OCF_FH {
                
                /**
                 * @desc    Verify that the IUT can successfully transmit Credit-Control-Failure-Handling AVP (CCFH) with price enquiry
                 * <pre>
                 * Pics Selection: PICS_OCF_IUT and PICS_RO_OCF_IMMEDIATE_EVENT_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an CC-Request
                 *                containing a CC-Request-Type AVP
                 *                    indicating EVENT_REQUEST
                 *                containing a CC-Request-Number AVP
                 *                containing a Requested-Action AVP
                 *                    indicating PRICE_ENQUIRY
                 *                containing a Multiple-Services-Credit-Control AVP
                 *                    containing a Service-Identifier AVP
                 *        then {
                 *            the IUT sends a CC-Answer
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                containing a CC-Request-Type AVP
                 *                    indicating EVENT_REQUEST
                 *                containing a Credit-Control-Failure-Handling AVP
                 *                    indicating what to do if the IUT has been temporarily prevented
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RO_OCF_FH_01
                 */
                testcase TC_RO_OCF_FH_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRo_ctf; 
                    
                    // Test control
                    if (not (PICS_RO_OCF_IUT and PICS_RO_OCF_IMMEDIATE_EVENT_CHARGING)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RO_OCF_IUT and PICS_RO_OCF_IMMEDIATE_EVENT_CHARGING' required for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Ro_ctfUp(v_diameterRo_ctf);
                    
                    // Start
                    v_diameterRo_ctf.start(f_TC_RO_OCF_FH_01()); 
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Ro_ctfDown(v_diameterRo_ctf);
                    
                } // End of testcase TC_RO_OCF_FH_01
                
            } // End of group TP_RO_OCF_FH
            } // End of group TP_RO_OCF_FH
            
            // 5.2.3.1.8 Failover 
            // 5.2.3.1.8 Failover 
            group TP_RO_OCF_FA {
            group TP_RO_OCF_FA {
            } // End of group TP_RO_OCF_FA
            } // End of group TP_RO_OCF_FA
+7 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,13 @@ module DiameterRfRo_TestControl {
                execute(TC_RO_OCF_CH_03());
                execute(TC_RO_OCF_CH_03());
            }
            }
            
            
            if (PICS_RO_OCF_RE_AUTHORIZATION and PICS_RO_OCF_SESSION_CHARGING_WITH_UNIT_RESERVATION) {
                execute(TC_RO_OCF_RE_01());
            }
            
            if (PICS_RO_OCF_IMMEDIATE_EVENT_CHARGING) {
                execute(TC_RO_OCF_FH_01());
            }
        }
        }
        
        
    } // End of 'Control' statement
    } // End of 'Control' statement