DiameterRfRo_TestCases.ttcn 106 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
    //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' required 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' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_EVENT_BASED_CHARGING' required 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CDF_IUT and PICS_RF_CDF_SESSION_BASED_CHARGING' required 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
                    var DiameterRfRo v_diameterRf_cdf; 
                    var ImsComponent v_imsComponent_ue;
                    var ImsComponent v_imsComponent_cscf;
                    
                    // Test control
juvancic's avatar
juvancic committed
                    if (not PICS_RF_CTF_IUT) {
juvancic's avatar
juvancic committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT' required for executing the TC. ***"); 
pintar's avatar
pintar committed
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf_1Rf_1Gm_1Mw_cdfUp(v_diameterRf_cdf, v_imsComponent_ue, v_imsComponent_cscf);
pintar's avatar
pintar committed
                    // Start
                    v_diameterRf_cdf.start(f_TC_CTF_MS_01());
                    if (PX_SIPsupport) {
//                        v_imsComponent_ue.start(f_TC_CTF_MS_UE_01);
//                        v_imsComponent_cscf.start(f_TC_CTF_MS_CSCF_01);
pintar's avatar
pintar committed
                    }
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    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_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
                    var DiameterRfRo v_diameterRf_cdf; 
                    var ImsComponent v_imsComponent_ue;
                    var ImsComponent v_imsComponent_cscf;
                    
                    // Test control
                    if (not PICS_RF_CTF_IUT) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT' required 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_MS_02());
                    if (PX_SIPsupport) {
//                        v_imsComponent_ue.start(f_TC_CTF_MS_UE_02);
//                        v_imsComponent_cscf.start(f_TC_CTF_MS_CSCF_02);
                    }
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    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_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>
                 * Pics Selection: PICS_RF_CTF_IUT
                 * 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
                 */
                testcase TC_RF_CTF_TC_01() runs on DiameterRfRo system TestAdapter { 
                    // 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)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RF_CTF_IUT and PICS_RF_CTF_EVENT_BASED_CHARGING' required 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) {
//                        v_imsComponent_ue.start(f_TC_CTF_TC_UE_01);
//                        v_imsComponent_cscf.start(f_TC_CTF_TC_CSCF_01);
                    }
                    
                    // synchronize PTC on 1 sychronization points
                    f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                    
                    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
                
            } // End of group TP_RF_CTF_TC_Role
pintar's avatar
pintar committed
            // 5.2.2.2.4 Error cases
juvancic's avatar
juvancic committed
            group TP_RF_CTF_EC {
            } // End of group TP_RF_CTF_EC_Role {
pintar's avatar
pintar committed
        } // End of group TP_RF_CTF_Role
        
    } // End of group TP_RFRole
pintar's avatar
pintar committed

    group TP_RO_Role {
juvancic's avatar
juvancic committed
        //5.2.3.1. OCF Role
        group TP_RO_OCF_Role {
            // 5.2.3.1.2 Message Syntax 
            group TP_RO_OCF_MS {
                
                /**
                 * @desc    Verify that the IUT can successfully process all mandatory AVPs in a CC-Request received due to Charging Data Transfer.
                 * <pre>
                 * Pics Selection: PICS_OCF_IUT
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an CC-Request
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing an Auth-Application-Id AVP
                 *                    indicating the value 4
                 *                containing a Service-Context-Id AVP
                 *                containing a CC-Request-Type AVP
                 *                containing a CC-Request-Number AVP
                 *        then {
                 *            the IUT sends a CC-Answer
                 *                containing a Session-ID AVP
                 *                containing a Result-Code AVP
                 *                    indicating DIAMETER_SUCCESS
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing an Auth-Application-Id AVP
                 *                containing a CC-Request-Type AVP
                 *                containing a CC-Request-Number AVP.
                 *        }
                 *    }
                 * </pre>
                 * 
garciay's avatar
garciay committed
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RO_OCF_MS_01
                 */
                testcase TC_RO_OCF_MS_01() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRo_ctf; 
                    
                    // Test control
                    if (not PICS_RO_OCF_IUT) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RO_OCF_IUT' 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_MS_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_MS_01
                
                /**
                 * @desc    Verify that the IUT can successfully process all mandatory AVPs in a CC-Request received due to Charging Data Transfer and responds with a valid CC-Answer message
                 * <pre>
                 * Pics Selection: PICS_OCF_IUT
                 * Initial conditions: 
                 *     with {
                 *        
                 *     }
                 * Expected behaviour:
                 *     ensure that {
                 *        when {
                 *            the IUT receives an CC-Request
                 *                containing a Session-ID AVP
                 *                containing an Origin-Host AVP
                 *                containing an Origin-Realm AVP
                 *                containing a Destination-Realm AVP
                 *                containing an Auth-Application-Id AVP
                 *                    indicating the value 4
                 *                containing a Service-Context-Id AVP
                 *                containing a CC-Request-Type AVP
                 *                containing a CC-Request-Number AVP
                 *        then {
                 *            the IUT sends a CC-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>
                 * 
garciay's avatar
garciay committed
                 * @version    0.0.18
                 * @see        ETSI DTS/INT 00121-2 V0.0.18 (2015-10) TP_RO_OCF_MS_02
                 */
                testcase TC_RO_OCF_MS_02() runs on DiameterRfRo system TestAdapter { 
                    // Local variables
                    var DiameterRfRo v_diameterRo_ctf; 
                    
                    // Test control
                    if (not PICS_RO_OCF_IUT) {
pintar's avatar
pintar committed
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_RO_OCF_IUT' 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_MS_02()); 
                    
                    // 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_MS_02
                
            } // End of group TP_RO_OCF_MS
            
juvancic's avatar
juvancic committed
            // 5.2.3.1.3 Type of Charging 
            group TP_RO_OCF_TC {
                
                /**
                 * @desc    Verify that the IUT can successfully process a CC-Request [Event] with direct debiting due to Immediate Event Charging
                 * <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 DIRECT_DEBITING
                 *                containing a Multiple-Services-Credit-Control AVP
                 *                    (containing a Requested-Service-Unit AVP and/or
                 *                    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 Multiple-Services-Credit-Control AVP
                 *                    containing a Granted-Service-Unit AVP
                 *                        indicating debites units
                 *        }