summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-02 10:02:53 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-02 10:03:32 +0200
commit2aaac1b1d1655732055e6ad5da5965fe94af33e5 (patch)
treea333e16dbf257607d45543b700684c27fbb67c27 /sgsn
parentd21f6a20059d425fbe581ea0bb52f238bec90c1d (diff)
sgsn: Add initial XID handshake related tests
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn62
1 files changed, 61 insertions, 1 deletions
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 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() );