summaryrefslogtreecommitdiffstats
path: root/ggsn_tests/GGSN_Tests.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-04-10 10:15:28 +0200
committerpespin <pespin@sysmocom.de>2019-07-03 16:24:19 +0000
commitf82985484bb0bdd3142b872d13cb49fe7f0fc588 (patch)
tree4043bea08bb7cfd02342372f70e88ce9999c6adb /ggsn_tests/GGSN_Tests.ttcn
parent7aa027413810e61cc0dc01832775e3ebb193999a (diff)
ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken()
This test case reproduces a real-world PCO capture including a broken PAP AuthenticationReq. It triggers some weird behavior in OsmoGGSN 1.3.0 where it would send duplicate IPCP repsonses and no PAP response. Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Related: OS#3914
Diffstat (limited to 'ggsn_tests/GGSN_Tests.ttcn')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn35
1 files changed, 35 insertions, 0 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index dc9d07c..31c1056 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -22,6 +22,7 @@ module GGSN_Tests {
import from GTPC_Types all;
import from GTPU_Types all;
import from IPCP_Types all;
+ import from PAP_Types all;
import from IP_Types all;
import from ICMP_Types all;
import from ICMPv6_Types all;
@@ -932,6 +933,39 @@ module GGSN_Tests {
f_pdp_ctx_del(ctx, '1'B);
}
+ /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP + PAP authentication (broken) */
+ testcase TC_pdp4_act_deact_ipcp_pap_broken() runs on GT_CT {
+ f_init();
+ var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1);
+ var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2);
+ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
+ ctx.pco_req := valueof(ts_PCO_PAP_IPv4_DNS);
+ f_pdp_ctx_act(ctx);
+ f_PCO_ensure_no_duplicates(ctx.pco_neg);
+ /* verify IPCP is at all contained */
+ if (not match(ctx.pco_neg, tr_PCO_Contains('8021'O))) {
+ setverdict(fail, "IPCP not found in PCO");
+ }
+ /* verify IPCP contains both primary and secondary DNS */
+ var IpcpPacket ipcp := dec_IpcpPacket(f_PCO_extract_proto(ctx.pco_neg, '8021'O));
+ if (not match(ipcp, tr_IPCP_Ack_DNS(0, ggsn_ip4_dns1, ggsn_ip4_dns2))) {
+ if (not match(ipcp, tr_IPCP_Ack_DNS(0))) {
+ setverdict(fail, "Primary/Secondary DNS PCO IPCP option not found");
+ } else {
+ setverdict(fail, "Primary/Secondary DNS PCO IPCP option found but not matching expected values");
+ }
+ }
+ /* verify that PAP is contained */
+ if (not match(ctx.pco_neg, tr_PCO_Contains('C023'O))) {
+ setverdict(fail, "PAP not found in PCO");
+ }
+ var PapPacket pap := dec_PapPacket(f_PCO_extract_proto(ctx.pco_neg, 'C023'O));
+ if (not match(pap, tr_PAP_AuthAck)) {
+ setverdict(fail, "PAP isn't an AuthenticateAck: ", pap);
+ }
+ f_pdp_ctx_del(ctx, '1'B);
+ }
+
/* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in PCO */
testcase TC_pdp4_act_deact_pcodns() runs on GT_CT {
f_init();
@@ -1277,6 +1311,7 @@ module GGSN_Tests {
control {
execute(TC_pdp4_act_deact());
execute(TC_pdp4_act_deact_ipcp());
+ execute(TC_pdp4_act_deact_ipcp_pap_broken());
execute(TC_pdp4_act_deact_pcodns());
execute(TC_pdp4_act_deact_gtpu_access());
execute(TC_pdp4_clients_interact_with_txseq());