summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-16 22:26:56 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-18 10:24:09 +0100
commitb2124b21ba6c3606cf6d9db3062c59667612e537 (patch)
treed115f9d2ce53aac9ac67dc53bc8202bfc89f59f0 /sgsn
parent76dee09c7f0843662da3e3f4012c697041b54f84 (diff)
sgsn: Add TC_attach_closed for "auth-policy closed"
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn42
1 files changed, 42 insertions, 0 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 134193c..be1af57 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -465,6 +465,47 @@ testcase TC_attach_accept_all() runs on test_CT {
vc_conn.done;
}
+/* Attempt of GPRS ATTACH in 'accept all' mode */
+private function f_TC_attach_closed_foreign(charstring id) runs on BSSGP_ConnHdlr {
+ var MobileIdentityLV mi;
+ var RoutingAreaIdentificationV old_ra := f_random_RAI();
+
+ /* Simulate a foreign IMSI */
+ g_pars.imsi := '001010123456789'H;
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id);
+
+ g_pars.net.expect_auth := false;
+
+ if (ispresent(g_pars.p_tmsi)) {
+ mi := valueof(ts_MI_TMSI_LV(g_pars.p_tmsi));
+ } else {
+ mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+ }
+ BSSGP.send(ts_GMM_ATTACH_REQ(mi, old_ra, false, false, omit, omit));
+ alt {
+ [] as_mm_identity();
+ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('07'O))) {
+ setverdict(pass);
+ }
+ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+ setverdict(pass);
+ }
+ }
+}
+testcase TC_attach_closed() runs on test_CT {
+ var BSSGP_ConnHdlr vc_conn;
+ f_init();
+ f_sleep(1.0);
+ f_vty_config(SGSNVTY, "sgsn", "auth-policy closed");
+ /* test with foreign IMSI: Must Reject */
+ vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 7);
+ vc_conn.done;
+ /* test with home IMSI: Must Accept */
+ vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 8);
+ vc_conn.done;
+}
+
+
control {
execute( TC_attach() );
@@ -473,6 +514,7 @@ control {
execute( TC_attach_gsup_lu_timeout() );
execute( TC_attach_combined() );
execute( TC_attach_accept_all() );
+ execute( TC_attach_closed() );
}