From 2aaac1b1d1655732055e6ad5da5965fe94af33e5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 2 May 2019 10:02:53 +0200 Subject: sgsn: Add initial XID handshake related tests Change-Id: I5d4b3cba2fe05dffe10c843f16cfec343bc67b5f --- sgsn/SGSN_Tests.ttcn | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 889a16f8..9399e662 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1180,7 +1180,7 @@ private function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs o } 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 @@ testcase TC_llc_sabm_dm_ll5() runs on test_CT { 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 @@ control { 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() ); -- cgit v1.2.3