Change in osmo-ttcn3-hacks[master]: sgsn: add TC_attach_no_imsi_response

2018-06-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9578 )

Change subject: sgsn: add TC_attach_no_imsi_response
..

sgsn: add TC_attach_no_imsi_response

Ignores Identity Request IMSI.

MS -> SGSN: Attach Request TMSI (unknown)
MS <- SGSN: Identity Request IMEI (optional)
MS -> SGSN: Identity Response IMEI (optional)
MS <- SGSN: Identity Request IMSI
MS -x SGSN: no response
MS <- SGSN: re-send: Identity Request IMSI 4x
MS <- SGSN: Attach Reject

Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 48 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c1d4cdf..9632718 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1411,6 +1411,53 @@
vc_conn.done;
 }

+/* Attempt an attach, but loose the Identification Request (IMSI) */
+private function f_TC_attach_no_imsi_response(charstring id) runs on 
BSSGP_ConnHdlr {
+   var integer count_req := 0;
+   var MobileL3_CommonIE_Types.MobileIdentityLV mi;
+
+   /* set p_tmsi to use it in Attach Req via f_mi_get_lv() */
+   g_pars.p_tmsi := 'c035'O;
+
+   BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, 
false, omit, omit));
+
+   alt {
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+   /* break */
+   }
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+   /* ignore ID REQ IMSI */
+   count_req := count_req + 1;
+   repeat;
+   }
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+   mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
+   BSSGP.send(ts_GMM_ID_RESP(mi));
+   repeat;
+   }
+   }
+   if (count_req != 5) {
+   setverdict(fail, "Did not received GMM ID Request Type IMSI 5 
times!");
+   }
+   setverdict(pass);
+}
+
+testcase TC_attach_no_imsi_response() runs on test_CT {
+   /* MS -> SGSN: Attach Request TMSI (unknown)
+* MS <- SGSN: Identity Request IMEI (optional)
+* MS -> SGSN: Identity Response IMEI (optional)
+* MS <- SGSN: Identity Request IMSI
+* MS -x SGSN: no response
+* MS <- SGSN: re-send: Identity Request IMSI 4x
+* MS <- SGSN: Attach Reject
+*/
+   var BSSGP_ConnHdlr vc_conn;
+   f_init();
+   f_sleep(1.0);
+   vc_conn := f_start_handler(refers(f_TC_attach_no_imsi_response), 
testcasename(), g_gb[0], 35, 60.0);
+   vc_conn.done;
+}
+
 control {
execute( TC_attach() );
execute( TC_attach_mnc3() );
@@ -1425,6 +1472,7 @@
execute( TC_attach_accept_all() );
execute( TC_attach_closed() );
execute( TC_attach_no_imei_response() );
+   execute( TC_attach_no_imsi_response() );
execute( TC_hlr_location_cancel_request_update(), 10.0 );
execute( TC_hlr_location_cancel_request_withdraw(), 10.0 );
execute( TC_hlr_location_cancel_request_unknown_subscriber_withdraw(), 
10.0 );

--
To view, visit https://gerrit.osmocom.org/9578
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
Gerrit-Change-Number: 9578
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-ttcn3-hacks[master]: sgsn: add TC_attach_no_imsi_response

2018-06-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9578 )

Change subject: sgsn: add TC_attach_no_imsi_response
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9578
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
Gerrit-Change-Number: 9578
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Wed, 13 Jun 2018 10:26:07 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: sgsn: add TC_attach_no_imsi_response

2018-06-12 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/9578


Change subject: sgsn: add TC_attach_no_imsi_response
..

sgsn: add TC_attach_no_imsi_response

Ignores Identity Request IMSI.

MS -> SGSN: Attach Request TMSI (unknown)
MS <- SGSN: Identity Request IMEI (optional)
MS -> SGSN: Identity Response IMEI (optional)
MS <- SGSN: Identity Request IMSI
MS -x SGSN: no response
MS <- SGSN: re-send: Identity Request IMSI 4x
MS <- SGSN: Attach Reject

Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 48 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/78/9578/1

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c1d4cdf..9632718 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1411,6 +1411,53 @@
vc_conn.done;
 }

+/* Attempt an attach, but loose the Identification Request (IMSI) */
+private function f_TC_attach_no_imsi_response(charstring id) runs on 
BSSGP_ConnHdlr {
+   var integer count_req := 0;
+   var MobileL3_CommonIE_Types.MobileIdentityLV mi;
+
+   /* set p_tmsi to use it in Attach Req via f_mi_get_lv() */
+   g_pars.p_tmsi := 'c035'O;
+
+   BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, 
false, omit, omit));
+
+   alt {
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+   /* break */
+   }
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+   /* ignore ID REQ IMSI */
+   count_req := count_req + 1;
+   repeat;
+   }
+   [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+   mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
+   BSSGP.send(ts_GMM_ID_RESP(mi));
+   repeat;
+   }
+   }
+   if (count_req != 5) {
+   setverdict(fail, "Did not received GMM ID Request Type IMSI 5 
times!");
+   }
+   setverdict(pass);
+}
+
+testcase TC_attach_no_imsi_response() runs on test_CT {
+   /* MS -> SGSN: Attach Request TMSI (unknown)
+* MS <- SGSN: Identity Request IMEI (optional)
+* MS -> SGSN: Identity Response IMEI (optional)
+* MS <- SGSN: Identity Request IMSI
+* MS -x SGSN: no response
+* MS <- SGSN: re-send: Identity Request IMSI 4x
+* MS <- SGSN: Attach Reject
+*/
+   var BSSGP_ConnHdlr vc_conn;
+   f_init();
+   f_sleep(1.0);
+   vc_conn := f_start_handler(refers(f_TC_attach_no_imsi_response), 
testcasename(), g_gb[0], 35, 60.0);
+   vc_conn.done;
+}
+
 control {
execute( TC_attach() );
execute( TC_attach_mnc3() );
@@ -1425,6 +1472,7 @@
execute( TC_attach_accept_all() );
execute( TC_attach_closed() );
execute( TC_attach_no_imei_response() );
+   execute( TC_attach_no_imsi_response() );
execute( TC_hlr_location_cancel_request_update(), 10.0 );
execute( TC_hlr_location_cancel_request_withdraw(), 10.0 );
execute( TC_hlr_location_cancel_request_unknown_subscriber_withdraw(), 
10.0 );

--
To view, visit https://gerrit.osmocom.org/9578
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f41d59cfe6b0168b5e0874082fd700b56a7f0da
Gerrit-Change-Number: 9578
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus