diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2018-06-07 16:14:53 +0200 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2018-06-14 01:55:31 +0200 |
commit | f9858658f9a7569aef4ff690fa37f2df65d47a0f (patch) | |
tree | e9c6cb3ec6ff901f2d182d68cc7e23b0a3e2a6a5 /sgsn | |
parent | 2c15342ae7bf160b905afb1b284c12dd64ccd6f0 (diff) |
sgsn: add TC_attach_closed_add_vty
Check acl policy closed.
VTY-> SGSN: policy close
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Attach Reject
VTY-> SGSN: policy imsi-acl add IMSI
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Identity Request IMEI
MS -> SGSN: Identity Response IMEI
MS <- SGSN: Attach Accept
Change-Id: I1832c339a9d54c0038433ad44e292031a8905e20
Diffstat (limited to 'sgsn')
-rw-r--r-- | sgsn/SGSN_Tests.ttcn | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 4b6fc4cf..17abb956 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1496,6 +1496,60 @@ testcase TC_attach_check_subscriber_list() runs on test_CT { f_sgsn_vty_destroy_subscriber_imsi(SGSNVTY, imsi); } +private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_ConnHdlr { + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + var BssgpDecoded bd; + + /* unregister the old IMSI */ + f_bssgp_client_unregister(g_pars.imsi); + /* Simulate a foreign IMSI */ + g_pars.imsi := '001010123456789'H; + f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id); + + /* there is no auth */ + g_pars.net.expect_auth := false; + + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); + f_gmm_auth(); + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { + setverdict(fail, "Received unexpected GMM Attach REJECT"); + } + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> value bd { + f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); + BSSGP.send(ts_GMM_ATTACH_COMPL); + setverdict(pass); + } + } +} +testcase TC_attach_closed_add_vty() runs on test_CT { + /* VTY-> SGSN: policy close + * MS -> SGSN: Attach Request + * MS <- SGSN: Identity Request IMSI + * MS -> SGSN: Identity Response IMSI + * MS <- SGSN: Attach Reject + * VTY-> SGSN: policy imsi-acl add IMSI + * MS -> SGSN: Attach Request + * MS <- SGSN: Identity Request IMSI + * MS -> SGSN: Identity Response IMSI + * MS <- SGSN: Identity Request IMEI + * MS -> SGSN: Identity Response IMEI + * MS <- SGSN: Attach Accept + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + f_vty_config(SGSNVTY, "sgsn", "auth-policy closed"); + f_vty_config(SGSNVTY, "sgsn", "imsi-acl del 001010123456789"); + /* test with foreign IMSI: Must Reject */ + vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9); + vc_conn.done; + f_vty_config(SGSNVTY, "sgsn", "imsi-acl add 001010123456789"); + /* test with same IMSI: Must Accept */ + vc_conn := f_start_handler(refers(f_TC_attach_closed_imsi_added), testcasename(), g_gb[0], 10); + vc_conn.done; +} + control { execute( TC_attach() ); execute( TC_attach_mnc3() ); @@ -1511,6 +1565,7 @@ control { execute( TC_attach_closed() ); execute( TC_attach_no_imei_response() ); execute( TC_attach_no_imsi_response() ); + execute( TC_attach_closed_add_vty(), 10.0 ); execute( TC_attach_check_subscriber_list(), 10.0 ); execute( TC_attach_detach_check_subscriber_list(), 10.0 ); execute( TC_hlr_location_cancel_request_update(), 10.0 ); |