DiameterRfRo_TestCases.ttcn 309 KB
Newer Older
pintar's avatar
pintar committed
/**
garciay's avatar
garciay committed
 *  @author     STF 490
pintar's avatar
pintar committed
 *  @version    $Id$
garciay's avatar
garciay committed
 *  @desc        This module provides test cases
pintar's avatar
pintar committed
 *              for SIP-IMS-RfRo-DIAMETER tests.
 */

module DiameterRfRo_TestCases
{
    //LibCommon
    import from LibCommon_Sync all ;
    import from LibCommon_VerdictControl all;
pintar's avatar
pintar committed
    //LibDiameter
    import from LibDiameter_TypesAndValues all;
pintar's avatar
pintar committed
    import from LibDiameter_Interface all;
pintar's avatar
pintar committed
    //LibSip
    import from LibSip_SIPTypesAndValues {type CSeq;};

pintar's avatar
pintar committed
    //LibIms
    import from LibIms_Interface all;
    
pintar's avatar
pintar committed
    //AtsIms
    import from DiameterRfRo_TestConfiguration all;
    import from DiameterRfRo_TestSystem all;
    import from DiameterRfRo_SIP_TCFunctions all;
    import from DiameterRfRo_TCFunctions all;
    import from DiameterRfRo_PICS all;
    import from DiameterRfRo_PIXITS all;
    import from DiameterRfRo_Steps all;
    import from DiameterRfRo_TestSystem all;
    
pintar's avatar
pintar committed
    
    // 5.2.2.1. CDF Role
pintar's avatar
pintar committed
    group TP_RF_Role {
        // 5.2.2.1. CDF Role
        group TP_RF_CDF_Role { 
            
            // 5.2.2.1.2 Message Syntax
juvancic's avatar
juvancic committed
            group TP_RF_CDF_MS {
                /**
                 * @desc    Verify that the IUT can successfully process all mandatory AVPs in an AC-Request received due to Charging Data Transfer
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an AC-Request 
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing an Accounting-Record-Type AVP
                 *                containing an Accounting-Record-Number AVP
                 *                containing an Acct-Application-Id AVP
                 *                    indicating the value 3
                 *        }
                 *        then {
                 *            the IUT sends a AC-Response 
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                not containing an Experimental-Result AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing an Accounting-Record-Type AVP
                 *                containing an Accounting-Record-Number AVP
                 *                containing an Acct-Application-Id AVP
                 *                    indicating the value 3
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.12
                 * @see        ETSI DTS/INT 00121-2 V0.0.12 (2015-07) TP_RF_CDF_MS_01
                 */
                testcase TC_RF_CDF_MS_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
pintar's avatar
pintar committed
                    var DiameterRfRo v_diameterRf_ctf; 
juvancic's avatar
juvancic committed
                    if (not PICS_RF_CDF_IUT) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT' shall be set to true for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
pintar's avatar
pintar committed
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
pintar's avatar
pintar committed
                    v_diameterRf_ctf.start(f_TC_CDF_MS_01()); 
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
pintar's avatar
pintar committed
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                } // End of testcase TC_RF_CDF_MS_01 
                
pintar's avatar
pintar committed
                /**
                 * @desc    Verify that the IUT can successfully process all mandatory AVPs in an AC-Request received due to Charging Data Transfer and responds with a valid AC-Answer message
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an AC-Request 
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing an Accounting-Record-Type AVP
                 *                containing an Accounting-Record-Number AVP
                 *                containing an Acct-Application-Id AVP
                 *                    indicating the value 3
                 *        }
                 *        then {
                 *            the IUT sends an AC-Answer
                 *                containing a Diameter-Header
                 *                     containing a Version
                 *                       indicating value ‘1’
                 *                     containing a Command-Flags
                 *                       containing T bit
                 *                         indicating value ‘0’
                 *                       containing r bits
                 *                         indicating value ‘0000’.
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_MS_02
pintar's avatar
pintar committed
                 */
                testcase TC_RF_CDF_MS_02() runs on DiameterRfRo system TestAdapter { 
                   // Local variables
                   var DiameterRfRo v_diameterRf_ctf; 
    
                   // Test control
juvancic's avatar
juvancic committed
                   if (not PICS_RF_CDF_IUT) {
pintar's avatar
pintar committed
                       log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT' shall be set to true for executing the TC. ***"); 
pintar's avatar
pintar committed
                       stop;
                   }
    
                   // Test component configuration
                   f_cf_1Rf_ctfUp(v_diameterRf_ctf);
    
                   // Start
                   v_diameterRf_ctf.start(f_TC_CDF_MS_02());
    
                   // synchronize PTC on 1 sychronization points
                   f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
    
                   f_cf_1Rf_ctfDown(v_diameterRf_ctf);
    
                } // End of testcase TC_RF_CDF_MS_01
                
            } // End of group MessageSyntax
            
            // 5.2.2.1.3 Type of Charging
juvancic's avatar
juvancic committed
            group TP_RF_CDF_TC {
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Event] where Event Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_EVENT_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an AC-Request 
                 *                containing an Accounting-Record-Type AVP
                 *                    indicating EVENT_RECORD
                 *                containing an Event-Timestamp AVP 
                 *                may containing Service-Information AVP
                 *                    containing at least one Subscription-ID AVP
                 *                        indicating the identification of the user
                 *                    may contains IMS-Information AVP
                 *                        containing Node-Functionality AVP
                 *                            indicating the value 3
                 *                    may containing Service-Generic-Information AVP
                 *                        indicating the service specific parameters
                 *                may containing Service-Context-Id AVP
                 *        }
                 *        then {
                 *            the IUT sends a AC-Response 
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                not containing an Experimental-Result AVP
                 *                containing an Accounting-Record-Type AVP
                 *                    indicating EVENT_RECORD
                 *                containing an Accounting-Record-Number AVP
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.12
                 * @see        ETSI DTS/INT 00121-2 V0.0.12 (2015-07) TP_RF_CDF_TC_01
                 */
                testcase TC_RF_CDF_TC_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
pintar's avatar
pintar committed
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
pintar's avatar
pintar committed
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_TC_01());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
pintar's avatar
pintar committed
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
pintar's avatar
pintar committed
                } // End of testcase TC_RF_CDF_TC_01
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Start] where Session Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *           on receipt of an AC-Request
                 *               containing an Accounting-Record-Type AVP
                 *                   containing an Accounting-Record-Type AVP
                 *                       indicating START_RECORD
                 *               containing an Accounting-Record-Number AVP
                 *               containing an Event-Timestamp AVP
                 *               containing Service-Information AVP
                 *                   indicating the service specific parameters
                 *        }
                 *        then {
                 *           sends an AC-Answer
                 *               containing a Result-Code AVP
                 *                   indicating DIAMETER_SUCCESS
                 *               not containing an Experimental-Result AVP
                 *               containing an Accounting-Record-Type AVP
                 *                   indicating START_RECORD
                 *               optionally containing an Acct-Interim-Interval AVP
                 *                   indicating the desired intermediate charging interval.
                 *        }
                 *    }
                 * </pre>
                 * 
juvancic's avatar
juvancic committed
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_TC_02
pintar's avatar
pintar committed
                 */
                testcase TC_RF_CDF_TC_02() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
pintar's avatar
pintar committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_TC_02());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
juvancic's avatar
juvancic committed
                } // End of testcase TC_RF_CDF_TC_02
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Interim] where Session Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *           on receipt of an AC-Request
                 *               containing an Accounting-Record-Type AVP
                 *                   containing an Accounting-Record-Type AVP
                 *                       indicating INTERIM_RECORD
                 *               containing an Accounting-Record-Number AVP
                 *               containing an Event-Timestamp AVP
                 *               containing Service-Information AVP
                 *                   indicating Subscription-Id AVP
                 *                   indicating IMS-Information AVP
                 *        }
                 *        then {
                 *           sends an AC-Answer
                 *               containing a Result-Code AVP
                 *                   indicating DIAMETER_SUCCESS
                 *               not containing an Experimental-Result AVP
                 *               containing an Accounting-Record-Type AVP
                 *                   indicating INTERIM_RECORD
                 *               optionally containing an Acct-Interim-Interval AVP
                 *                   indicating the desired intermediate charging interval.
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_TC_03
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_TC_03() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_TC_03());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_TC_03
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Stop] where Session Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *           on receipt of an AC-Request
                 *               containing an Accounting-Record-Type AVP
                 *                   containing an Accounting-Record-Type AVP
                 *                       indicating STOP_RECORD
                 *               containing an Accounting-Record-Number AVP
                 *               containing an Event-Timestamp AVP
                 *               containing Service-Information AVP
                 *                   indicating Subscription-Id AVP
                 *                   indicating IMS-Information AVP
                 *        }
                 *        then {
                 *           sends an AC-Answer
                 *               containing a Result-Code AVP
                 *                   indicating DIAMETER_SUCCESS
                 *               not containing an Experimental-Result AVP
                 *               containing an Accounting-Record-Type AVP
                 *                   indicating STOP_RECORD
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_TC_04
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_TC_04() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_TC_04());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_TC_04
                
            } // End of group TypeOfCharging
pintar's avatar
pintar committed
            //5.2.2.1.4 ErrorCases
juvancic's avatar
juvancic committed
            group TP_RF_CDF_EC {
juvancic's avatar
juvancic committed
                
                /**
                 * @desc    Verify that the IUT terminates the call in case of timer expiration when the Session Based Charging procedure is not completed properly.
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *         on timer expired
                           sends an AS-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.
                 *        }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_EC_01
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_EC_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_EC_01());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_EC_01
                
                /**
                 * @desc    Verify that the IUT terminates the call in case of timer expiration when the Session Based Charging procedure is not completed properly.
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *         on timer expired
                           sends an AS-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.
                 *        }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_EC_02
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_EC_02() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf; 
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_EC_02());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_EC_02
juvancic's avatar
juvancic committed

                /**
                 * @desc    Verify that the IUT can successfully process Duplicate Detection AC-Request [Event] where Event Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_EVENT_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an AC-Request 
                 *              containing Diameter-Header
                 *                  containing Command-Flags
                 *                      containing T-flag
                 *                          indicating value ‘1’
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating EVENT_RECORD
                 *              containing an Event-Timestamp AVP 
                 *              containing optional Service-Information AVP
                 *                   containing at least one Subscription-ID AVP
                 *                      indicating the identification of the user
                 *                  containing optional IMS-Information AVP
                 *                      containing Node-Functionality AVP
                 *                          indicating the value 3
                 *                  containing optional Service-Generic-Information AVP
                 *                      indicating the service specific parameters
                 *              containing optional Service-Context-Id AVP
                 *        }
                 *        then {
                 *            the IUT sends a AC-Response 
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                not containing an Experimental-Result AVP
                 *                containing an Accounting-Record-Type AVP
                 *                    indicating EVENT_RECORD
                 *                containing an Accounting-Record-Number AVP
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_EC_03
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_EC_03() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf;
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_EC_03());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_EC_03

                /**
                 * @desc    Verify that the IUT can successfully process Duplicate Detection AC-Request [Interim] where Session Based Charging is used
                 * <pre>
                 * Pics Selection: PICS_CDF_IUT and PICS_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an AC-Request 
                 *              containing Diameter-Header
                 *                  containing Command-Flags
                 *                      containing T-flag
                 *                          indicating value ‘1’
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating INTERIM_RECORD
                 *              containing an Event-Timestamp AVP 
                 *              containing optional Service-Information AVP
                 *                  containing at least one Subscription-ID AVP
                 *                      indicating the identification of the user
                 *                  containing optional IMS-Information AVP
                 *                      containing Node-Functionality AVP
                 *                          indicating the value 3
                 *                  may containing Service-Generic-Information AVP
                 *                      indicating the service specific parameters
                 *              containing optional Service-Context-Id AVP
                 *        }
                 *        then {
                 *            the IUT sends a AC-Response 
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                not containing an Experimental-Result AVP
                 *                containing an Accounting-Record-Type AVP
                 *                    indicating EVENT_RECORD
                 *                containing an Accounting-Record-Number AVP
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version    0.0.15
garciay's avatar
garciay committed
                 * @see        ETSI DTS/INT 00121-2 V0.0.15 (2015-10) TP_RF_CDF_EC_04
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CDF_EC_04() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_ctf;
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_ctfUp(v_diameterRf_ctf);
                    
                    // Start
                    v_diameterRf_ctf.start(f_TC_RF_CDF_EC_04());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_ctfDown(v_diameterRf_ctf);
                    
                } // End of testcase TC_RF_CDF_EC_04
juvancic's avatar
juvancic committed
                
pintar's avatar
pintar committed
            } // End of group ErrorCasses
            
pintar's avatar
pintar committed
        } // End of group TP_RF_CDF_Role
        
        // 5.2.2.2. CTF Role
        group TP_RF_CTF_Role {
            // 5.2.2.2.2 Message Syntax
juvancic's avatar
juvancic committed
            group TP_RF_CTF_MS {
pintar's avatar
pintar committed
                
                /**
                 * @desc    Verify that the IUT can send an AC-Request to indicate a Charging Data Transfer.
                 * <pre>
juvancic's avatar
juvancic committed
                 * Pics Selection: PICS_RF_CTF_IUT
pintar's avatar
pintar committed
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that the IUT sends an AC-Request 
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing an Accounting-Record-Type AVP
                 *                containing an Accounting-Record-Number AVP
                 *                containing an Acct-Application-Id AVP
                 *                    indicating the value 3
                 * </pre>
                 * 
garciay's avatar
garciay committed
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RF_CTF_MS_01
pintar's avatar
pintar committed
                 */
                testcase TC_RF_CTF_MS_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
pintar's avatar
pintar committed
                    var DiameterRfRo v_diameterRf_cdf;
pintar's avatar
pintar committed
                    
                    // Test control
juvancic's avatar
juvancic committed
                    if (not PICS_RF_CTF_IUT) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT' shall be set to true for executing the TC. ***"); 
pintar's avatar
pintar committed
                        stop;
                    }
                    
                    // Test component configuration
pintar's avatar
pintar committed
                    f_cf_1Rf_cdfUp(v_diameterRf_cdf);
pintar's avatar
pintar committed
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_MS_01());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
pintar's avatar
pintar committed
                    f_cf_1Rf_cdfDown(v_diameterRf_cdf)
pintar's avatar
pintar committed
                    
pintar's avatar
pintar committed
                } // End of testcase TC_RF_CTF_MS_01
juvancic's avatar
juvancic committed
                
                /**
                 * @desc    Verify that the IUT can send an AC-Request with correct Diameter-Header parameters to indicate a Charging Data Transfer with valid Diameter-Header parameters.
                 * <pre>
                 * Pics Selection: PICS_RF_CTF_IUT
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     Ensure that the IUT
                 *      to indicate a request for Charging Data Transfer,
                 *      sends an AC-Request
                 *          containing a Diameter-Header
                 *              containing a Version
                 *                  indicating value ‘1’
                 *              containing a Command-Flags
                 *                  containing T bit
                 *                      indicating value ‘0’
                 *                  containing E bit
                 *                      indicating value ‘0’
                 *                  containing r bits
                 *                      indicating value ‘0000’.
                 * </pre>
                 * 
garciay's avatar
garciay committed
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RF_CTF_MS_02
juvancic's avatar
juvancic committed
                 */
                testcase TC_RF_CTF_MS_02() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
pintar's avatar
pintar committed
                    var DiameterRfRo v_diameterRf_cdf;
juvancic's avatar
juvancic committed
                    
                    // Test control
                    if (not PICS_RF_CTF_IUT) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
pintar's avatar
pintar committed
                    f_cf_1Rf_cdfUp(v_diameterRf_cdf);
juvancic's avatar
juvancic committed
                    
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_MS_02());
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
pintar's avatar
pintar committed
                    f_cf_1Rf_cdfDown(v_diameterRf_cdf)
juvancic's avatar
juvancic committed
                    
pintar's avatar
pintar committed
                } // End of testcase TC_RF_CTF_MS_02
juvancic's avatar
juvancic committed
                
            } // End of group TP_RF_CTF_MS_Role
pintar's avatar
pintar committed
            // 5.2.2.2.3 Type of Charging 
juvancic's avatar
juvancic committed
            group TP_RF_CTF_TC {
juvancic's avatar
juvancic committed
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Event].
                 * <pre>
pintar's avatar
pintar committed
                 * Pics Selection: PICS_RF_CTF_IUT and PICS_RF_CTF_EVENT_BASED_CHARGING
juvancic's avatar
juvancic committed
                 * Initial conditions: 
                 *     with {
                 *        Preamble action: UE initiates an initial REGISTRATION procedure.
                 *     }
                 * Expected behaviour:
                 *      Ensure that the IUT
                 *          sends an AC-Request
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating EVENT_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *              containing an Event-Timestamp AVP 
                 *              containing Service-Information AVP
                 *                  containing at least one Subscription-ID AVP
                 *                      indicating the identification of the user
                 *                  optionally containing IMS-Information AVP
                 *                      containing Node-Functionality AVP
                 *                      indicating the value 3
                 *                  optionally containing Service-Generic-Information AVP
                 *                      indicating the service specific parameters
                 *              optionally containing Service-Context-Id AVP
                 *          on receipt of an AC-Answer
                 *              containing a Result-Code AVP
                 *                  indicating DIAMETER_SUCCESS
                 *              not containing an Experimental-Result AVP
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating EVENT_RECORD
                 *          accepts the message.
                 * </pre>
                 * 
garciay's avatar
garciay committed
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RF_CTF_TC_01
juvancic's avatar
juvancic committed
                 */
pintar's avatar
pintar committed
                testcase TC_RF_CTF_TC_01(inout CSeq p_cSeq_s) runs on DiameterRfRo system TestAdapter { 
juvancic's avatar
juvancic committed
                    // Local variables
                    var DiameterRfRo v_diameterRf_cdf; 
                    var ImsComponent v_imsComponent_ue;
                    var ImsComponent v_imsComponent_cscf;
                    
                    // Test control
pintar's avatar
pintar committed
                    if (not (PICS_RF_CTF_IUT and PICS_RF_CTF_EVENT_BASED_CHARGING)) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT and PICS_RF_CTF_EVENT_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
juvancic's avatar
juvancic committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_1Gm_1Mw_cdfUp(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf);
                    
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_TC_01());
                    if (PX_SIPsupport) {
                        if (PX_VA == 1){
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_01_VA1(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_01_VA1(p_cSeq_s));
pintar's avatar
pintar committed
                        }
                        else if(PX_VA == 2){
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_01_VA2(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_01_VA2(p_cSeq_s));
pintar's avatar
pintar committed
                        }
                        else if(PX_VA == 3){
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_01_VA3(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_01_VA3(p_cSeq_s));
pintar's avatar
pintar committed
                        }
                        else if(PX_VA == 4){
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_01_VA4(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_01_VA4(p_cSeq_s));
pintar's avatar
pintar committed
                        }
                        else {
                            log("Set correct value of PIXIT: PX_VA due to related test case!");
                        }
juvancic's avatar
juvancic committed
                    }
                    
                    // synchronize PTC on 1 sychronization points
pintar's avatar
pintar committed
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_sync1, c_tbDone, c_poDone});
juvancic's avatar
juvancic committed
                    
                    f_cf_1Rf_1Gm_1Mw_cdfDown(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf)
                    
pintar's avatar
pintar committed
                } // End of testcase TC_RF_CTF_TC_01
juvancic's avatar
juvancic committed
                
pintar's avatar
pintar committed
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Start].
                 * <pre>
                 * Pics Selection: PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        Preamble action: UE initiates an INVITE procedure.
                 *     }
                 * Expected behaviour:
                 *      Ensure that the IUT
                 *          sends an AC-Request
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *              containing an Event-Timestamp AVP 
                 *              containing Service-Information AVP
                 *                  indicating the service specific parameters
                 *          on receipt of an AC-Answer
                 *              containing a Result-Code AVP
                 *                  indicating DIAMETER_SUCCESS
                 *              not containing an Experimental-Result AVP
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              optionally containing an Acct-Interim-Interval AVP
                 *                  indicating the desired intermediate charging interval
                 *          accepts the message.
                 * </pre>
                 * 
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RF_CTF_TC_02
                 */
                testcase TC_RF_CTF_TC_02(inout CSeq p_cSeq_s) runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_cdf; 
                    var ImsComponent v_imsComponent_ue;
                    var ImsComponent v_imsComponent_cscf;
                    
                    // Test control
                    if (not (PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_1Gm_1Mw_cdfUp(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf);
                    
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_TC_02());
                    if (PX_SIPsupport) {
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_02(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_02(p_cSeq_s));
                    }
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_sync1, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_1Gm_1Mw_cdfDown(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf)
                    
                } // End of testcase TC_RF_CTF_TC_02
                
                /**
                 * @desc    Verify that the time between several AC-Requests [Interim] 
                 *          received by the IUT is at least equal to the desired intermediate 
                 *          charging interval.
                 * <pre>
                 * Pics Selection: PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        Preamble action: UE establishes a call.
                 *     }
                 * Expected behaviour:
                 *      Ensure that the IUT
                 *          sends an AC-Request
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *          on receipt of an AC-Answer
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *              containing an Acct-Interim-Interval AVP
                 *                  containing the desired intermediate charging interval 
                 *                      indicating a value INTERIM_INTERVAL not equal to 0
                 *          sends periodically an AC-Request [Interim]
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating INTERIM_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *              containing a Service-Information AVP
                 *              containing an Event-Timestamp AVP
                 *          on receipt of an AC-Answer
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating INTERIM_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *          accepts the message.
                 * </pre>
                 * 
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RF_CTF_TC_03
                 */
                testcase TC_RF_CTF_TC_03(inout CSeq p_cSeq_s) runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRf_cdf; 
                    var ImsComponent v_imsComponent_ue;
                    var ImsComponent v_imsComponent_cscf;
                    
                    // Test control
                    if (not (PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING' shall be set to true for executing the TC. ***"); 
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_1Gm_1Mw_cdfUp(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf);
                    
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_TC_03());
                    if (PX_SIPsupport) {
                            v_imsComponent_ue.start(f_TC_CTF_TC_UE_03(p_cSeq_s));
                            v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_03(p_cSeq_s));
                    }
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_sync1, c_tbDone, c_poDone});
                    
                    f_cf_1Rf_1Gm_1Mw_cdfDown(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf)
                    
                } // End of testcase TC_RF_CTF_TC_03
                
                /**
                 * @desc    Verify that the IUT can successfully process an AC-Request [Interim].
                 * <pre>
                 * Pics Selection: PICS_RF_CTF_IUT and PICS_RF_CTF_SESSION_BASED_CHARGING
                 * Initial conditions: 
                 *     with {
                 *        Preamble action: UE establishes a call.
                 *     }
                 * Expected behaviour:
                 *      Ensure that the IUT
                 *          sends an AC-Request
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *          on receipt of an AC-Answer
                 *              containing a Result-Code AVP
                 *                  indicating DIAMETER_SUCCESS
                 *              not containing an Experimental-Result AVP
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating START_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *          on receipt of SIP 200 OK (reInvite)
                 *          sends an AC-Request [Interim]
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating INTERIM_RECORD
                 *              containing an Accounting-Record-Number AVP
                 *              containing a Service-Information AVP
                 *              containing an Event-Timestamp AVP
                 *          on receipt of an AC-Answer
                 *              containing a Result-Code AVP
                 *                  indicating DIAMETER_SUCCESS
                 *              not containing an Experimental-Result AVP
                 *              containing an Accounting-Record-Type AVP
                 *                  indicating INTERIM_RECORD
                 *              containing an Accounting-Record-Number AVP