aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-02-09 16:37:47 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-02-11 13:10:20 +0100
commit480e67f00daf3e3a95ef15a352158caedb7092f9 (patch)
tree2a058c61a06e37db51b73696c5271d514d2df443
parent134aea932d58ee5b23899f62b7a224997c91db9e (diff)
ggsn: Test GTP-U Echo Request/Response
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn13
-rw-r--r--library/GTP_Templates.ttcn17
2 files changed, 28 insertions, 2 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index ae24eeba..5ec535c9 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -1213,6 +1213,18 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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 8f6098ac..0a9c5e9c 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -1121,7 +1121,7 @@ module GTP_Templates {
}
/* 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 @@ module GTP_Templates {
}
- /* 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 @@ module GTP_Templates {
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 := {