aboutsummaryrefslogtreecommitdiffstats
path: root/ggsn_tests
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-03-07 14:35:45 +0100
committerpespin <pespin@sysmocom.de>2022-03-09 09:07:39 +0000
commitc441ce001cc61d1ecf19957e54b601aa21fd5c80 (patch)
tree0b2cc11cd8926daf45951331e5e1d12497ccdfad /ggsn_tests
parent9fe1320a7899121de6e4bf9861c114d35864c814 (diff)
ggsn_tests: Wait for retrans queues to drain after each test
Otherwise a new test may reuse the same GTP seqnum, and if it's still in the gtp retransmit resp queue of the GGSN, it may be identified as a duplicate retransmittion of a previous message (previous test) and send back the previous response instead of processing the request. Related: OS#5485 Change-Id: I1b04691987b883f63c95c0322a477db4a43df2b1
Diffstat (limited to 'ggsn_tests')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn53
1 files changed, 50 insertions, 3 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 05d335a8..eb09555b 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -259,6 +259,17 @@ module GGSN_Tests {
}
}
+ function f_shutdown_helper() runs on GT_CT {
+ /* Sleep N3_REQUESTS * T3_REQUEST seconds, nowadays 5*3=15s.
+ * This ensures all retransmit queues are cleared before jumping
+ * into next tests, hence avoding situation where a test resuses
+ * a seqnum still in the GGSN's resp queue (dup req detector).
+ * See OS#5485 avout decreasing time. We could also add a new
+ * VTY command that calls gtp_clear_queues() */
+ f_sleep(15.0);
+ setverdict(pass);
+ }
+
/* Altstep implementing responses to any incoming echo requests */
private altstep pingpong() runs on GT_CT {
var Gtp1cUnitdata ud;
@@ -1023,6 +1034,7 @@ module GGSN_Tests {
var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn)));
f_pdp_ctx_act(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test IPv6 context activation for dynamic IPv6 EUA wirh request of IPv6 DNS in PCO */
@@ -1046,6 +1058,7 @@ module GGSN_Tests {
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement */
@@ -1065,6 +1078,7 @@ module GGSN_Tests {
f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx));
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement.
@@ -1096,6 +1110,7 @@ module GGSN_Tests {
f_wait_icmp6_echo_reply(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Check that attempting RA with another ll src addr won't work, packet dropped: */
@@ -1115,6 +1130,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Assert that packets with wrong global src addr are dropped by GGSN */
@@ -1135,6 +1151,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped */
@@ -1154,6 +1171,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Validate if different clients (pdp ctx) can reach one another through GGSN. */
@@ -1186,6 +1204,7 @@ module GGSN_Tests {
f_pdp_ctx_del(ctxA, '1'B);
f_pdp_ctx_del(ctxB, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4 EUA without DNS request */
@@ -1194,6 +1213,7 @@ module GGSN_Tests {
var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
f_pdp_ctx_act(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP */
@@ -1219,6 +1239,7 @@ module GGSN_Tests {
}
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP + PAP authentication (broken) */
@@ -1252,6 +1273,7 @@ module GGSN_Tests {
setverdict(fail, "PAP isn't an AuthenticateAck: ", pap);
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in PCO */
@@ -1274,6 +1296,7 @@ module GGSN_Tests {
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4 EUA.
@@ -1293,6 +1316,7 @@ module GGSN_Tests {
f_wait_icmp4_echo_reply(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Assert that packets with wrong global src addr are dropped by GGSN */
@@ -1310,6 +1334,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Send an IPv6 RA to APN4, should fail (packet dropped) */
@@ -1325,6 +1350,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Helper function for tests below. */
@@ -1347,12 +1373,14 @@ module GGSN_Tests {
testcase TC_pdp4_clients_interact_with_txseq() runs on GT_CT {
use_gtpu_txseq := true;
f_pdp4_clients_interact();
+ f_shutdown_helper();
}
/* Validate if different clients (pdp ctx) can reach one another through GGSN (without Tx sequence number). */
testcase TC_pdp4_clients_interact_without_txseq() runs on GT_CT {
use_gtpu_txseq := false;
f_pdp4_clients_interact();
+ f_shutdown_helper();
}
testcase TC_echo_req_resp() runs on GT_CT {
@@ -1365,6 +1393,7 @@ module GGSN_Tests {
[] T_default.timeout { setverdict(fail); }
}
T_default.stop;
+ f_shutdown_helper();
}
testcase TC_echo_req_resp_gtpu() runs on GT_CT {
@@ -1377,6 +1406,7 @@ module GGSN_Tests {
[] T_default.timeout { setverdict(fail); }
}
T_default.stop;
+ f_shutdown_helper();
}
/* Test if the parser can cope with PCO that only contain either a
@@ -1422,6 +1452,7 @@ module GGSN_Tests {
setverdict(fail, "Secondary DNS IPv4 PCO option not found");
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test if the parser can cope with PCO that contains primary and secondary DNS in a separate IPCP container.
@@ -1458,6 +1489,7 @@ module GGSN_Tests {
setverdict(fail, "Secondary DNS IPv4 PCO option not found");
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Validate that SUT updates remote TEIC when requested through UpdatePDPContextRequest */
@@ -1473,6 +1505,7 @@ module GGSN_Tests {
f_pdp_ctx_update(ctx, new_teic := new_teic);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Validate that SUT updates remote TEID when requested through UpdatePDPContextRequest */
@@ -1500,6 +1533,7 @@ module GGSN_Tests {
f_wait_icmp4_echo_reply(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test IPv4v6 context activation for dynamic IPv4v6 EUA without DNS request */
@@ -1508,6 +1542,7 @@ module GGSN_Tests {
var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet46, valueof(t_EuaIPv4Dynv6Dyn)));
f_pdp_ctx_act(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4v6 EUA with IPv4 DNS in IPCP */
@@ -1534,6 +1569,7 @@ module GGSN_Tests {
}
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4v6 EUA with IPv6 DNS in PCO and router solicitation/advertisement */
@@ -1548,6 +1584,7 @@ module GGSN_Tests {
f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp46(ctx));
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test IPv4v6 context activation for dynamic IPv4v6 EUA with request of IPv4 DNS in PCO */
@@ -1571,6 +1608,7 @@ module GGSN_Tests {
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test IPv4v6 context activation for dynamic IPv4v6 EUA with request of IPv6 DNS in PCO */
@@ -1594,6 +1632,7 @@ module GGSN_Tests {
}
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Test PDP context activation for dynamic IPv4v6 EUA.
@@ -1612,6 +1651,7 @@ module GGSN_Tests {
f_wait_icmp4_echo_reply(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Assert that packets with wrong ipv4 src addr are dropped by GGSN on APN IPv4v6 */
@@ -1628,6 +1668,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Check that attempting RA with another ll src addr won't work, packet dropped: */
@@ -1643,6 +1684,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Assert that packets with wrong ipv6 global src addr are dropped by GGSN on APN IPv4v6 */
@@ -1663,6 +1705,7 @@ module GGSN_Tests {
f_wait_gtpu_fail(ctx);
f_pdp_ctx_del(ctx, '1'B);
+ f_shutdown_helper();
}
/* Validate if different clients (pdp ctx) can reach one another through GGSN. */
@@ -1695,6 +1738,7 @@ module GGSN_Tests {
f_pdp_ctx_del(ctxA, '1'B);
f_pdp_ctx_del(ctxB, '1'B);
+ f_shutdown_helper();
}
/* Test IPv4v6 context activation for dynamic IPv4v6 EUA on a v4-only APN */
@@ -1733,6 +1777,7 @@ module GGSN_Tests {
f_pdp_ctx_del(ctx4, '1'B);
}
+ f_shutdown_helper();
}
/* Validate if 2nd CtxCreateReq with increased Recovery IE causes ggsn to drop 1st one (while keeping 2nd one). */
@@ -1795,6 +1840,7 @@ module GGSN_Tests {
T_default.stop;
f_pdp_ctx_del(ctxB, '1'B);
+ f_shutdown_helper();
}
@@ -1817,6 +1863,7 @@ module GGSN_Tests {
/* Now send a new pdp ctx del (increased seqnum). It should fail with cause "non-existent": */
var OCT1 cause_nonexistent := 'C0'O;
f_pdp_ctx_del(ctx, '1'B, cause_nonexistent, expect_diameter := false);
+ f_shutdown_helper();
}
/* Activate PDP context + trigger Recovery procedure through EchoResp */
@@ -1859,7 +1906,7 @@ module GGSN_Tests {
}
T_echo.stop;
f_pdp_ctx_exp_del_req(ctx, omit, true);
- setverdict(pass);
+ f_shutdown_helper();
}
/* Test creation, user plane and deletion of big amount (1000) of concurrent PDP context */
@@ -1972,7 +2019,7 @@ module GGSN_Tests {
T_next.stop;
T_default.stop;
- setverdict(pass);
+ f_shutdown_helper();
}
/* Test callocation of PDP contexts until reaching addr pool exhaustion */
@@ -2073,7 +2120,7 @@ module GGSN_Tests {
T_next.stop;
T_default.stop;
- setverdict(pass);
+ f_shutdown_helper();
}
control {