Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-11 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c9309dd..4a47723 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -169,6 +169,8 @@
OCT4 tlli_old optional,
RoutingAreaIdentificationV ra optional,
BssgpCellIds bssgp_cell_id,
+   /* Tracks the RNC state. If true next L3 message will be sent with 
InitiualUe */
+   boolean rnc_send_initial_ue,
AuthVector vec optional,
SGSN_ConnHdlrNetworkPars net,
float t_guard,
@@ -390,6 +392,7 @@
tlli_old := omit,
ra := omit,
bssgp_cell_id := { gb[0].cfg.cell_id, gb[1].cfg.cell_id, 
gb[2].cfg.cell_id },
+   rnc_send_initial_ue := true,
vec := omit,
net := net_pars,
t_guard := t_guard,
@@ -469,28 +472,92 @@
f_cleanup();
 }

+friend function is_gb(integer gb_idx) return boolean {
+   return gb_idx < NUM_GB;
+}
+friend function is_iu(integer gb_idx) return boolean {
+   return gb_idx >= NUM_GB;
+}
+
 function f_send_llc(template (value) PDU_LLC llc_pdu, integer gb_index := 0) 
runs on BSSGP_ConnHdlr {
var octetstring llc_enc := enc_PDU_LLC(valueof(llc_pdu));
BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, 
g_pars.bssgp_cell_id[gb_index], llc_enc));
 }

-function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 
0) runs on BSSGP_ConnHdlr {
+private function f_send_l3_gmm_llc(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0) runs on BSSGP_ConnHdlr {
var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo));
var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]);
f_send_llc(ts_LLC_UI(l3_enc, sapi, '0'B, n_u), gb_index);
 }

+/* trigger sending of a RANAP InitialUE and wait for SCCP connection 
confirmation */
+function f_send_l3_initial_ue(template (value) PDU_L3_MS_SGSN l3_mo) runs on 
BSSGP_ConnHdlr {
+   log("Sending InitialUE: ", l3_mo);
+   var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
+   var RANAP_PDU ranap;
+   var LAI lai := {
+   pLMNidentity := '62F224'O,
+   lAC := '1234'O,
+   iE_Extensions := omit
+   };
+   var SAI sai := {
+   pLMNidentity := lai.pLMNidentity,
+   lAC := lai.lAC,
+   sAC := ''O, /* FIXME */
+   iE_Extensions := omit
+   };
+   var IuSignallingConnectionIdentifier sigc_id := int2bit(23, 24); /* 
FIXME */
+   var GlobalRNC_ID grnc_id := {
+   pLMNidentity := lai.pLMNidentity,
+   rNC_ID := 2342 /* FIXME */
+   };
+
+   ranap := valueof(ts_RANAP_initialUE_CS(lai, sai, l3_enc, sigc_id, 
grnc_id));
+   BSSAP.send(ts_RANAP_Conn_Req(g_pars.sccp_addr_peer, 
g_pars.sccp_addr_local, ranap));
+   alt {
+   [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
+   [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
+   setverdict(fail, "DISC.ind from SCCP");
+   mtc.stop;
+   }
+   }
+}
+
+/* send a L3 (GMM/SM) message over whatever is the appropriate lower-layer 
bearer */
+function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, integer gb_index := 
0) runs on BSSGP_ConnHdlr {
+   if (is_iu(gb_index)) {
+   if (g_pars.rnc_send_initial_ue) {
+   g_pars.rnc_send_initial_ue := false;
+   f_send_l3_initial_ue(l3_mo);
+   } else {
+   BSSAP.send(ts_PDU_DTAP_PS_MO(l3_mo));
+   }
+   } else {
+   f_send_l3_gmm_llc(l3_mo, gb_index);
+   }
+}
+
 altstep as_mm_identity(integer gb_idx := 0) runs on BSSGP_ConnHdlr {
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
-   [] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
+   [is_gb(gb_idx)] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
-   f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
+   f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
repeat;
}
-   [] 

Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 11 Sep 2019 06:18:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Tue, 10 Sep 2019 19:37:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread lynxis lazus
Hello pespin, neels, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171

to look at the new patch set (#6).

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/71/15171/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 5: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/15171/5/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15171/5/sgsn/SGSN_Tests.ttcn@528
PS5, Line 528: function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
this initial param can now be dropped.


https://gerrit.osmocom.org/#/c/15171/5/sgsn/SGSN_Tests.ttcn@757
PS5, Line 757:  f_send_l3(attach_req, gb_idx, initial := true);
This is no longer needed.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 5
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Tue, 10 Sep 2019 14:11:48 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread lynxis lazus
Hello neels, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171

to look at the new patch set (#5).

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/71/15171/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 5
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread lynxis lazus
Hello neels, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171

to look at the new patch set (#4).

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/71/15171/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/15171/3/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15171/3/sgsn/SGSN_Tests.ttcn@525
PS3, Line 525: function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
I thought we agreed that we wanted to get rid of initial param and maintain a 
array of booleans indicating it and updating it in here.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 10 Sep 2019 09:10:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-10 Thread lynxis lazus
Hello neels, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171

to look at the new patch set (#3).

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/71/15171/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-04 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@525
PS2, Line 525: function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
> good idea. […]
ACK.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 04 Sep 2019 18:54:34 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: lynxis lazus 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-03 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 2:

(3 comments)

https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@525 
PS2, Line 525: function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
> May have more sense to have an array of initial states (boolean) in 
> BSSGP_ConnHdlr with size equal t […]
good idea. @laforge, what do you think about this?


https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@644
PS2, Line 644:  var IntegrityProtectionAlgorithm 
uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1;*/
> why is this commented?
0 means UIA1. I'll change the comment to be more specific


https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@646
PS2, Line 646:  
//BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi)));
> why is this commented out? because sgsn should send it but it doesn't?
there is a seperate patch for this later in the chain.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 03 Sep 2019 18:44:08 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-03 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 2:

(4 comments)

https://gerrit.osmocom.org/#/c/15171/2//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/15171/2//COMMIT_MSG@10
PS2, Line 10: which sends L3 messages for Iu and Gb at the same time.
Not at the same time. It sends L3 messages over the requested L2 layer 
(controlled by gb_index).


https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@525
PS2, Line 525: function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
May have more sense to have an array of initial states (boolean) in 
BSSGP_ConnHdlr with size equal to values available in gb_index (btw, can we 
call it ran_index?). This way initial state is maintained inside this function 
and tests don't need to care about whether they are sending initial message or 
not (and they can still play with the value by modifying the array directly if 
needed).


https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@644
PS2, Line 644:  var IntegrityProtectionAlgorithm 
uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1;*/
why is this commented?


https://gerrit.osmocom.org/#/c/15171/2/sgsn/SGSN_Tests.ttcn@646
PS2, Line 646:  
//BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi)));
why is this commented out? because sgsn should send it but it doesn't?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 03 Sep 2019 18:35:28 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: introduce f_send_l3() to allow one function for Gb & Iu

2019-09-03 Thread lynxis lazus
Hello neels, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171

to look at the new patch set (#2).

Change subject: sgsn: introduce f_send_l3() to allow one function for Gb & Iu
..

sgsn: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/71/15171/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: SGSN: introduce f_send_l3() to allow one function for Gb & Iu

2019-08-14 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171 )

Change subject: SGSN: introduce f_send_l3() to allow one function for Gb & Iu
..


Patch Set 1: Code-Review+1

what's up with the [gb_idx >= NUM_GB] conditions?


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If47ad2be459ca7b87d9071d9ff020a51821e4433
Gerrit-Change-Number: 15171
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 15 Aug 2019 00:32:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: SGSN: introduce f_send_l3() to allow one function for Gb & Iu

2019-08-13 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15171


Change subject: SGSN: introduce f_send_l3() to allow one function for Gb & Iu
..

SGSN: introduce f_send_l3() to allow one function for Gb & Iu

f_send_l3() replaces f_send_l3_gmm_llc() to have one function
which sends L3 messages for Iu and Gb at the same time.
This allows to share most of the tests between Iu & Gb.

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



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index a7cc57f..36297c5 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -461,23 +461,79 @@
BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, 
g_pars.bssgp_cell_id[gb_index], llc_enc));
 }

-function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 
0) runs on BSSGP_ConnHdlr {
+private function f_send_l3_gmm_llc(template (value) PDU_L3_MS_SGSN l3_mo, 
integer gb_index := 0) runs on BSSGP_ConnHdlr {
var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo));
var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]);
f_send_llc(ts_LLC_UI(l3_enc, sapi, '0'B, n_u), gb_index);
 }

+/* trigger sending of a RANAP InitialUE and wait for SCCP connection 
confirmation */
+function f_send_l3_initial_ue(template (value) PDU_L3_MS_SGSN l3_mo) runs on 
BSSGP_ConnHdlr {
+   log("Sending InitialUE: ", l3_mo);
+   var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
+   var RANAP_PDU ranap;
+   var LAI lai := {
+   pLMNidentity := '62F224'O,
+   lAC := '1234'O,
+   iE_Extensions := omit
+   };
+   var SAI sai := {
+   pLMNidentity := lai.pLMNidentity,
+   lAC := lai.lAC,
+   sAC := ''O, /* FIXME */
+   iE_Extensions := omit
+   };
+   var IuSignallingConnectionIdentifier sigc_id := int2bit(23, 24); /* 
FIXME */
+   var GlobalRNC_ID grnc_id := {
+   pLMNidentity := lai.pLMNidentity,
+   rNC_ID := 2342 /* FIXME */
+   };
+
+   ranap := valueof(ts_RANAP_initialUE_CS(lai, sai, l3_enc, sigc_id, 
grnc_id));
+   BSSAP.send(ts_RANAP_Conn_Req(g_pars.sccp_addr_peer, 
g_pars.sccp_addr_local, ranap));
+   alt {
+   [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
+   [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
+   setverdict(fail, "DISC.ind from SCCP");
+   mtc.stop;
+   }
+   }
+}
+
+/* send a L3 (GMM/SM) message over whatever is the appropriate lower-layer 
bearer */
+function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, integer gb_index := 
0, boolean initial := false) runs on BSSGP_ConnHdlr {
+   if (gb_index >= NUM_GB) {
+   if (initial) {
+   f_send_l3_initial_ue(l3_mo);
+   } else {
+   BSSAP.send(ts_PDU_DTAP_PS_MO(l3_mo));
+   }
+   } else {
+   f_send_l3_gmm_llc(l3_mo, gb_index);
+   }
+}
+
 altstep as_mm_identity(integer gb_idx := 0) runs on BSSGP_ConnHdlr {
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
-   [] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
+   [gb_idx < NUM_GB] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
-   f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
+   f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
repeat;
}
-   [] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('010'B)) {
+   [gb_idx >= NUM_GB] 
BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_GMM_ID_REQ('001'B))) {
+   mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+   f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
+   repeat;
+   }
+   [gb_idx < NUM_GB] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('010'B)) {
mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
-   f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
+   f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
+   repeat;
+   }
+   [gb_idx >= NUM_GB] 
BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_GMM_ID_REQ('010'B))) {
+   mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
+   f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
repeat;
}
 }
@@ -485,9 +541,13 @@
 /* receive a L3 (GMM/SM) message over whatever is the appropriate lower-layer 
bearer */
 function f_receive_l3(template PDU_L3_SGSN_MS rx_tpl := ?, integer gb_idx := 0)
 runs on BSSGP_ConnHdlr return PDU_L3_SGSN_MS {
+   var PDU_DTAP_PS_MT mt;
var PDU_L3_SGSN_MS l3_mt;
alt {
-   [] BSSGP[gb_idx].receive(rx_tpl)