This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
osmith gerrit-no-reply at lists.osmocom.orgosmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14424 Change subject: hlr: add create-subscriber-on-demand tests ...................................................................... hlr: add create-subscriber-on-demand tests Test all possible code paths where a subscriber on demand can be created: * Check IMEI early * Location Update * Send Auth Info I have noticed that the HLR does not yet abort a location update if a subscriber was created without a MSISDN. This patch assumes, that the HLR returns a "GPRS services and non GRPS services not allowed" error in that case, and a suitable patch for osmo-hlr.git is in [1]. [1] Change-Id: If1b2f3c9ddfba55bd02510f2dfd481bca2602e3a Related: OS#2542 Change-Id: Id544fa906ad442c2bbbccff437c18d04ddccde2e --- M hlr/HLR_Tests.ttcn M hlr/osmo-hlr.cfg 2 files changed, 133 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/24/14424/1 diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn index 4c158fd..d4f861c 100644 --- a/hlr/HLR_Tests.ttcn +++ b/hlr/HLR_Tests.ttcn @@ -407,7 +407,8 @@ } function f_perform_UL(hexstring imsi, template hexstring msisdn, - template (omit) integer exp_err_cause := omit) + template (omit) integer exp_err_cause := omit, + boolean isd_match_msisdn := true) runs on HLR_ConnHdlr return GSUP_PDU { var GSUP_PDU ret; timer T := 3.0; @@ -440,6 +441,11 @@ isd_done := true; repeat; } + [not exp_fail and not isd_done and not isd_match_msisdn] GSUP.receive(tr_GSUP_ISD_REQ(imsi, ?)) -> value ret { + GSUP.send(ts_GSUP_ISD_RES(imsi)); + isd_done := true; + repeat; + } [not exp_fail and isd_done] GSUP.receive(tr_GSUP_UL_RES(imsi)) -> value ret { setverdict(pass); } @@ -1196,6 +1202,118 @@ vc_conn.done; } +/* Test create-subscriber-on-demand during Check IMEI (OsmoMSC would be set to "check-imei-rqd early") */ +private function f_TC_subscr_create_on_demand_check_imei_early() runs on HLR_ConnHdlr { + var GSUP_PDU res; /* save various return values to prevent ttcn3 compiler warnings */ + var charstring imsi_pattern := "*IMSI: " & hex2str(g_pars.sub.imsi) & "*"; + + /* Random MSISDN and CS+PS NAM (UL must pass) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand 3 cs+ps"); + f_perform_CHECK_IMEI(g_pars.sub.imsi, '12345678901234'H, result := OSMO_GSUP_IMEI_RESULT_ACK); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, isd_match_msisdn := false); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* Random MSISDN and no NAM (UL must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand 3 none"); + f_perform_CHECK_IMEI(g_pars.sub.imsi, '12345678901234'H, result := OSMO_GSUP_IMEI_RESULT_ACK); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 7 /* GPRS services not allowed */); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* No MSISDN and no NAM (UL must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand no-msisdn none"); + f_perform_CHECK_IMEI(g_pars.sub.imsi, '12345678901234'H, result := OSMO_GSUP_IMEI_RESULT_ACK); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 7 /* GPRS services not allowed */); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* No MSISDN and CS+PS NAM (UL must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand no-msisdn cs+ps"); + f_perform_CHECK_IMEI(g_pars.sub.imsi, '12345678901234'H, result := OSMO_GSUP_IMEI_RESULT_ACK); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 8 /* GPRS services + non GPRS services not allowed */); + f_vty_subscr_delete(VTY, g_pars.sub); + + setverdict(pass); +} +testcase TC_subscr_create_on_demand_check_imei_early() runs on test_CT { + var hexstring imsi := f_rnd_imsi('26242'H); + var HLR_ConnHdlrPars pars := valueof(t_Pars(imsi)); + var HLR_ConnHdlr vc_conn; + + f_init(false); + vc_conn := f_start_handler(refers(f_TC_gsup_check_imei_unknown_imsi), pars); + vc_conn.done; +} + +/* Test create-subscriber-on-demand during LU (Location Update) */ +private function f_TC_subscr_create_on_demand_ul() runs on HLR_ConnHdlr { + var GSUP_PDU res; + var charstring imsi_pattern := "*IMSI: " & hex2str(g_pars.sub.imsi) & "*"; + + /* Create with random 3 digit MSISDN and CS+PS NAM (LU must pass) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand 3 cs+ps"); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, isd_match_msisdn := false); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* Create without CS or PS NAM (LU must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand 3 none"); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 7 /* GPRS services not allowed */); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* Create without CS or PS NAM and without MSISDN (LU must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand no-msisdn none"); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 7 /* GPRS services not allowed */); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + f_vty_subscr_delete(VTY, g_pars.sub); + + /* Create with CS+PS NAM and without MSISDN (LU must fail) */ + f_vty_config(VTY, "hlr", "subscriber-create-on-demand no-msisdn cs+ps"); + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, 8 /* GPRS services + non GPRS services not allowed */); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); + f_vty_subscr_delete(VTY, g_pars.sub); + + setverdict(pass); +} +testcase TC_subscr_create_on_demand_ul() runs on test_CT { + var hexstring imsi := f_rnd_imsi('26242'H); + var HLR_ConnHdlrPars pars := valueof(t_Pars(imsi)); + var HLR_ConnHdlr vc_conn; + + f_init(false); + vc_conn := f_start_handler(refers(f_TC_subscr_create_on_demand_ul), pars); + vc_conn.done; +} + +/* Test create-subscriber-on-demand during SAI (SendAuthInfo) */ +private function f_TC_subscr_create_on_demand_sai() runs on HLR_ConnHdlr { + var GSUP_PDU res; + var charstring imsi_pattern := "*IMSI: " & hex2str(g_pars.sub.imsi) & "*"; + + f_vty_config(VTY, "hlr", "subscriber-create-on-demand 3 cs+ps"); + + /* HLR creates the subscriber on demand. Then the IMSI is known, but there is no auth data, so the HLR returns + * the "slightly inaccurate cause 'IMSI Unknown' via GSUP". The MS is able to do a LU afterwards. */ + res := f_perform_SAI(g_pars.sub.imsi, 2 /* IMSI Unknown */ ); + f_vty_subscr_show(VTY, g_pars.sub, pattern imsi_pattern); /* verify that it was created before the LU */ + res := f_perform_UL(g_pars.sub.imsi, g_pars.sub.msisdn, isd_match_msisdn := false); + + f_vty_subscr_delete(VTY, g_pars.sub); + setverdict(pass); +} +testcase TC_subscr_create_on_demand_sai() runs on test_CT { + var hexstring imsi := f_rnd_imsi('26242'H); + var HLR_ConnHdlrPars pars := valueof(t_Pars(imsi)); + var HLR_ConnHdlr vc_conn; + + f_init(false); + vc_conn := f_start_handler(refers(f_TC_subscr_create_on_demand_sai), pars); + vc_conn.done; +} + /* TODO: * UL with ISD error * UL with ISD timeout @@ -1236,6 +1354,9 @@ execute( TC_gsup_check_imei() ); execute( TC_gsup_check_imei_invalid_len() ); execute( TC_gsup_check_imei_unknown_imsi() ); + execute( TC_subscr_create_on_demand_check_imei_early() ); + execute( TC_subscr_create_on_demand_ul() ); + execute( TC_subscr_create_on_demand_sai() ); }; }; diff --git a/hlr/osmo-hlr.cfg b/hlr/osmo-hlr.cfg index a17881e..71859c9 100644 --- a/hlr/osmo-hlr.cfg +++ b/hlr/osmo-hlr.cfg @@ -21,3 +21,14 @@ ussd route prefix *#100 internal own-msisdn ussd route prefix *#101 internal own-imsi ussd route prefix *100 external foobar + +log gsmtap 127.0.0.1 + logging filter all 1 + logging color 1 + logging print level 1 + logging print category 1 + logging print category-hex 0 + logging print file basename last + logging print extended-timestamp 1 + logging level set-all debug + -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14424 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Id544fa906ad442c2bbbccff437c18d04ddccde2e Gerrit-Change-Number: 14424 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190612/d9fda748/attachment.htm>