pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27105 )
Change subject: ggsn: Test GTP-U Echo Request/Response ......................................................................
ggsn: Test GTP-U Echo Request/Response
Change-Id: Id92180be948ee3f5246c7befec666698a1b074f3 --- M ggsn_tests/GGSN_Tests.ttcn M library/GTP_Templates.ttcn 2 files changed, 28 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/27105/1
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index ae24eeb..5ec535c 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -1213,6 +1213,18 @@ T_default.stop; }
+ testcase TC_echo_req_resp_gtpu() runs on GT_CT { + f_init(); + GTPU.send(ts_GTPU_PING(g_peer_u, g_d_seq_nr)); + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_PONG(g_peer_u)) { setverdict(pass); }; + [] GTPU.receive { repeat; }; + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + /* Test if the parser can cope with PCO that only contain either a * single primary DNS or a secondary DNS. */ testcase TC_pdp4_act_deact_with_single_dns() runs on GT_CT { @@ -1600,6 +1612,7 @@ execute(TC_pdp46_act_deact_apn4());
execute(TC_echo_req_resp()); + execute(TC_echo_req_resp_gtpu()); execute(TC_pdp_act2_recovery()); execute(TC_act_deact_retrans_duplicate());
diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 8f6098a..0a9c5e9 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -1121,7 +1121,7 @@ }
/* generalized GTP-U send template */ - template PDU_GTPU ts_GTP1U_PDU(OCT1 msg_type, template (omit) uint16_t seq, OCT4 teid, GTPU_IEs ies) := { + template (value) PDU_GTPU ts_GTP1U_PDU(OCT1 msg_type, template (omit) uint16_t seq, OCT4 teid, GTPU_IEs ies) := { /* N-PDU Number flag (PN): the GTP-U header contains a meaningful N-PDU Number field if the PN * flag is set to 1. */ pn_bit := '0'B, /* we assume the encoder overwrites this if an optional part is given */ @@ -1153,8 +1153,9 @@ }
- /* template matching reception of GTP-U echo-request */ + /* template matching reception of GTP-U echo-request/response */ template Gtp1uUnitdata tr_GTPU_PING(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoRequest, '00000000'O); + template Gtp1uUnitdata tr_GTPU_PONG(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoResponse, '00000000'O);
/* template matching reception of GTP-U GPDU */ template GTPU_IEs t_GPDU(template octetstring data) := { @@ -1167,6 +1168,18 @@ gtpu := tr_GTP1U_PDU('FF'O, teid, t_GPDU(data)) }
+ template GTPU_IEs ts_UEchoReqPDU := { + echoRequest_IEs := { + private_extension_gtpu := omit + } + } + + /* master template for sending a GTP-C echo request */ + template (value) Gtp1uUnitdata ts_GTPU_PING(GtpPeer peer, uint16_t seq) := { + peer := peer, + gtpu := ts_GTP1U_PDU(echoRequest, seq, '00000000'O, valueof(ts_UEchoReqPDU)) + } + template GTPU_IEs ts_UEchoRespPDU(OCT1 restart_counter) := { echoResponse_IEs := { recovery_gtpu := {