fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43440?usp=email )
Change subject: sgsn: add TC_attach_reattach_drops_stale_pdp
......................................................................
sgsn: add TC_attach_reattach_drops_stale_pdp
Verify that on a re-Attach with a known IMSI/P-TMSI, the SGSN drops
stale PDP contexts left over from before the MS restarted, but only
once the re-Attach has actually been authenticated.
Change-Id: I4a0b6cfbb46f673e3037c0fbf3e8c03a8b6316ad
Related: osmo-sgsn.git I20c1f5f741275115635188b2f4b1c5fe7c6e40f1
Related: OS#6922
---
M sgsn/SGSN_Tests.ttcn
M sgsn/expected-results.xml
2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks
refs/changes/40/43440/1
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 1d58b46..78d2103 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1267,6 +1267,42 @@
f_cleanup();
}
+/* ATTACH + PDP CTX ACT + re-ATTACH (with the P-TMSI allocated by the first
+ * Attach): the SGSN must recognize the known identity and release the stale
+ * PDP context left over from before towards the GGSN, but only once the
+ * re-Attach has actually been authenticated. */
+private function f_TC_attach_reattach_drops_stale_pdp(charstring id) runs on
BSSGP_ConnHdlr {
+ var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+ timer T := 5.0;
+
+ /* first perform regular attach + activate a PDP context */
+ f_TC_attach(id);
+ f_pdp_ctx_act(apars);
+
+ /* MS "restarts" and sends a re-Attach Request using the P-TMSI it was
+ * assigned before.
+ * XXX: the test is getting stuck here :/ */
+ f_gmm_attach(false, false, 0, omit, true);
+
+ /* the stale PDP context must have been released towards the GGSN */
+ T.start;
+ alt {
+ [] as_ggsn_gtp_ctx_del_req(apars) {
+ setverdict(pass);
+ }
+ [] T.timeout {
+ setverdict(fail, "SGSN did not release stale PDP context
towards GGSN after re-Attach");
+ }
+ }
+}
+testcase TC_attach_reattach_drops_stale_pdp() runs on test_CT {
+ var BSSGP_ConnHdlr vc_conn;
+ f_init();
+ vc_conn :=
f_start_handler(refers(f_TC_attach_reattach_drops_stale_pdp), testcasename(),
g_gb, 74);
+ vc_conn.done;
+ f_cleanup();
+}
+
private function f_TC_attach_echo_timeout(charstring id) runs on
BSSGP_ConnHdlr {
var Gtp1cUnitdata g_ud;
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
@@ -3423,6 +3459,7 @@
execute( TC_attach_pdp_act_user_deact_mt() );
execute( TC_attach_pdp_act_deact_dup() );
execute( TC_attach_second_attempt() );
+ execute( TC_attach_reattach_drops_stale_pdp() );
execute( TC_attach_echo_timeout() );
execute( TC_attach_restart_ctr_echo() );
execute( TC_attach_restart_ctr_create() );
diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml
index e2e099b..06352cd 100644
--- a/sgsn/expected-results.xml
+++ b/sgsn/expected-results.xml
@@ -61,6 +61,7 @@
SGSN_Tests.ttcn:MASKED TC_attach_second_attempt testcase
</failure>
</testcase>
+ <testcase classname='SGSN_Tests' name='TC_attach_reattach_drops_stale_pdp'
time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_echo_timeout'
time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_restart_ctr_echo'
time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_restart_ctr_create'
time='MASKED'/>
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43440?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4a0b6cfbb46f673e3037c0fbf3e8c03a8b6316ad
Gerrit-Change-Number: 43440
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>