pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36344?usp=email )
Change subject: pgw: Set Gy CCA Result-Code based on settings ...................................................................... pgw: Set Gy CCA Result-Code based on settings This allows the test to change the Result-Code being transmitted during Gy CCA at any time. Related: SYS#6845 Change-Id: I2c3b1057908c1c76a55c41a7f45728a0fdee3cf0 --- M ggsn_tests/GGSN_Tests.ttcn M library/DIAMETER_ts32_299_Templates.ttcn M pgw/PGW_Tests.ttcn 3 files changed, 33 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/36344/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 55720ee..74c2e8c 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -686,7 +686,7 @@ } } else { tx_dia := ts_DIA_Gy_CCA(g_rx_gy.hop_by_hop_id, g_rx_gy.end_to_end_id, sess_id, - req_type, req_num); + DIAMETER_SUCCESS, req_type, req_num); } Gy_UNIT.send(tx_dia); } diff --git a/library/DIAMETER_ts32_299_Templates.ttcn b/library/DIAMETER_ts32_299_Templates.ttcn index af8f514..c22b6fa 100644 --- a/library/DIAMETER_ts32_299_Templates.ttcn +++ b/library/DIAMETER_ts32_299_Templates.ttcn @@ -41,13 +41,14 @@ template (value) PDU_DIAMETER ts_DIA_Gy_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, template (value) octetstring sess_id, + template (value) DIAMETER_Resultcode res_code, template (value) DCC_NONE_CC_Request_Type req_type, template (value) AVP_Unsigned32 req_num) := 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 := { ts_AVP_SessionId(sess_id), - ts_AVP_ResultCode(DIAMETER_SUCCESS), + ts_AVP_ResultCode(res_code), ts_AVP_OriginHost("ocs.localdomain"), ts_AVP_OriginRealm("localdomain"), ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn index fb893fc..0fa7394 100644 --- a/pgw/PGW_Tests.ttcn +++ b/pgw/PGW_Tests.ttcn @@ -132,6 +132,14 @@ OCT4 teid_remote optional }; +type record SessionParsGy { + /* In seconds. 0 => disabled, !0 => grant over CC-Time period */ + integer validity_time, + + /* Result-Code to use when sending Gy CCA, usually DIAMETER_SUCCESS */ + DIAMETER_Resultcode cca_res_code +}; + /* configuration data for a given Session */ type record SessionPars { hexstring imsi, @@ -159,8 +167,7 @@ charstring tun_dev_name, charstring tun_netns_name optional, - /* In seconds. 0 => disabled, !0 => grant over CC-Time period */ - integer gy_validity_time + SessionParsGy gy } template (value) SessionPars @@ -188,7 +195,10 @@ }, tun_dev_name := tundev, tun_netns_name := tundev, - gy_validity_time := 0 + gy := { + validity_time := 0, + cca_res_code := DIAMETER_SUCCESS + } } @@ -588,12 +598,12 @@ 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_pars.gy_validity_time > 0) { + if (g_pars.gy.validity_time > 0) { 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_pars.gy_validity_time); + req_type, req_num, g_pars.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, - req_type, req_num); + g_pars.gy.cca_res_code, req_type, req_num); } Gy.send(tx_dia); } @@ -1046,7 +1056,7 @@ testcase TC_gy_charging_cc_time() runs on PGW_Test_CT { var PGW_Session_CT vc_conn; var SessionPars pars := valueof(t_SessionPars('001010123456789'H, "tun23")); - pars.gy_validity_time := 3; /* Grant access for 3 seconds, needs to be re-validated afterwards */ + pars.gy.validity_time := 3; /* Grant access for 3 seconds, needs to be re-validated afterwards */ f_init(); vc_conn := f_start_handler(refers(f_TC_gy_charging_cc_time), pars); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36344?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: I2c3b1057908c1c76a55c41a7f45728a0fdee3cf0 Gerrit-Change-Number: 36344 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-MessageType: newchange