ggsn/pgw: Fix Gy CCR Reporting-Reason expectancies
The Reporting-Reason can be in different places depending on its values. In the case of TERMINATION, we expect it to be FINAL so we know its location. Change-Id: Id33b9bb2f7b469e03a0761dc8807770cfdf77fcc
This commit is contained in:
parent
c01eada147
commit
cba0f6d292
|
@ -576,7 +576,7 @@ module GGSN_Tests {
|
||||||
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
||||||
tr_AVP_Requested_Service_Unit,
|
tr_AVP_Requested_Service_Unit,
|
||||||
tr_AVP_Used_Service_Unit,
|
tr_AVP_Used_Service_Unit,
|
||||||
tr_AVP_3GPP_Reporting_Reason,
|
/* tr_AVP_3GPP_Reporting_Reason, can be sometimes inside UsedServiceUnit */
|
||||||
tr_AVP_3GPP_QoS_Information,
|
tr_AVP_3GPP_QoS_Information,
|
||||||
tr_AVP_GI_3GPP_RatType(rat_type)
|
tr_AVP_GI_3GPP_RatType(rat_type)
|
||||||
)),
|
)),
|
||||||
|
@ -624,6 +624,7 @@ module GGSN_Tests {
|
||||||
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
||||||
/* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */
|
/* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */
|
||||||
tr_AVP_Used_Service_Unit,
|
tr_AVP_Used_Service_Unit,
|
||||||
|
tr_AVP_3GPP_Reporting_Reason(FINAL),
|
||||||
tr_AVP_3GPP_QoS_Information,
|
tr_AVP_3GPP_QoS_Information,
|
||||||
tr_AVP_GI_3GPP_RatType(rat_type)
|
tr_AVP_GI_3GPP_RatType(rat_type)
|
||||||
)),
|
)),
|
||||||
|
|
|
@ -1675,20 +1675,27 @@ function f_validate_gy_cc_report(PDU_DIAMETER rx_dia, template (present) DCA_3GP
|
||||||
{
|
{
|
||||||
var AVP multi_services_cc, used_service_unit;
|
var AVP multi_services_cc, used_service_unit;
|
||||||
var AVP_Grouped multi_services_cc_data, used_service_unit_data;
|
var AVP_Grouped multi_services_cc_data, used_service_unit_data;
|
||||||
|
var template (omit) AVP repreason_tpl;
|
||||||
var AVP repreason, cc_time, cc_in_oct, cc_out_oct;
|
var AVP repreason, cc_time, cc_in_oct, cc_out_oct;
|
||||||
|
|
||||||
multi_services_cc := f_DIAMETER_get_avp_or_fail(rx_dia, c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control);
|
multi_services_cc := f_DIAMETER_get_avp_or_fail(rx_dia, c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control);
|
||||||
multi_services_cc_data := valueof(multi_services_cc.avp_data.avp_DCC_NONE_Multiple_Services_Credit_Control);
|
multi_services_cc_data := valueof(multi_services_cc.avp_data.avp_DCC_NONE_Multiple_Services_Credit_Control);
|
||||||
|
|
||||||
repreason := f_AVP_Grouped_get_avp_or_fail(multi_services_cc_data, c_AVP_Code_DCA_3GPP_Reporting_Reason);
|
used_service_unit := f_AVP_Grouped_get_avp_or_fail(multi_services_cc_data, c_AVP_Code_DCC_NONE_Used_Service_Unit);
|
||||||
|
used_service_unit_data := valueof(used_service_unit.avp_data.avp_DCC_NONE_Used_Service_Unit);
|
||||||
|
|
||||||
|
/* Reporting-Reason can be either inside Multiple-Services-Credit-Control or inside Used-Service-Unit */
|
||||||
|
repreason_tpl := f_AVP_Grouped_get_avp(multi_services_cc_data, c_AVP_Code_DCA_3GPP_Reporting_Reason);
|
||||||
|
if (istemplatekind(repreason_tpl, "omit")) {
|
||||||
|
repreason := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCA_3GPP_Reporting_Reason);
|
||||||
|
} else {
|
||||||
|
repreason := valueof(repreason_tpl);
|
||||||
|
}
|
||||||
if (not match(repreason.avp_data.avp_DCA_3GPP_Reporting_Reason, repreason_exp)) {
|
if (not match(repreason.avp_data.avp_DCA_3GPP_Reporting_Reason, repreason_exp)) {
|
||||||
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
||||||
log2str("3GPP-Reporting-Reason mismatch ", repreason, " vs exp ", repreason_exp));
|
log2str("3GPP-Reporting-Reason mismatch ", repreason, " vs exp ", repreason_exp));
|
||||||
}
|
}
|
||||||
|
|
||||||
used_service_unit := f_AVP_Grouped_get_avp_or_fail(multi_services_cc_data, c_AVP_Code_DCC_NONE_Used_Service_Unit);
|
|
||||||
used_service_unit_data := valueof(used_service_unit.avp_data.avp_DCC_NONE_Used_Service_Unit);
|
|
||||||
|
|
||||||
cc_time := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Time);
|
cc_time := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Time);
|
||||||
if (not match(oct2int(cc_time.avp_data.avp_DCC_NONE_CC_Time), cc_time_exp)) {
|
if (not match(oct2int(cc_time.avp_data.avp_DCC_NONE_CC_Time), cc_time_exp)) {
|
||||||
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
||||||
|
|
|
@ -409,7 +409,7 @@ runs on PGW_Session_CT return template (present) PDU_DIAMETER
|
||||||
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
||||||
tr_AVP_Requested_Service_Unit,
|
tr_AVP_Requested_Service_Unit,
|
||||||
tr_AVP_Used_Service_Unit,
|
tr_AVP_Used_Service_Unit,
|
||||||
tr_AVP_3GPP_Reporting_Reason,
|
/* tr_AVP_3GPP_Reporting_Reason, can be sometimes inside UsedServiceUnit */
|
||||||
tr_AVP_3GPP_QoS_Information,
|
tr_AVP_3GPP_QoS_Information,
|
||||||
tr_AVP_GI_3GPP_RatType(rat_type)
|
tr_AVP_GI_3GPP_RatType(rat_type)
|
||||||
)),
|
)),
|
||||||
|
@ -459,6 +459,7 @@ runs on PGW_Session_CT return template (present) PDU_DIAMETER
|
||||||
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
tr_AVP_Multiple_Services_Credit_Control(content := superset(
|
||||||
/* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */
|
/* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */
|
||||||
tr_AVP_Used_Service_Unit,
|
tr_AVP_Used_Service_Unit,
|
||||||
|
tr_AVP_3GPP_Reporting_Reason(FINAL),
|
||||||
tr_AVP_3GPP_QoS_Information,
|
tr_AVP_3GPP_QoS_Information,
|
||||||
tr_AVP_GI_3GPP_RatType(rat_type)
|
tr_AVP_GI_3GPP_RatType(rat_type)
|
||||||
)),
|
)),
|
||||||
|
|
Loading…
Reference in New Issue