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


Change subject: SGSN_Tests: test RIM message passing
......................................................................

SGSN_Tests: test RIM message passing

Add a testcase to test if RIM messages can be passed on the SGSN back
and forth.

Related: SYS#5103

Change-Id: If0ab08dcdc28819740cc07fd4dc1fea47ba10843
Related: SYS#5103
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 86 insertions(+), 0 deletions(-)



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 8e7d6e4..9d54c2e 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -171,6 +171,9 @@
        /* only needed at start to get the per-BVC references */
        port BSSGP_CT_PROC_PT PROC;

+       /* used by RIM related test */
+       port BSSGP_PT RIM[NUM_GB];
+
        var GTP_Emulation_CT vc_GTP;

        port TELNETasp_PT SGSNVTY;
@@ -247,6 +250,8 @@
                gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, 
PROC);
                disconnect(self:PROC, gb.vc_BSSGP:PROC);
        }
+       /* connect RIM related port */
+       connect(gb.vc_BSSGP:RIM, self:RIM[offset]);
 }

 private function f_init_gsup(charstring id) runs on test_CT {
@@ -3130,9 +3135,88 @@
        f_cleanup();
 }

+private function f_TC_bssgp_rim_dummy(charstring id) runs on BSSGP_ConnHdlr {
+}
+
+/* Run a RIM single report procedure over the sgsn. Since the SGSN will only 
do a transparent routing of the
+ * RIM messages this basically tests if the message is correctly transfered 
from one GB interface to the
+ * other and vice versa. */
+testcase TC_bssgp_rim_single_report() runs on test_CT {
+       var BSSGP_ConnHdlr vc_conn;
+       f_init();
+       vc_conn := f_start_handler(refers(f_TC_bssgp_rim_dummy), 
testcasename(), g_gb, 17);
+       vc_conn.done;
+
+       timer T := 2.0;
+
+       var template RIM_Routing_Address dst_addr;
+       var template RIM_Routing_Address src_addr;
+       var template RAN_Information_Request_RIM_Container req_cont;
+       var template RAN_Information_RIM_Container res_cont;
+       var template PDU_BSSGP bssgp_rim_pdu;
+       var template PDU_BSSGP bssgp_rim_pdu_expect;
+
+       dst_addr := t_RIM_Routing_Address_cid(g_gb[1].cfg.bvc[0].cell_id);
+       src_addr := t_RIM_Routing_Address_cid(g_gb[0].cfg.bvc[0].cell_id);


+       /* Send NACC Ran information request to SGSN at GB interface #0. We 
epect the SGSN to forward this request
+        * based on the cell id in dst_addr to GB interface #1. */
+       req_cont := 
ts_RAN_Information_Request_RIM_Container(ts_RIM_Application_Identity(RIM_APP_ID_NACC),
+                                                            
ts_RIM_Sequence_Number(1),
+                                                            
ts_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP),
+                                                            
ts_RIM_Protocol_Version_Number(1),
+                                                            
tsu_RAN_Information_Request_Application_Container_NACC(g_gb[1].cfg.bvc[0].cell_id),
+                                                            omit);
+       bssgp_rim_pdu := 
ts_RAN_INFORMATION_REQUEST(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, 
dst_addr),
+                                                   
ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr),
+                                                   req_cont);
+       bssgp_rim_pdu_expect := 
tr_RAN_INFORMATION_REQUEST(tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, 
dst_addr),
+                                                          
tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr),
+                                                          
tr_RAN_Information_Request_RIM_Container);
+       RIM[0].send(bssgp_rim_pdu);
+       T.start;
+       alt {
+               [] RIM[1].receive(bssgp_rim_pdu_expect) { }
+               [] RIM[1].receive {
+                       setverdict(fail, "Unexpected BSSGP RIM PDU received");
+               }
+               [] T.timeout {
+                       setverdict(fail, "No BSSGP RIM PDU received");
+                       mtc.stop;
+               }
+       }

+       /* Now also emulate also the response as well and send it back on GB 
interface #1. Expect the result on
+        * GB interface #0 */
+       var octetstring si3 := '1b753000f110236ec9033c2747407900003c0b2b2b'O
+       res_cont := 
ts_RAN_Information_RIM_Container(ts_RIM_Application_Identity(RIM_APP_ID_NACC),
+                                                    ts_RIM_Sequence_Number(2),
+                                                    
ts_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP),
+                                                    
ts_RIM_Protocol_Version_Number(1),
+                                                    
tsu_ApplContainer_or_ApplErrContainer_NACC(tsu_ApplContainer_NACC(g_gb[0].cfg.bvc[0].cell_id,false,1,si3)),
+                                                    omit);
+       bssgp_rim_pdu := 
ts_PDU_BSSGP_RAN_INFORMATION(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, 
src_addr),
+                                                                           
ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr),
+                                                                           
res_cont);
+       bssgp_rim_pdu_expect := 
tr_PDU_BSSGP_RAN_INFORMATION(tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, 
src_addr),
+                                                            
tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr),
+                                                            ?);
+       RIM[1].send(bssgp_rim_pdu);
+       T.start;
+       alt {
+               [] RIM[0].receive(bssgp_rim_pdu_expect) { }
+               [] RIM[0].receive {
+                       setverdict(fail, "Unexpected BSSGP RIM PDU received");
+               }
+               [] T.timeout {
+                       setverdict(fail, "No BSSGP RIM PDU received");
+                       mtc.stop;
+               }
+       }
+
+       f_cleanup();
+}

 control {
        execute( TC_attach() );
@@ -3196,6 +3280,8 @@
        execute( TC_suspend_rau() );
        execute( TC_paging_ps() );

+       execute( TC_bssgp_rim_single_report() );
+
        /* At the end, may crash osmo-sgsn, see OS#3957, OS#4245 */
        execute( TC_attach_req_id_req_ra_update() );
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21735
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: If0ab08dcdc28819740cc07fd4dc1fea47ba10843
Gerrit-Change-Number: 21735
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to