neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34973?usp=email )


Change subject: HNBGW_Tests.TC_second_rab_assignment
......................................................................

HNBGW_Tests.TC_second_rab_assignment

Related: SYS#6624
Change-Id: Iadaba0e5e82ad6d163ad509904ede213e2462d5c
---
M hnbgw/HNBGW_Tests.ttcn
M library/ranap/RANAP_Templates.ttcn
2 files changed, 172 insertions(+), 0 deletions(-)



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

diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 505beab..c80ef89 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -2596,6 +2596,130 @@
        f_shutdown_helper();
 }

+/* When a HNB that is connected does another HNB Register, make sure the SCCP 
links for all its UEs are disconnected in
+ * reasonable time. */
+friend function f_tc_hnb_reregister_cleanup_sccp(charstring id, TestHdlrParams 
pars) runs on ConnHdlr {
+       var MgcpCommand mgcp_cmd;
+       var RANAP_PDU tx;
+
+       f_init_handler(pars, t_guard := 30.0);
+
+       /* TODO: HNBAP UE REGISTER */
+       //HNBAP.send(ts_HNBAP_UERegister())
+
+       f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
+
+       tx := f_build_initial_ue(g_pars);
+       f_iuh2iu_connect(tx);
+
+       f_create_rab(pars.mgcp_pars);
+
+       f_verify_talloc_count(HNBGWVTY, {
+                             "sccp_connection", "hnbgw_context_map" //, 
"ue_context"
+                             /* TODO: "ue_context" should also be 1, but these 
tests fail to do HNBAP UE REGISTER */
+                             }, expect_count := 1, attempts := 5);
+       f_sleep(1.0);
+
+       /* Trigger cleanup of HNB, by sending another HNBAP HNB Register 
Request */
+       var integer cell_id := g_pars.hnb_idx;
+       HNBAP.send(ts_HNBAP_HNBRegisterRequest(char2oct("TTCN3 HNodeB"),
+                                       '00F110'O,
+                                       int2bit(1 + cell_id, 28),
+                                       int2oct(2, 2),
+                                       int2oct(3, 1),
+                                       int2oct(4, 2)));
+
+       /* At this point I would like to confirm that SCCP was released by 
osmo-hnbgw:
+        *    SCCP.receive(RLSD)
+        * But this seems completely impossible. SCCP_Emulation handles RLSD 
internally without letting any other layers
+        * know about it, and it seems impossible to check whether an SCCP 
connection exists, either.
+        *
+        * Since that doesn't work, I am only checking whether the talloc 
report has any sccp_connection instances left. */
+
+       timer T := 10.0;
+       T.start;
+       alt {
+       [] as_mgcp_dlcx(pars) {}
+       [] T.timeout {
+               setverdict(fail, "Timeout waiting for DLCX");
+               mtc.stop;
+       }
+       }
+       f_sleep(3.0);
+       f_verify_talloc_count(HNBGWVTY, {
+                             "sccp_connection", "hnbgw_context_map" //, 
"ue_context"
+                             }, expect_count := 0);
+}
+
+testcase TC_hnb_reregister_cleanup_sccp() runs on test_CT {
+       var ConnHdlr vc_conn;
+       g_num_hnbs := 1;
+       f_init();
+
+       vc_conn := 
f_start_handler_with_pars(refers(f_tc_hnb_reregister_cleanup_sccp), t_pars(8));
+       vc_conn.done;
+
+       f_shutdown_helper();
+}
+
+/* In the field, we encountered a "normal" RAB Assignment that concludes 
successfully, followed by another RAB
+ * Assignment that has different SDU subflow parameters, and does not contain 
RTP information. At the time of writing,
+ * it seems that the second RAB Assignment causes a crash. Play through this 
scenario. */
+friend function f_tc_second_rab_assignment(charstring id, TestHdlrParams pars) 
runs on ConnHdlr {
+       var MgcpCommand mgcp_cmd;
+       var RANAP_PDU tx;
+       timer T := 5.0;
+
+       f_init_handler(pars);
+       f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
+
+       tx := f_build_initial_ue(g_pars);
+       f_iuh2iu_connect(tx);
+
+       f_create_rab(pars.mgcp_pars);
+
+       /* Now send a second RAB Assignment with different subflows and 
omitting transportLayerAddress. (Assuming the
+        * first RAB Assignment's transportLayerAddress remains in use 
unchanged.) */
+       var template RAB_SetupOrModifyList rab_sml;
+       rab_sml := ts_RAB_SML2(t_RAB_id(23),
+                              ts_RabParams,
+                              user_plane_info := omit,
+                              transport_layer_info := omit);
+       tx := valueof(ts_RANAP_RabAssReq(rab_sml));
+       BSSAP.send(tx);
+       T.start;
+
+       // TODO: expect response
+
+       f_sleep(5.0);
+
+       /* Send Iu Release */
+       tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention));
+       f_iu2iuh(tx);
+
+       T.start;
+       alt {
+       [] as_mgcp_dlcx(pars) {}
+       [] T.timeout {
+               setverdict(fail, "Timeout waiting for DLCX");
+       }
+       }
+
+       tx := valueof(ts_RANAP_IuReleaseComplete());
+       f_iuh2iu(tx);
+}
+
+testcase TC_second_rab_assignment() runs on test_CT {
+       var ConnHdlr vc_conn;
+       g_num_hnbs := 1;
+       f_init();
+
+       vc_conn := 
f_start_handler_with_pars(refers(f_tc_second_rab_assignment), t_pars(3));
+       vc_conn.done;
+
+       f_shutdown_helper();
+}
+
 control {
        execute(TC_hnb_register());
        execute(TC_hnb_register_duplicate());
@@ -2643,6 +2767,8 @@
        execute( TC_sgsnpool_sccp_n_pcstate_detaches_cnlink() );
        execute( TC_sgsnpool_sccp_n_pcstate_attaches_cnlink() );

+       execute(TC_second_rab_assignment());
+
        /* Run at the end since it makes osmo-hnbgw <= 1.3.0 crash: OS#5676 */
        execute(TC_hnb_reregister_reuse_sctp_assoc());

diff --git a/library/ranap/RANAP_Templates.ttcn 
b/library/ranap/RANAP_Templates.ttcn
index 051195f..a713e2d 100644
--- a/library/ranap/RANAP_Templates.ttcn
+++ b/library/ranap/RANAP_Templates.ttcn
@@ -1331,6 +1331,42 @@
        }
 } }

+/* Like ts_RAB_SML(), but more control on presence/absence of individual IEs */
+template (value) RAB_SetupOrModifyList ts_RAB_SML2(
+               template (value) RAB_ID rab_id,
+               template (omit) RAB_Parameters rab_params,
+               template (omit) UserPlaneInformation user_plane_info,
+               template (omit) TransportLayerInformation transport_layer_info
+       ) := { {
+       {
+               id := id_RAB_SetupOrModifyItem,
+               firstCriticality := reject,
+               firstValue := {
+                       rAB_SetupOrModifyItemFirst := {
+                               rAB_ID := rab_id,
+                               nAS_SynchronisationIndicator := omit,
+                               rAB_Parameters := rab_params,
+                               userPlaneInformation := user_plane_info,
+                               transportLayerInformation := 
transport_layer_info,
+                               service_Handover := omit,
+                               iE_Extensions := omit
+                       }
+               },
+               secondCriticality := ignore,
+               secondValue := {
+                       rAB_SetupOrModifyItemSecond := {
+                               pDP_TypeInformation := omit,
+                               dataVolumeReportingIndication := omit,
+                               dl_GTP_PDU_SequenceNumber := omit,
+                               ul_GTP_PDU_SequenceNumber := omit,
+                               dl_N_PDU_SequenceNumber := omit,
+                               ul_N_PDU_SequenceNumber := omit,
+                               iE_Extensions := omit
+                       }
+               }
+       }
+} }
+
 template (value) TransportLayerInformation ts_TLI_ps(template (value) 
TransportLayerAddress tla,
                                                     template (value) GTP_TEI 
gtp_tei) := {
        transportLayerAddress := tla,

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34973?usp=email
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: Iadaba0e5e82ad6d163ad509904ede213e2462d5c
Gerrit-Change-Number: 34973
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-MessageType: newchange

Reply via email to