Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-08-06 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..

msc: add MSC_Tests.TC_call_re_establishment

The osmo-msc patch that makes this test pass is
I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

Related: SYS#5130
Change-Id: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
---
M msc/MSC_Tests.ttcn
1 file changed, 115 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index f0421c7..c9207aa 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -6641,6 +6641,119 @@
vc_conn.done;
 }

+const charstring REEST_LOST_CONNECTION := "REEST_LOST_CONNECTION";
+const charstring REEST_CLEARED := "REEST_CLEARED";
+
+friend function f_tc_call_re_establishment_1(charstring id, BSC_ConnHdlrPars 
pars)
+  runs on BSC_ConnHdlr {
+   f_init_handler(pars, t_guard := 30.0);
+
+   f_perform_lu();
+
+   var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
+   f_mo_call_establish(cpars);
+   f_sleep(3.0);
+   COORD.send(REEST_LOST_CONNECTION);
+   COORD.send(cpars);
+   f_expect_clear(verify_vlr_cell_id := false);
+   COORD.send(REEST_CLEARED);
+}
+
+friend function f_tc_call_re_establishment_2(charstring id, BSC_ConnHdlrPars 
pars)
+  runs on BSC_ConnHdlr {
+   f_init_handler(pars, t_guard := 30.0);
+   var CallParameters cpars;
+
+   COORD.receive(REEST_LOST_CONNECTION);
+   COORD.receive(tr_CallParams) -> value cpars;
+
+   f_gsup_change_connhdlr(hex2str(g_pars.imsi));
+   f_create_smpp_expect(hex2str(pars.msisdn));
+
+   /* The MS has lost the first channel and decides to show up on a new 
conn (on a nearby neighbor cell) to ask for
+* CM Re-Establishment. Send a Complete Layer 3 to osmo-msc with a CM 
Re-Establishment Request. */
+   var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+   var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REESTABL_REQ(mi));
+   f_cl3_or_initial_ue(l3_info);
+
+   /* At this point the other test component should receive the Clear 
Command for the first A connection. */
+
+   /* This new connection continues with Authentication... */
+   f_mm_common();
+
+   /* ...and with Assignment of a voice channel. */
+   var template BSSMAP_IE_AoIP_TransportLayerAddress tla_ass :=
+   f_tr_BSSMAP_IE_AoIP_TLA(cpars.mgw_conn_1.mgw_rtp_ip, ?);
+   BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass));
+   /* By this Assignment Request, the CM Re-Establishment Request is 
implicitly accepted. */
+
+   /* Send Assignment Complete from BSC */
+   var template BSSMAP_IE_AoIP_TransportLayerAddress tla;
+   tla := f_ts_BSSMAP_IE_AoIP_TLA(cpars.bss_rtp_ip, cpars.bss_rtp_port);
+   var BSSMAP_IE_SpeechCodec codec;
+   codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}));
+
+   /* Make really sure the other component is done with its MGCP */
+   COORD.receive(REEST_CLEARED);
+
+   /* Transfer state for this call over to this test component so we can 
resolve MNCC and MGCP in this function. */
+   f_mncc_change_connhdlr(cpars.mncc_callref);
+   f_mgcp_change_connhdlr(cpars.mgcp_ep);
+
+   /* osmo-msc may redirect the MGW endpoint to the newly allocated 
channel.
+* Apparently osmo-msc currently also sends an MDCX to the CN side, 
just repeating the same configuration that
+* is already in use. This test accepts any number of or even lack of 
MDCX. */
+   var default ack_mdcx := activate(as_mgcp_ack_all_mdcx(cpars));
+
+   BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec));
+   /* The call has been fully re-established.
+* Let a bit of time pass before hanging up, for everything to settle. 
*/
+   f_sleep(3.0);
+
+   deactivate(ack_mdcx);
+
+   /* Hang up the call and clear the new, second A connection */
+   var default ack_dlcx := activate(as_mgcp_ack_all_dlcx(cpars));
+
+   /* CC release. This is the proper MS initiated release sequence as 
shown by
+* 
https://git.osmocom.org/osmo-msc/tree/doc/sequence_charts/voice_call_full.msc?id=e53ecde83e4fb2470209e818e9ad76a2d6a19190
+* f_call_hangup() seems a bit mixed up, so here a "proper" sequence. 
Fix of f_call_hangup() pending. */
+   BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_DISC(cpars.transaction_id, '0'B, 
'000'B)));
+   MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref));
+   MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, 
valueof(ts_MNCC_cause(23;
+   
BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id)));
+   

Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-08-02 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 02 Aug 2021 15:08:21 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-29 Thread osmith
osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..


Patch Set 3: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070/3/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070/3/msc/MSC_Tests.ttcn@6647
PS3, Line 6647: 30.0
seems pretty high, also below. Shouldn't 10s be more than enough?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 29 Jul 2021 16:28:53 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-28 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 28 Jul 2021 16:25:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-28 Thread neels
Hello Jenkins Builder, pespin,

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

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

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

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..

msc: add MSC_Tests.TC_call_re_establishment

The osmo-msc patch that makes this test pass is
I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

Related: SYS#5130
Change-Id: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
---
M msc/MSC_Tests.ttcn
1 file changed, 115 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/70/25070/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-28 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 28 Jul 2021 12:05:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-27 Thread neels
neels has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )

Change subject: msc: add MSC_Tests.TC_call_re_establishment
..

msc: add MSC_Tests.TC_call_re_establishment

The osmo-msc patch that makes this test pass is
I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

Related: SYS#5130
Change-Id: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
---
M msc/MSC_Tests.ttcn
1 file changed, 107 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/70/25070/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070
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: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
Gerrit-Change-Number: 25070
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: msc: add MSC_Tests.TC_call_re_establishment

2021-07-27 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25070 )


Change subject: msc: add MSC_Tests.TC_call_re_establishment
..

msc: add MSC_Tests.TC_call_re_establishment

The osmo-msc patch that makes this test pass is
I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

Related: SYS#5130
Change-Id: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
---
M msc/MSC_Tests.ttcn
1 file changed, 107 insertions(+), 0 deletions(-)



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

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index ecfe5f9..428dae3 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -6626,6 +6626,111 @@
vc_conn.done;
 }

+const charstring REEST_LOST_CONNECTION := "REEST_LOST_CONNECTION";
+const charstring REEST_CLEARED := "REEST_CLEARED";
+
+friend function f_tc_call_re_establishment_1(charstring id, BSC_ConnHdlrPars 
pars)
+  runs on BSC_ConnHdlr {
+   f_init_handler(pars, t_guard := 30.0);
+
+   f_perform_lu();
+
+   var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
+   f_mo_call_establish(cpars);
+   f_sleep(3.0);
+   COORD.send(REEST_LOST_CONNECTION);
+   COORD.send(cpars);
+   f_expect_clear(verify_vlr_cell_id := false);
+   COORD.send(REEST_CLEARED);
+}
+
+friend function f_tc_call_re_establishment_2(charstring id, BSC_ConnHdlrPars 
pars)
+  runs on BSC_ConnHdlr {
+   f_init_handler(pars, t_guard := 30.0);
+   var CallParameters cpars;
+
+   COORD.receive(REEST_LOST_CONNECTION);
+   COORD.receive(tr_CallParams) -> value cpars;
+
+   /* The MS has lost the first channel and decides to show up on a new 
conn (on a nearby neighbor cell) to ask for
+* CM Re-Establishment. Send a Complete Layer 3 to osmo-msc with a CM 
Re-Establishment Request. */
+   var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+   var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REESTABL_REQ(mi));
+   f_cl3_or_initial_ue(l3_info);
+
+   /* At this point the other test component should receive the Clear 
Command for the first A connection. */
+
+   /* This new connection continues with Authentication... */
+   f_mm_common();
+
+   /* ...and with Assignment of a voice channel. */
+   var template BSSMAP_IE_AoIP_TransportLayerAddress tla_ass :=
+   f_tr_BSSMAP_IE_AoIP_TLA(cpars.mgw_conn_1.mgw_rtp_ip, ?);
+   BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass));
+   /* By this Assignment Request, the CM Re-Establishment Request is 
implicitly accepted. */
+
+   /* Send Assignment Complete from BSC */
+   var template BSSMAP_IE_AoIP_TransportLayerAddress tla;
+   tla := f_ts_BSSMAP_IE_AoIP_TLA(cpars.bss_rtp_ip, cpars.bss_rtp_port);
+   var BSSMAP_IE_SpeechCodec codec;
+   codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}));
+
+   /* Make really sure the other component is done with its MGCP */
+   COORD.receive(REEST_CLEARED);
+
+   /* Transfer state for this call over to this test component so we can 
resolve MNCC and MGCP in this function. */
+   f_create_mncc_steal_call(cpars.mncc_callref);
+   f_create_mgcp_steal_ep(cpars.mgcp_ep);
+
+   /* osmo-msc may redirect the MGW endpoint to the newly allocated 
channel.
+* Apparently osmo-msc currently also sends an MDCX to the CN side, 
just repeating the same configuration that
+* is already in use. This test accepts any number of or even lack of 
MDCX. */
+   var default ack_mdcx := activate(as_mgcp_ack_all_mdcx(cpars));
+
+   BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec));
+   /* The call has been fully re-established.
+* Let a bit of time pass before hanging up, for everything to settle. 
*/
+   f_sleep(3.0);
+
+   deactivate(ack_mdcx);
+
+   /* Hang up the call and clear the new, second A connection */
+   var default ack_dlcx := activate(as_mgcp_ack_all_dlcx(cpars));
+
+   /* CC release. This is the proper MS initiated release sequence as 
shown by
+* 
https://git.osmocom.org/osmo-msc/tree/doc/sequence_charts/voice_call_full.msc?id=e53ecde83e4fb2470209e818e9ad76a2d6a19190
+* f_call_hangup() seems a bit mixed up, so here a "proper" sequence. 
Fix of f_call_hangup() pending. */
+   BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_DISC(cpars.transaction_id, '0'B, 
'000'B)));
+   MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref));
+   MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, 
valueof(ts_MNCC_cause(23;
+   
BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id)));
+   BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id, 
'0'B)));
+   MNCC.receive(tr_MNCC_REL_cnf(cpars.mncc_callref, cause := *));
+
+   /* BSSAP clear */
+   interleave {
+   [] BSSAP.receive(tr_BSSMAP_ClearCommand) {
+