pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36562?usp=email )
Change subject: ggsn: TC_gy_charging_volume_quota_threshold: Fix Gy Threshold/Quota
expectancies
......................................................................
ggsn: TC_gy_charging_volume_quota_threshold: Fix Gy Threshold/Quota expectancies
open5gs got the Gy Thresholds fixed recently
(e078b33f0c4d6f34d8991f8ad211dd2d9ea977a0).
AS shown in 3GPP TS 29.244 C.2.1.1 diagram, in Diameter Gy the value
sets the trigger for the "remaining credit", not the "used credit".
"ThresholdPFCP = Quota - ThresholdGy"
The test needs to be adapter since it was wrong too.
Change-Id: Ia283ad4919813241e3c33465ba4be2d2e33f5e54
---
M ggsn_tests/GGSN_Tests.ttcn
M library/DIAMETER_ts32_299_Templates.ttcn
2 files changed, 36 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/36562/1
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 8672947..23a9924 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -159,7 +159,8 @@
port DIAMETER_PT Gy_UNIT;
port DIAMETEREM_PROC_PT Gy_PROC;
var integer g_gy_validity_time := 0; /* In seconds. 0 => disabled, !0 => grant
over CC-Time period */
- var integer g_gy_volume_threshold := 0; /* In octets. 0 => disabled, !0 =>
request IUT to revalidate after N octets */
+ var integer g_gy_volume_quota := 0; /* In octets. 0 => disabled, !0 => request
IUT to revalidate after N octets */
+ var integer g_gy_volume_threshold := 0; /* In octets. Request IUT to revalidate at N
octets before reaching g_gy_volume_quota */
var PDU_DIAMETER g_rx_gy; /* Store last received Gy message */
}
@@ -685,12 +686,17 @@
avp := f_DIAMETER_get_avp(g_rx_gy, c_AVP_Code_DCC_NONE_CC_Request_Number);
req_num := valueof(avp.avp_data.avp_DCC_NONE_CC_Request_Number);
if (g_gy_validity_time > 0) {
- if (g_gy_volume_threshold > 0) {
- tx_dia := ts_DIA_Gy_CCA_ValidityTimeVolumeThreshold(g_rx_gy.hop_by_hop_id,
g_rx_gy.end_to_end_id, sess_id,
- req_type, req_num, g_gy_validity_time, g_gy_volume_threshold);
+ if (g_gy_volume_quota > 0) {
+ tx_dia := ts_DIA_Gy_CCA_ValidityTimeVolumeThreshold(
+ g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id,
+ sess_id, req_type, req_num,
+ g_gy_validity_time,
+ g_gy_volume_quota, g_gy_volume_threshold);
} else {
- tx_dia := ts_DIA_Gy_CCA_ValidityTime(g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id,
sess_id,
- req_type, req_num, g_gy_validity_time);
+ tx_dia := ts_DIA_Gy_CCA_ValidityTime(
+ g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id,
+ sess_id, req_type, req_num,
+ g_gy_validity_time);
}
} else {
tx_dia := ts_DIA_Gy_CCA(g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id, sess_id,
@@ -2167,7 +2173,8 @@
testcase TC_gy_charging_volume_quota_threshold() runs on GT_CT {
var default d;
timer Tout;
- g_gy_volume_threshold := 1000; /* Will make a trigger when we send bigger payload below
*/
+ g_gy_volume_quota := 10000; /* Allow for sending 10000 bytes */
+ g_gy_volume_threshold := 9000; /* Will make a trigger when we send bigger payload below
(10000-9000 = 1000 bytes) */
g_gy_validity_time := 8; /* Grant access for 8 seconds, needs to be re-validated
afterwards */
f_init();
var float tout_sec := int2float(g_gy_validity_time) / 2.0;
diff --git a/library/DIAMETER_ts32_299_Templates.ttcn
b/library/DIAMETER_ts32_299_Templates.ttcn
index 55402ab..ffbd15f 100644
--- a/library/DIAMETER_ts32_299_Templates.ttcn
+++ b/library/DIAMETER_ts32_299_Templates.ttcn
@@ -107,7 +107,9 @@
template (value) octetstring sess_id,
template (value) DCC_NONE_CC_Request_Type req_type,
template (value) AVP_Unsigned32 req_num,
- uint32_t validity_time, uint32_t volume_threhsold)
+ uint32_t validity_time,
+ uint32_t volume_quota,
+ uint32_t volume_threhsold := 0)
:= ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control,
app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id,
avps := {
@@ -121,7 +123,7 @@
ts_AVP_Multiple_Services_Credit_Control({
ts_AVP_Validity_Time(validity_time),
ts_AVP_Granted_Service_Unit({
- ts_AVP_CC_Total_Octets(volume_threhsold*100)
+ ts_AVP_CC_Total_Octets(volume_quota)
}),
ts_AVP_3GPP_VolumeQuotaThreshold(volume_threhsold)
})
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36562?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia283ad4919813241e3c33465ba4be2d2e33f5e54
Gerrit-Change-Number: 36562
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange