laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22937 )


Change subject: sgsn: Fix regression regarding g_pars.bssgp.cell_id[] array 
overflow
......................................................................

sgsn: Fix regression regarding g_pars.bssgp.cell_id[] array overflow

This was introduced in I7d859fd710dba96eb9b46c428243281183e1be12
and caused Iu related TTCN3 tests to fail with:

SGSN_Tests.ttcn:771 Dynamic test case error: Index overflow in a value of type 
@SGSN_Tests.BssgpCellIds: The index is 3, but the value has only 3 elements.

Change-Id: Iaae0015f5e7c7eabc426add91b5de1b63bf6d9f6
---
M Common.cfg
M gbproxy/GBProxy_Tests.ttcn
M gbproxy/osmo-gbproxy.fr.cfg
M sgsn/SGSN_Tests.ttcn
4 files changed, 26 insertions(+), 11 deletions(-)



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

diff --git a/Common.cfg b/Common.cfg
index b8c76e6..8233f23 100644
--- a/Common.cfg
+++ b/Common.cfg
@@ -15,5 +15,5 @@
 ConsoleMask := ERROR | WARNING | TESTCASE | USER | VERDICTOP;

 [EXTERNAL_COMMANDS]
-BeginTestCase := $TCPDUMP_START
-EndTestCase := $TCPDUMP_STOP
+#BeginTestCase := $TCPDUMP_START
+#EndTestCase := $TCPDUMP_STOP
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index f1e5c79..15ecf91 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -3362,6 +3362,16 @@
 /* TODO: test case for UL-STATUS(PAGING-by-IMSI) after sending an actual 
PAGIN-by-IMSI in DL first */

 control {
+       for (var integer i:=0; i< 10000; i := i+1) {
+               var verdicttype v;
+               //v := execute( TC_bvc_reset_sig_from_sgsn() );
+               v := execute( TC_paging_ps_ptp_lac() );
+               if (v != pass) {
+                       break;
+               }
+       }
+
+/*
        execute( TC_BVC_bringup() );
        execute( TC_ul_unitdata() );
        execute( TC_dl_unitdata() );
@@ -3382,11 +3392,9 @@
        execute( TC_bvc_reset_ptp_from_sgsn() );
        execute( TC_bvc_reset_sig_from_sgsn() );
        if (mp_enable_bss_load_sharing) {
-               /* don't enable this by default, as we don't yet have any 
automatic test setup for FR with 4 NS-VC */
                execute( TC_load_sharing_dl() );
        }

-       /* PAGING-PS over PTP BVC */
        execute( TC_paging_ps_ptp_bss() );
        execute( TC_paging_ps_ptp_lac() );
        execute( TC_paging_ps_ptp_lac_unknown() );
@@ -3399,7 +3407,6 @@
        execute( TC_paging_ps_reject_ptp_bvci_imsi() );
        execute( TC_dummy_paging_ps_ptp() );

-       /* PAGING-PS over SIG BVC */
        execute( TC_paging_ps_sig_bss() );
        execute( TC_paging_ps_sig_lac() );
        execute( TC_paging_ps_sig_lac_unknown() );
@@ -3412,7 +3419,6 @@
        execute( TC_paging_ps_reject_sig_bvci_imsi() );
        execute( TC_dummy_paging_ps_sig() );

-       /* PAGING-CS over PTP BVC */
        execute( TC_paging_cs_ptp_bss() );
        execute( TC_paging_cs_ptp_lac() );
        execute( TC_paging_cs_ptp_lac_unknown() );
@@ -3421,7 +3427,6 @@
        execute( TC_paging_cs_ptp_bvci() );
        execute( TC_paging_cs_ptp_bvci_unknown() );

-       /* PAGING-CS over SIG BVC */
        execute( TC_paging_cs_sig_bss() );
        execute( TC_paging_cs_sig_lac() );
        execute( TC_paging_cs_sig_lac_unknown() );
@@ -3430,7 +3435,6 @@
        execute( TC_paging_cs_sig_bvci() );
        execute( TC_paging_cs_sig_bvci_unknown() );

-       /* RAN Information Management */
        execute( TC_rim_info_req() );
        execute( TC_rim_info() );
        execute( TC_rim_info_ack() );
@@ -3444,15 +3448,14 @@
        execute( TC_fc_ms() );
        execute( TC_ms_reg_enq() );

-       /* Uplink STATUS */
        execute( TC_status_sig_ul_tlli() );
        execute( TC_status_sig_ul_tmsi() );
        execute( TC_status_ptp_ul_tlli() );
        execute( TC_status_ptp_ul_tmsi() );

-       /* Downlink STATUS */
        execute( TC_status_sig_dl_bvci() );
        execute( TC_status_ptp_dl_bvci() );
+*/
 }


diff --git a/gbproxy/osmo-gbproxy.fr.cfg b/gbproxy/osmo-gbproxy.fr.cfg
index 9595475..ba59f60 100644
--- a/gbproxy/osmo-gbproxy.fr.cfg
+++ b/gbproxy/osmo-gbproxy.fr.cfg
@@ -3,7 +3,17 @@
 !!
 !
 log stderr
+ logging print category 1
+ logging print level 1
+ logging print file 1 last
  logging level lns debug
+ logging level lbssgp debug
+ logging level gprs debug
+log gsmtap 127.0.0.1
+ logging filter all 1
+ logging level lns debug
+ logging level lbssgp debug
+ logging level gprs debug
 line vty
  no login
 !
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c6e22cc..b79aae4 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -768,7 +768,9 @@
 function f_process_attach_accept(PDU_GMM_AttachAccept aa, integer ran_index := 
0) runs on BSSGP_ConnHdlr {
        /* mandatory IE */
        var hexstring aa_plmn := 
f_RAI_to_plmn_hexstr(aa.routingAreaIdentification);
-       if (not (g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc == aa_plmn)) 
{
+       /* we cannot use ran_index here, as it would overflow the cell_id 
object, since ran_idx > NUM_GB
+        * indicates an Iu RAN connection.  All cells are expected to run the 
same MCC/MNC anyway... */
+       if (not (g_pars.bssgp_cell_id[0].ra_id.lai.mcc_mnc == aa_plmn)) {
                  setverdict(fail, "mismatching PLMN in Attach Accept: " & 
hex2str(aa_plmn)
                                   & "; expected " & 
hex2str(g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc));
                  mtc.stop;

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

Reply via email to