Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13842


Change subject: sgsn: Add initial XID handshake related tests
......................................................................

sgsn: Add initial XID handshake related tests

Change-Id: I5d4b3cba2fe05dffe10c843f16cfec343bc67b5f
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 61 insertions(+), 1 deletion(-)



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 889a16f..9399e66 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1180,7 +1180,7 @@
 }

 private altstep as_xid(PdpActPars apars) runs on BSSGP_ConnHdlr {
-       [] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID(?, apars.sapi))) {
+       [] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID_MT_CMD(?, apars.sapi))) {
                repeat;
        }
 }
@@ -2206,6 +2206,63 @@
        vc_conn.done;
 }

+/* test XID handshake with empty L3 info: expect empty return (some phones 
require that, OS#3426 */
+private function f_TC_xid_empty_l3(charstring id) runs on BSSGP_ConnHdlr {
+       var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+       var template (value) XID_Information xid;
+       var template XID_Information xid_rx;
+
+       /* first perform regular attach */
+       f_TC_attach(id);
+       /* then activate PDP context */
+       f_pdp_ctx_act(apars);
+
+       /* start MO XID */
+       xid := { ts_XID_L3(''O) };
+       xid_rx := { tr_XID_L3(''O) };
+       f_send_llc(ts_LLC_XID_MO_CMD(xid, apars.sapi));
+       alt {
+       [] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID(xid_rx, apars.sapi)));
+       [] as_xid(apars);
+       }
+       setverdict(pass);
+}
+testcase TC_xid_empty_l3() runs on test_CT {
+       var BSSGP_ConnHdlr vc_conn;
+       f_init();
+       f_sleep(1.0);
+       vc_conn := f_start_handler(refers(f_TC_xid_empty_l3), testcasename(), 
g_gb, 44);
+       vc_conn.done;
+}
+
+private function f_TC_xid_n201u(charstring id) runs on BSSGP_ConnHdlr {
+       var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+       var template (value) XID_Information xid;
+       var template XID_Information xid_rx;
+
+       /* first perform regular attach */
+       f_TC_attach(id);
+       /* then activate PDP context */
+       f_pdp_ctx_act(apars);
+
+       /* start MO XID */
+       xid := { ts_XID_N201U(1234) };
+       xid_rx := { tr_XID_N201U(1234) };
+       f_send_llc(ts_LLC_XID_MO_CMD(xid, apars.sapi));
+       alt {
+       [] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID_MT_RSP(xid_rx, apars.sapi)));
+       [] as_xid(apars);
+       }
+       setverdict(pass);
+}
+testcase TC_xid_n201u() runs on test_CT {
+       var BSSGP_ConnHdlr vc_conn;
+       f_init();
+       f_sleep(1.0);
+       vc_conn := f_start_handler(refers(f_TC_xid_n201u), testcasename(), 
g_gb, 45);
+       vc_conn.done;
+}
+


 control {
@@ -2253,6 +2310,9 @@
        execute( TC_attach_pdp_act_user_error_ind_ggsn() );
        execute( TC_attach_gmm_attach_req_while_gmm_attach() );

+       execute( TC_xid_empty_l3() );
+       execute( TC_xid_n201u() );
+
        execute( TC_llc_null() );
        execute( TC_llc_sabm_dm_llgmm() );
        execute( TC_llc_sabm_dm_ll5() );

--
To view, visit https://gerrit.osmocom.org/13842
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d4b3cba2fe05dffe10c843f16cfec343bc67b5f
Gerrit-Change-Number: 13842
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to