[MERGED] osmo-ttcn3-hacks[master]: sgsn: Use random TEID and Charging Identifier
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Use random TEID and Charging Identifier .. sgsn: Use random TEID and Charging Identifier Change-Id: I39934396372b057eaf5446e9185e83a1d56c153c --- M sgsn/SGSN_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index eb7fd14..ff5340e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -769,6 +769,7 @@ octetstring apn optional, /* APN name */ ProtocolConfigOptionsV pco optional, /* protoco config opts */ OCT1exp_rej_cause optional, /* expected SM reject cause */ + OCT1gtp_resp_cause, /* GTP response cause */ OCT4chg_id, /* GTP Charging Identifier */ OCT4ggsn_tei_c, /* GGSN TEI Control*/ @@ -880,11 +881,12 @@ apn := omit, pco := omit, exp_rej_cause := omit, - chg_id := '0001'O, + gtp_resp_cause := int2oct(128, 1), + chg_id := f_rnd_octstring(4), /* FIXME: make below dynamic !! */ - ggsn_tei_c := '0001'O, - ggsn_tei_u := '0002'O, + ggsn_tei_c := f_rnd_octstring(4), + ggsn_tei_u := f_rnd_octstring(4), ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), -- To view, visit https://gerrit.osmocom.org/6584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39934396372b057eaf5446e9185e83a1d56c153c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_pdp_act_ggsn_reject
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add new TC_attach_pdp_act_ggsn_reject .. sgsn: Add new TC_attach_pdp_act_ggsn_reject Change-Id: I2da2b3811e843003920cd67ac47f2fc03016912f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 39 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index ff5340e..4369078 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -783,29 +783,31 @@ octetstring sgsn_ip_u optional /* SGSN IP USer */ }; + +private function f_process_gtp_ctx_act_req(inout PdpActPars apars, PDU_GTPC gtpc) runs on BSSGP_ConnHdlr { + var GTPC_PDUs gtpc_rx := gtpc.gtpc_pdu; + apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; + apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; + apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; + apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; + f_gtp_register_teid(apars.ggsn_tei_c); + f_gtp_register_teid(apars.ggsn_tei_u); +} + function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco)); - if (not exp_rej) { - GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { - var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - var GTPC_PDUs gtpc_rx := g_ud.gtpc.gtpc_pdu; - apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; - apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; - apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; - apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; - f_gtp_register_teid(apars.ggsn_tei_c); - f_gtp_register_teid(apars.ggsn_tei_u); - var OCT1 cause := int2oct(128, 1); - GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, - apars.sgsn_tei_c, cause, - apars.ggsn_tei_c, apars.ggsn_tei_u, - apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); - } + GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { + f_process_gtp_ctx_act_req(apars, g_ud.gtpc); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, apars.gtp_resp_cause, + apars.ggsn_tei_c, apars.ggsn_tei_u, + apars.nsapi, + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); } alt { [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { @@ -820,6 +822,7 @@ [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); } + [] as_xid(apars); } } @@ -1035,6 +1038,24 @@ vc_conn.done; } +/* ATTACH + PDP CTX ACT; reject from GGSN */ +private function f_TC_attach_pdp_act_ggsn_reject(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + apars.gtp_resp_cause := int2oct(199, 1);/* no resources available */ + apars.exp_rej_cause := '1a'O; /* insufficient resources */ + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); +} +testcase TC_attach_pdp_act_ggsn_reject() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_ggsn_reject), testcasename(), g_gb[0], 20); + vc_conn.done; +} control { @@ -1056,6 +1077,7 @@ execute( TC_attach_pdp_act() ); execute( TC_pdp_act_unattached() ); execute( TC_attach_pdp_act_user() ); + execute( TC_attach_pdp_act_ggsn_reject() ); } -- To view,
osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_pdp_act_user_deact_mo
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43cb7728658cae6590eb1bd31c7c285b942a265e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: L3_Templates: Fix activatePDPContextReject msg_Type
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc40502a4e9862ac8d95d77b483dac39ac783e5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: More comments
Harald Welte has submitted this change and it was merged. Change subject: sgsn: More comments .. sgsn: More comments Change-Id: Ie64bfc43b2d652f1f556628deb26544217a8286c --- M sgsn/SGSN_Tests.ttcn 1 file changed, 17 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 1652407..eb7fd14 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -761,25 +761,25 @@ } type record PdpActPars { - BIT3tid, - BIT4nsapi, - BIT4sapi, - QoSVqos, - PDPAddressV addr, - octetstring apn optional, - ProtocolConfigOptionsV pco optional, - OCT1exp_rej_cause optional, - OCT4chg_id, + BIT3tid,/* L3 Transaction ID */ + BIT4nsapi, /* SNDCP NSAPI */ + BIT4sapi, /* LLC SAPI */ + QoSVqos,/* QoS parameters */ + PDPAddressV addr, /* IP address */ + octetstring apn optional, /* APN name */ + ProtocolConfigOptionsV pco optional, /* protoco config opts */ + OCT1exp_rej_cause optional, /* expected SM reject cause */ + OCT4chg_id, /* GTP Charging Identifier */ - OCT4ggsn_tei_c, - OCT4ggsn_tei_u, - octetstring ggsn_ip_c, - octetstring ggsn_ip_u, + OCT4ggsn_tei_c, /* GGSN TEI Control*/ + OCT4ggsn_tei_u, /* GGSN TEI User */ + octetstring ggsn_ip_c, /* GGSN IP Control */ + octetstring ggsn_ip_u, /* GGSN IP User */ - OCT4sgsn_tei_c optional, - OCT4sgsn_tei_u optional, - octetstring sgsn_ip_c optional, - octetstring sgsn_ip_u optional + OCT4sgsn_tei_c optional,/* SGSN TEI Control */ + OCT4sgsn_tei_u optional,/* SGSN TEI User */ + octetstring sgsn_ip_c optional, /* SGSN IP Control */ + octetstring sgsn_ip_u optional /* SGSN IP USer */ }; function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/6582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie64bfc43b2d652f1f556628deb26544217a8286c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_pdp_act_user_deact_mo
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_attach_pdp_act_user_deact_mo .. sgsn: Add TC_attach_pdp_act_user_deact_mo Change-Id: I43cb7728658cae6590eb1bd31c7c285b942a265e --- M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 118 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index f071d04..ef7e97b 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -495,6 +495,27 @@ valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) } + template GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, + template ProtConfigOptions pco := omit) := { + deletePDPContextResponse := { + cause := { '00'O, cause }, + protConfigOptions := pco, + userLocationInformation := omit, + mS_TimeZone := omit, + uLI_Timestamp := omit, + private_extension_gtpc := omit + } + } + + template Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + template ProtConfigOptions pco := omit) := { + peer := peer, + gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, + valueof(ts_DeletePdpRespPDU(cause, pco)), seq) + } + + /* GTP-U */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ffabff4..e1947b2 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1904,6 +1904,61 @@ } } +template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { + tdi_flag := bool2bit(tdown), + spare := '000'B + }, + elementIdentifier := '1001'B + }, + protocolConfigOpts := ts_PcoTLV(pco), + mBMSprotocolConfigOptions := omit, + t3396 := omit, + wLANOffloadIndication := omit, + nBIFOM_Container := omit + } + } + } +} + +template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) +:= { + discriminator := '1010'B, + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextAccept := { + messageType := '01000111'B, + protocolConfigOpts := *, + mBMSprotocolConfigOptions := *, + nBIFOM_Container := * + } + } + } +} + private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 4369078..06ed56b 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -257,14 +257,12 @@ * ATTACH / RAU ** with / without authentication ** with / without P-TMSI allocation - ** reject from HLR on SAI - ** reject from HLR on UL * re-transmissions of LLC frames * PDP Context activation ** with different GGSN config in SGSN VTY ** with different PDP context type (v4/v6/v46) ** timeout from GGSN - ** reject from GGSN + ** multiple / secondary PDP context */ testcase TC_wait_ns_up() runs on test_CT { @@ -826,6 +824,25 @@ }
pysim[master]: transport/serial: Fix serial transport
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7fcc97d505a5369f9f14d4a2abda92b7114a58cd Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: rooxGerrit-Reviewer: Harald Welte Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP ...
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: L3_Templates: Fix activatePDPContextReject msg_Type
Harald Welte has submitted this change and it was merged. Change subject: L3_Templates: Fix activatePDPContextReject msg_Type .. L3_Templates: Fix activatePDPContextReject msg_Type Change-Id: Ibc40502a4e9862ac8d95d77b483dac39ac783e5b --- M library/L3_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 4398cea..ffabff4 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1859,7 +1859,7 @@ msgs := { gprs_sm := { activatePDPContextReject := { - messageType := '0100'B, + messageType := '0111'B, smCause := cause, protocolConfigOpts := *, backOffTimer := *, -- To view, visit https://gerrit.osmocom.org/6583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibc40502a4e9862ac8d95d77b483dac39ac783e5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP ...
Harald Welte has submitted this change and it was merged. Change subject: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT .. Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87 Related: OS#2961 --- M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 155 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index ef7e97b..44d9682 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -456,12 +456,10 @@ ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns(''O), tr_IPCP_SecondaryDns(''O) }); - function f_teardown_ind_IE(in template BIT1 ind) return template TearDownInd { -/* - if (not isvalue(ind)) { + function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd { + if (istemplatekind(ind, "omit")) { return omit; } -*/ var TearDownInd ret := { type_gtpc := '13'O, tdInd := valueof(ind), @@ -470,7 +468,7 @@ return ret; } - template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template BIT1 teardown_ind) := { + template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { deletePDPContextRequest := { cause := omit, tearDownIndicator := f_teardown_ind_IE(teardown_ind), @@ -489,7 +487,7 @@ } template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, -BIT4 nsapi, template BIT1 teardown_ind) := { +BIT4 nsapi, template (omit) BIT1 teardown_ind) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid, valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index e1947b2..d3e021d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1937,6 +1937,74 @@ } } +template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { + tdi_flag := bool2bit(tdown), + spare := '000'B + }, + elementIdentifier := '1001'B + }, + protocolConfigOpts := ts_PcoTLV(pco), + mBMSprotocolConfigOptions := omit, + t3396 := omit, + wLANOffloadIndication := omit, + nBIFOM_Container := omit + } + } + } +} + +template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, + template boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { +
osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_pdp_act_ggsn_reject
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2da2b3811e843003920cd67ac47f2fc03016912f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: More comments
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie64bfc43b2d652f1f556628deb26544217a8286c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Use random TEID and Charging Identifier
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39934396372b057eaf5446e9185e83a1d56c153c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_pdp_act_user_deact_mo
Review at https://gerrit.osmocom.org/6586 sgsn: Add TC_attach_pdp_act_user_deact_mo Change-Id: I43cb7728658cae6590eb1bd31c7c285b942a265e --- M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 118 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/6586/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index f071d04..ef7e97b 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -495,6 +495,27 @@ valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) } + template GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, + template ProtConfigOptions pco := omit) := { + deletePDPContextResponse := { + cause := { '00'O, cause }, + protConfigOptions := pco, + userLocationInformation := omit, + mS_TimeZone := omit, + uLI_Timestamp := omit, + private_extension_gtpc := omit + } + } + + template Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + template ProtConfigOptions pco := omit) := { + peer := peer, + gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, + valueof(ts_DeletePdpRespPDU(cause, pco)), seq) + } + + /* GTP-U */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ffabff4..e1947b2 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1904,6 +1904,61 @@ } } +template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { + tdi_flag := bool2bit(tdown), + spare := '000'B + }, + elementIdentifier := '1001'B + }, + protocolConfigOpts := ts_PcoTLV(pco), + mBMSprotocolConfigOptions := omit, + t3396 := omit, + wLANOffloadIndication := omit, + nBIFOM_Container := omit + } + } + } +} + +template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) +:= { + discriminator := '1010'B, + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextAccept := { + messageType := '01000111'B, + protocolConfigOpts := *, + mBMSprotocolConfigOptions := *, + nBIFOM_Container := * + } + } + } +} + private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 4369078..06ed56b 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -257,14 +257,12 @@ * ATTACH / RAU ** with / without authentication ** with / without P-TMSI allocation - ** reject from HLR on SAI - ** reject from HLR on UL * re-transmissions of LLC frames * PDP Context activation ** with different GGSN config in SGSN VTY ** with different PDP context type (v4/v6/v46) ** timeout from GGSN - ** reject from GGSN + ** multiple / secondary PDP context */ testcase TC_wait_ns_up() runs on test_CT { @@ -826,6 +824,25 @@ } } +function f_pdp_ctx_deact_mo(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { + var boolean exp_rej :=
[PATCH] osmo-ttcn3-hacks[master]: Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP ...
Review at https://gerrit.osmocom.org/6587 Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87 Related: OS#2961 --- M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 155 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/6587/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index ef7e97b..44d9682 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -456,12 +456,10 @@ ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns(''O), tr_IPCP_SecondaryDns(''O) }); - function f_teardown_ind_IE(in template BIT1 ind) return template TearDownInd { -/* - if (not isvalue(ind)) { + function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd { + if (istemplatekind(ind, "omit")) { return omit; } -*/ var TearDownInd ret := { type_gtpc := '13'O, tdInd := valueof(ind), @@ -470,7 +468,7 @@ return ret; } - template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template BIT1 teardown_ind) := { + template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { deletePDPContextRequest := { cause := omit, tearDownIndicator := f_teardown_ind_IE(teardown_ind), @@ -489,7 +487,7 @@ } template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, -BIT4 nsapi, template BIT1 teardown_ind) := { +BIT4 nsapi, template (omit) BIT1 teardown_ind) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid, valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index e1947b2..d3e021d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1937,6 +1937,74 @@ } } +template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { + tdi_flag := bool2bit(tdown), + spare := '000'B + }, + elementIdentifier := '1001'B + }, + protocolConfigOpts := ts_PcoTLV(pco), + mBMSprotocolConfigOptions := omit, + t3396 := omit, + wLANOffloadIndication := omit, + nBIFOM_Container := omit + } + } + } +} + +template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, + template boolean tdown := false, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := ''B, /* overwritten */ + tiOrSkip := { + transactionId := { + tio := tid, + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + gprs_sm := { + deactivatePDPContextRequest := { + messageType := ''B, /* overwritten */ + smCause := cause, + tearDownIndicator := { + tearDownIndicatorV := { + tdi_flag := bool2bit_tmpl(tdown), + spare := '000'B + }, +
Build failure of network:osmocom:nightly/libsmpp34 in Debian_9.0/aarch64
Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libsmpp34/Debian_9.0/aarch64 Package network:osmocom:nightly/libsmpp34 failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly libsmpp34 Last lines of build log: [K[[0m[0;31m* [0m] A start job is running for dev-disk…\x2d0.device (4min 59s / no limit) [K[[0;1;31m*[0m[0;31m*[0m] A start job is running for dev-disk…rtio\x2d0.device (5min / no limit) [K[[0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…rtio\x2d0.device (5min / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 1s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 1s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 2s / no limit) [K[[0;31m*[0;1;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 2s / no limit) [K[ [0;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 3s / no limit) [K[[0;31m*[0;1;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 3s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 4s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 4s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 5s / no limit) [K[[0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 5s / no limit) [K[[0;1;31m*[0m[0;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 6s / no limit) [K[[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 6s / no limit) [K[[0;1;31m*[0m[0;31m*[0m] A start job is running for dev-disk…o\x2d0.device (5min 7s / no limit) [K[[0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 7s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 8s / no limit) [K[ [0;31m*[0;1;31m*[0m[0;31m* [0m] A start job is running for dev-disk…o\x2d0.device (5min 8s / no limit)### WATCHDOG TRIGGERED, KILLING VM ### [ 328s] /var/cache/obs/worker/root_5/root: 12570 [ 328s] qemu-system-aarch64: terminating on signal 15 from pid 12915 () [ 328s] qemu-system-aarch64: Failed to unlink socket /var/cache/obs/worker/root_5/root.monitor: Permission denied [ 328s] ### VM INTERACTION END ### [ 328s] /var/run/obs/worker/5/build/build-vm: line 458: kill: (12565) - No such process [ 328s] /var/run/obs/worker/5/build/build-vm: line 917: warning: command substitution: ignored null byte in input [ 328s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl) [ 328s] or the build host has a kernel or hardware problem... gave up after 12 failed build attempts... -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/)
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Use random TEID and Charging Identifier
Review at https://gerrit.osmocom.org/6584 sgsn: Use random TEID and Charging Identifier Change-Id: I39934396372b057eaf5446e9185e83a1d56c153c --- M sgsn/SGSN_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/6584/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index eb7fd14..ff5340e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -769,6 +769,7 @@ octetstring apn optional, /* APN name */ ProtocolConfigOptionsV pco optional, /* protoco config opts */ OCT1exp_rej_cause optional, /* expected SM reject cause */ + OCT1gtp_resp_cause, /* GTP response cause */ OCT4chg_id, /* GTP Charging Identifier */ OCT4ggsn_tei_c, /* GGSN TEI Control*/ @@ -880,11 +881,12 @@ apn := omit, pco := omit, exp_rej_cause := omit, - chg_id := '0001'O, + gtp_resp_cause := int2oct(128, 1), + chg_id := f_rnd_octstring(4), /* FIXME: make below dynamic !! */ - ggsn_tei_c := '0001'O, - ggsn_tei_u := '0002'O, + ggsn_tei_c := f_rnd_octstring(4), + ggsn_tei_u := f_rnd_octstring(4), ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), -- To view, visit https://gerrit.osmocom.org/6584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39934396372b057eaf5446e9185e83a1d56c153c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: L3_Templates: Fix activatePDPContextReject msg_Type
Review at https://gerrit.osmocom.org/6583 L3_Templates: Fix activatePDPContextReject msg_Type Change-Id: Ibc40502a4e9862ac8d95d77b483dac39ac783e5b --- M library/L3_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/6583/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 4398cea..ffabff4 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1859,7 +1859,7 @@ msgs := { gprs_sm := { activatePDPContextReject := { - messageType := '0100'B, + messageType := '0111'B, smCause := cause, protocolConfigOpts := *, backOffTimer := *, -- To view, visit https://gerrit.osmocom.org/6583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc40502a4e9862ac8d95d77b483dac39ac783e5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: sgsn: More comments
Review at https://gerrit.osmocom.org/6582 sgsn: More comments Change-Id: Ie64bfc43b2d652f1f556628deb26544217a8286c --- M sgsn/SGSN_Tests.ttcn 1 file changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/6582/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 1652407..eb7fd14 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -761,25 +761,25 @@ } type record PdpActPars { - BIT3tid, - BIT4nsapi, - BIT4sapi, - QoSVqos, - PDPAddressV addr, - octetstring apn optional, - ProtocolConfigOptionsV pco optional, - OCT1exp_rej_cause optional, - OCT4chg_id, + BIT3tid,/* L3 Transaction ID */ + BIT4nsapi, /* SNDCP NSAPI */ + BIT4sapi, /* LLC SAPI */ + QoSVqos,/* QoS parameters */ + PDPAddressV addr, /* IP address */ + octetstring apn optional, /* APN name */ + ProtocolConfigOptionsV pco optional, /* protoco config opts */ + OCT1exp_rej_cause optional, /* expected SM reject cause */ + OCT4chg_id, /* GTP Charging Identifier */ - OCT4ggsn_tei_c, - OCT4ggsn_tei_u, - octetstring ggsn_ip_c, - octetstring ggsn_ip_u, + OCT4ggsn_tei_c, /* GGSN TEI Control*/ + OCT4ggsn_tei_u, /* GGSN TEI User */ + octetstring ggsn_ip_c, /* GGSN IP Control */ + octetstring ggsn_ip_u, /* GGSN IP User */ - OCT4sgsn_tei_c optional, - OCT4sgsn_tei_u optional, - octetstring sgsn_ip_c optional, - octetstring sgsn_ip_u optional + OCT4sgsn_tei_c optional,/* SGSN TEI Control */ + OCT4sgsn_tei_u optional,/* SGSN TEI User */ + octetstring sgsn_ip_c optional, /* SGSN IP Control */ + octetstring sgsn_ip_u optional /* SGSN IP USer */ }; function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/6582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie64bfc43b2d652f1f556628deb26544217a8286c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_pdp_act_ggsn_reject
Review at https://gerrit.osmocom.org/6585 sgsn: Add new TC_attach_pdp_act_ggsn_reject Change-Id: I2da2b3811e843003920cd67ac47f2fc03016912f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 39 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/6585/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index ff5340e..4369078 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -783,29 +783,31 @@ octetstring sgsn_ip_u optional /* SGSN IP USer */ }; + +private function f_process_gtp_ctx_act_req(inout PdpActPars apars, PDU_GTPC gtpc) runs on BSSGP_ConnHdlr { + var GTPC_PDUs gtpc_rx := gtpc.gtpc_pdu; + apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; + apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; + apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; + apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; + f_gtp_register_teid(apars.ggsn_tei_c); + f_gtp_register_teid(apars.ggsn_tei_u); +} + function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco)); - if (not exp_rej) { - GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { - var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - var GTPC_PDUs gtpc_rx := g_ud.gtpc.gtpc_pdu; - apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; - apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; - apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; - apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; - f_gtp_register_teid(apars.ggsn_tei_c); - f_gtp_register_teid(apars.ggsn_tei_u); - var OCT1 cause := int2oct(128, 1); - GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, - apars.sgsn_tei_c, cause, - apars.ggsn_tei_c, apars.ggsn_tei_u, - apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); - } + GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { + f_process_gtp_ctx_act_req(apars, g_ud.gtpc); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, apars.gtp_resp_cause, + apars.ggsn_tei_c, apars.ggsn_tei_u, + apars.nsapi, + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); } alt { [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { @@ -820,6 +822,7 @@ [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); } + [] as_xid(apars); } } @@ -1035,6 +1038,24 @@ vc_conn.done; } +/* ATTACH + PDP CTX ACT; reject from GGSN */ +private function f_TC_attach_pdp_act_ggsn_reject(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + apars.gtp_resp_cause := int2oct(199, 1);/* no resources available */ + apars.exp_rej_cause := '1a'O; /* insufficient resources */ + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); +} +testcase TC_attach_pdp_act_ggsn_reject() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_ggsn_reject), testcasename(), g_gb[0], 20); + vc_conn.done; +} control { @@ -1056,6 +1077,7 @@ execute( TC_attach_pdp_act() ); execute( TC_pdp_act_unattached() ); execute( TC_attach_pdp_act_user() ); + execute( TC_attach_pdp_act_ggsn_reject() ); } -- To view, visit https://gerrit.osmocom.org/6585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id:
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Store SGSN-side control + user plane IP addresses
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Store SGSN-side control + user plane IP addresses .. sgsn: Store SGSN-side control + user plane IP addresses Change-Id: Ic82910917167e667cfb26eb084f237140b4c986e --- M sgsn/SGSN_Tests.ttcn 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 988ece1..6b36bc2 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -769,9 +769,10 @@ octetstring ggsn_ip_c, octetstring ggsn_ip_u, - GtpPeer sgsn, OCT4sgsn_tei_c optional, - OCT4sgsn_tei_u optional + OCT4sgsn_tei_u optional, + octetstring sgsn_ip_c optional, + octetstring sgsn_ip_u optional }; function f_pdp_ctx_act(PdpActPars apars) runs on BSSGP_ConnHdlr { @@ -786,6 +787,8 @@ var GTPC_PDUs gtpc_rx := g_ud.gtpc.gtpc_pdu; apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; + apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; + apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; var OCT1 cause := int2oct(128, 1); GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, cause, @@ -875,9 +878,10 @@ ggsn_ip_c := '7F01'O, ggsn_ip_u := '7F01'O, - sgsn := { }, sgsn_tei_c := omit, - sgsn_tei_u := omit + sgsn_tei_u := omit, + sgsn_ip_c := omit, + sgsn_ip_u := omit } private function f_TC_attach_pdp_act(charstring id) runs on BSSGP_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/6575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic82910917167e667cfb26eb084f237140b4c986e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: GTP Create PDP: Include missing required "Charging ID" IE
Harald Welte has submitted this change and it was merged. Change subject: sgsn: GTP Create PDP: Include missing required "Charging ID" IE .. sgsn: GTP Create PDP: Include missing required "Charging ID" IE Change-Id: I7e4b71d7ca6e75f759f77fb47abc9816c0aa716d --- M library/GTP_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 10 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index b64289b..f071d04 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -295,7 +295,7 @@ template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, - template EndUserAddress eua := omit, + OCT4 chg_id, template EndUserAddress eua := omit, template ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, @@ -310,7 +310,10 @@ teidControlPlane := teid_ctrl }, nsapi := ts_NSAPI(nsapi), - chargingID := omit, + chargingID := { + type_gtpc := '7F'O, + chargingID := chg_id + }, endUserAddress := eua, protConfigOptions := pco, ggsn_addr_controlPlane := ts_GsnAddr(ggsn_ip_sign), @@ -335,13 +338,13 @@ OCT1 cause, OCT4 teid_ctrl, OCT4 teid_data, BIT4 nsapi, octetstring ggsn_ip_sign, -octetstring ggsn_ip_data, +octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, template ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, - ggsn_ip_sign, ggsn_ip_data, + ggsn_ip_sign, ggsn_ip_data, chg_id, eua, pco)), seq) } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 6b36bc2..3a9db69 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -763,6 +763,7 @@ octetstring apn optional, ProtocolConfigOptionsV pco optional, OCT1exp_rej_cause optional, + OCT4chg_id, OCT4ggsn_tei_c, OCT4ggsn_tei_u, @@ -794,7 +795,7 @@ apars.sgsn_tei_c, cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u)); + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); } } alt { @@ -871,6 +872,7 @@ apn := omit, pco := omit, exp_rej_cause := omit, + chg_id := '0001'O, /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, -- To view, visit https://gerrit.osmocom.org/6576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e4b71d7ca6e75f759f77fb47abc9816c0aa716d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP)
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP) .. sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP) Change-Id: Ifd62cca8cd9dbcffe4eac957db210ac13b8c633f --- M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 144 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 9a48918..c4628be 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -702,6 +702,15 @@ sndcp := omit } +template BssgpDecoded tr_BD_SNDCP(template BIT4 sapi, template PDU_SN sn) := { + bssgp := ?, + llc := tr_LLC_UI(?, sapi), + l3_mo := omit, + l3_mt := omit, + sndcp := sn +} + + } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 7bc4088..086207c 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -20,6 +20,12 @@ pM := bool2bit(protected) } +template (value) Control_field_U ts_LLC_CtrlU(BIT4 m_bits, BIT1 p_f) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template Control_field_UI tr_LLC_CtrlUI(template uint9_t n_u, template boolean encrypted := ?, template boolean protected := ?) := { @@ -29,6 +35,14 @@ e := bool2bit_tmpl(encrypted), pM := bool2bit_tmpl(protected) } + +template Control_field_U tr_LLC_CtrlU(template BIT4 m_bits := ?, + template BIT1 p_f := ?) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template PDU_LLC ts_LLC_UI(octetstring payload, BIT4 sapi, BIT1 cr, uint9_t n_u, boolean encrypted := false, boolean protected := false) := { @@ -51,6 +65,19 @@ } } +template PDU_LLC tr_LLC_XID(template XID_Information xid, template BIT4 sapi := ?, + template BIT1 cr := ?, template BIT1 p_f := ?) := { + pDU_LLC_U := { + address_field := t_LLC_Addr(sapi, cr), + control_field := tr_LLC_CtrlU('1011'B, p_f), + information_field_U := { + xID := xid + }, + fCS := '00'O /* provided by decoder if FCS OK */ + } +} + + const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; const BIT4 c_LLC_SAPI_LL3 := '0011'B; diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a02d3a9..1652407 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2,6 +2,7 @@ import from General_Types all; import from Osmocom_Types all; +import from Native_Functions all; import from NS_Types all; import from NS_Emulation all; import from BSSGP_Types all; @@ -781,7 +782,7 @@ octetstring sgsn_ip_u optional }; -function f_pdp_ctx_act(PdpActPars apars) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; @@ -795,6 +796,8 @@ apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; + f_gtp_register_teid(apars.ggsn_tei_c); + f_gtp_register_teid(apars.ggsn_tei_u); var OCT1 cause := int2oct(128, 1); GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, cause, @@ -868,7 +871,7 @@ addressInfo := omit } -template (value) PdpActPars t_PdpActPars := { +template (value) PdpActPars t_PdpActPars(charstring ggsn_ip) := { tid := '000'B, nsapi := '0101'B, /* < 5 are reserved */ sapi := '0011'B, /* 3/5/9/11 */ @@ -882,8 +885,8 @@ /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, ggsn_tei_u := '0002'O, - ggsn_ip_c := '7F02'O, - ggsn_ip_u := '7F02'O, + ggsn_ip_c := f_inet_addr(ggsn_ip), + ggsn_ip_u := f_inet_addr(ggsn_ip), sgsn_tei_c := omit, sgsn_tei_u := omit, @@ -891,8 +894,87 @@ sgsn_ip_u := omit } +template (value) GtpPeer ts_GtpPeerU(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1U_PORT +} + +template (value) GtpPeer ts_GtpPeerC(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1C_PORT +} + +private
osmo-ttcn3-hacks[master]: sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP)
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd62cca8cd9dbcffe4eac957db210ac13b8c633f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Fix hard-coded emulated GGSN IP addresses
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Fix hard-coded emulated GGSN IP addresses .. sgsn: Fix hard-coded emulated GGSN IP addresses Change-Id: Iaf42c25b4c345969c2aec209a6db6e56b69f15e3 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 3a9db69..6dd56ae 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -877,8 +877,8 @@ /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, ggsn_tei_u := '0002'O, - ggsn_ip_c := '7F01'O, - ggsn_ip_u := '7F01'O, + ggsn_ip_c := '7F02'O, + ggsn_ip_u := '7F02'O, sgsn_tei_c := omit, sgsn_tei_u := omit, -- To view, visit https://gerrit.osmocom.org/6577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf42c25b4c345969c2aec209a6db6e56b69f15e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_pdp_act_unattached
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_pdp_act_unattached .. sgsn: Add TC_pdp_act_unattached Change-Id: I162ab7cb74102e6f15c4d685c49575bcd0b4f41c --- M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 44 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 73d2818..4398cea 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1766,6 +1766,22 @@ } } +template PDU_L3_SGSN_MS tr_GMM_DET_REQ_MT(template BIT3 dtt := ?, template boolean power_off := ?) := { + discriminator := '1000'B, + tiOrSkip := { + skipIndicator := ''B + }, + msgs := { + gprs_mm := { + detachRequest_SGSN_MS := { + messageType := '0101'B, + detachType := { dtt, bool2bit_tmpl(power_off) }, + forceToStandby := ?, + gmmCause := * + } + } + } +} function ts_ApnTLV(template (omit) octetstring apn) return template (omit) AccessPointNameTLV { if (istemplatekind(apn, "omit")) { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 138b63b..988ece1 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -895,6 +895,33 @@ vc_conn.done; } +/* PDP Context activation for not-attached subscriber; expect fail */ +private function f_TC_pdp_act_unattached(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars); + BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, +apars.apn, apars.pco)); + alt { + /* We might want toalso actually expect a PDPC CTX ACT REJ? */ + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(?, ?))) { + setverdict(pass); + } + [] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { + setverdict(fail, "Unexpected GTP PDP CTX ACT"); + } + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(?, ?))) { + setverdict(fail, "Unexpected SM PDP CTX ACT ACK"); + } + [] BSSGP.receive { repeat; } + } +} +testcase TC_pdp_act_unattached() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_pdp_act_unattached), testcasename(), g_gb[0], 18); + vc_conn.done; +} + + control { execute( TC_attach() ); @@ -913,6 +940,7 @@ execute( TC_detach_nopoweroff() ); execute( TC_detach_poweroff() ); execute( TC_attach_pdp_act() ); + execute( TC_pdp_act_unattached() ); } -- To view, visit https://gerrit.osmocom.org/6574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I162ab7cb74102e6f15c4d685c49575bcd0b4f41c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: BSSGP_Emulation: Add SNDCP decoding support
Harald Welte has submitted this change and it was merged. Change subject: BSSGP_Emulation: Add SNDCP decoding support .. BSSGP_Emulation: Add SNDCP decoding support Change-Id: Icd2e8feed9173b0a2729b7ee1cfac37a86eca6cf --- M gprs_gb/gen_links.sh M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh 5 files changed, 47 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gprs_gb/gen_links.sh b/gprs_gb/gen_links.sh index 85a35ab..5cbaaae 100755 --- a/gprs_gb/gen_links.sh +++ b/gprs_gb/gen_links.sh @@ -47,6 +47,11 @@ FILES="LLC_EncDec.cc LLC_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src +FILES="SNDCP_Types.ttcn" +gen_links $DIR $FILES + + DIR=../library FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn " FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc " diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 0be12e8..a26e01f 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -14,6 +14,8 @@ import from LLC_Types all; import from LLC_Templates all; +import from SNDCP_Types all; + /*** * Communication between Client Components and Main Component ***/ @@ -601,7 +603,8 @@ PDU_BSSGP bssgp, PDU_LLC llc optional, PDU_L3_MS_SGSN l3_mo optional, - PDU_L3_SGSN_MS l3_mt optional + PDU_L3_SGSN_MS l3_mt optional, + PDU_SN sndcp optional } /* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */ @@ -610,7 +613,8 @@ bssgp := bssgp, llc := omit, l3_mo := omit, - l3_mt := omit + l3_mt := omit, + sndcp := omit }; /* Decode LLC, if it is a PDU that contains LLC */ @@ -627,6 +631,11 @@ } else { dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI); } + } + + /* Decode SNDCP, if it is a LLC PDU containing user plane data */ + if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) { + dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI); } return dec; } @@ -657,21 +666,32 @@ bssgp := bg, llc := *, l3_mo := *, - l3_mt := * + l3_mt := *, + sndcp := * +} + +template BssgpDecoded tr_BD_LLC(template PDU_LLC llc) := { + bssgp := ?, + llc := llc, + l3_mo := *, + l3_mt := *, + sndcp := * } template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := { bssgp := ?, llc := ?, l3_mo := omit, - l3_mt := mt + l3_mt := mt, + sndcp := omit } template BssgpDecoded tr_BD_L3_MO(template PDU_L3_MS_SGSN mo) := { bssgp := ?, llc := ?, l3_mo := mo, - l3_mt := omit + l3_mt := omit, + sndcp := omit } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index cfe97f8..7bc4088 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -68,5 +68,12 @@ /* LLC UI frame with SAPI for L3 payload */ template PDU_LLC tr_LLC_UI_L3 := ( tr_LLC_UI(?, c_LLC_SAPI_LLGMM) ); +/* LLC UI frame with SAPI for User payload */ +template PDU_LLC tr_LLC_UI_USER := tr_LLC_UI(?, (c_LLC_SAPI_LL3, +c_LLC_SAPI_LL5, +c_LLC_SAPI_LL9, +c_LLC_SAPI_LL11) + ); + } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 6dd56ae..a381692 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -24,6 +24,11 @@ import from GTPC_Types all; import from GTPU_Types all; +import from LLC_Types all; +import from LLC_Templates all; + +import from SNDCP_Types all; + import from TELNETasp_PortType all; import from Osmocom_VTY_Functions all; diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh index b450288..c398779 100755 --- a/sgsn/gen_links.sh +++ b/sgsn/gen_links.sh @@ -59,6 +59,11 @@ FILES="LLC_EncDec.cc LLC_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src +FILES="SNDCP_Types.ttcn" +gen_links $DIR $FILES + + DIR=$BASEDIR/titan.ProtocolModules.MobileL3_v13.4.0/src FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn
[MERGED] osmo-ttcn3-hacks[master]: BSSGP_Emulation: Allow clients to send PDU_LLC directly
Harald Welte has submitted this change and it was merged. Change subject: BSSGP_Emulation: Allow clients to send PDU_LLC directly .. BSSGP_Emulation: Allow clients to send PDU_LLC directly If a client is sending a PDU_LLC on the BSSGP port, we will encode it and wrap it in BSSGP before sending it down the stack towards the IUT, just like we're doing with L3 PDUs already so far. Change-Id: Ie3385dbb9aee793bdbd006376a69e0a551b23c3c --- M library/BSSGP_Emulation.ttcn 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index a26e01f..9a48918 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -40,6 +40,7 @@ /* port from our (internal) point of view */ type port BSSGP_SP_PT message { in PDU_BSSGP, + PDU_LLC, PDU_L3_MS_SGSN, PDU_L3_SGSN_MS; out BssgpDecoded, @@ -59,6 +60,7 @@ PDU_L3_MS_SGSN, PDU_L3_SGSN_MS; out PDU_BSSGP, + PDU_LLC, PDU_L3_SGSN_MS, PDU_L3_MS_SGSN; } with { extension "internal" }; @@ -467,6 +469,7 @@ var BSSGP_Client_CT vc_conn; var NsUnitdataIndication udi; var PDU_BSSGP bs_pdu; + var PDU_LLC llc; var PDU_L3_MS_SGSN l3_mo; var PDU_L3_SGSN_MS l3_mt; @@ -543,7 +546,6 @@ var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '0'B, n_u))); BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); } - [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn { var integer idx := f_tbl_idx_by_comp(vc_conn); var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt); @@ -552,6 +554,12 @@ var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u))); //BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc)), g_cfg.bvci); } + + [] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn { + var integer idx := f_tbl_idx_by_comp(vc_conn); + var octetstring llc_enc := enc_PDU_LLC(llc); + BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); + } } private function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t { -- To view, visit https://gerrit.osmocom.org/6580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3385dbb9aee793bdbd006376a69e0a551b23c3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP .. sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP Change-Id: I55d1299ceaad1257959b298741a7321faacc4b45 --- M sgsn/SGSN_Tests.default M sgsn/SGSN_Tests.ttcn 2 files changed, 10 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index 256c9c9..6d120fb 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -1,5 +1,11 @@ [LOGGING] +FileMask := LOG_ALL | TTCN_MATCHING; + "IPA-CTRL-IPA".FileMask := ERROR | WARNING; +"SGSN_Test-GSUP-IPA".FileMask := ERROR | WARNING; +"SGSN_Test-Gb0-NS".FileMask := ERROR | WARNING; +"SGSN_Test-Gb0-BSSGP".FileMask := ERROR | WARNING; +"SGSN_Test-GSUP".FileMask := ERROR | WARNING; [TESTPORT_PARAMETERS] *.SGSNVTY.CTRL_MODE := "client" diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a381692..a02d3a9 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -92,9 +92,9 @@ float t_guard }; -private function f_init_gb(inout GbInstance gb) runs on test_CT { - gb.vc_NS := NS_CT.create; - gb.vc_BSSGP := BSSGP_CT.create; +private function f_init_gb(inout GbInstance gb, charstring id) runs on test_CT { + gb.vc_NS := NS_CT.create(id & "-NS"); + gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP"); /* connect lower end of BSSGP emulation with NS upper port */ connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); /* connect lower end of NS emulation to NS codec port (on top of IPL4) */ @@ -175,7 +175,7 @@ sgsn_role := false }; - f_init_gb(g_gb[0]); + f_init_gb(g_gb[0], "SGSN_Test-Gb0"); f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_init_vty(); -- To view, visit https://gerrit.osmocom.org/6579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I55d1299ceaad1257959b298741a7321faacc4b45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: BSSGP_Emulation: Add SNDCP decoding support
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd2e8feed9173b0a2729b7ee1cfac37a86eca6cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: BSSGP_Emulation: Allow clients to send PDU_LLC directly
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3385dbb9aee793bdbd006376a69e0a551b23c3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_pdp_act_unattached
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I162ab7cb74102e6f15c4d685c49575bcd0b4f41c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Store SGSN-side control + user plane IP addresses
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic82910917167e667cfb26eb084f237140b4c986e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55d1299ceaad1257959b298741a7321faacc4b45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Fix hard-coded emulated GGSN IP addresses
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf42c25b4c345969c2aec209a6db6e56b69f15e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: GTP Create PDP: Include missing required "Charging ID" IE
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e4b71d7ca6e75f759f77fb47abc9816c0aa716d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP)
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6581 to look at the new patch set (#2). sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP) Change-Id: Ifd62cca8cd9dbcffe4eac957db210ac13b8c633f --- M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 144 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/6581/2 diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 9a48918..c4628be 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -702,6 +702,15 @@ sndcp := omit } +template BssgpDecoded tr_BD_SNDCP(template BIT4 sapi, template PDU_SN sn) := { + bssgp := ?, + llc := tr_LLC_UI(?, sapi), + l3_mo := omit, + l3_mt := omit, + sndcp := sn +} + + } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 7bc4088..086207c 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -20,6 +20,12 @@ pM := bool2bit(protected) } +template (value) Control_field_U ts_LLC_CtrlU(BIT4 m_bits, BIT1 p_f) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template Control_field_UI tr_LLC_CtrlUI(template uint9_t n_u, template boolean encrypted := ?, template boolean protected := ?) := { @@ -29,6 +35,14 @@ e := bool2bit_tmpl(encrypted), pM := bool2bit_tmpl(protected) } + +template Control_field_U tr_LLC_CtrlU(template BIT4 m_bits := ?, + template BIT1 p_f := ?) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template PDU_LLC ts_LLC_UI(octetstring payload, BIT4 sapi, BIT1 cr, uint9_t n_u, boolean encrypted := false, boolean protected := false) := { @@ -51,6 +65,19 @@ } } +template PDU_LLC tr_LLC_XID(template XID_Information xid, template BIT4 sapi := ?, + template BIT1 cr := ?, template BIT1 p_f := ?) := { + pDU_LLC_U := { + address_field := t_LLC_Addr(sapi, cr), + control_field := tr_LLC_CtrlU('1011'B, p_f), + information_field_U := { + xID := xid + }, + fCS := '00'O /* provided by decoder if FCS OK */ + } +} + + const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; const BIT4 c_LLC_SAPI_LL3 := '0011'B; diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a02d3a9..1652407 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2,6 +2,7 @@ import from General_Types all; import from Osmocom_Types all; +import from Native_Functions all; import from NS_Types all; import from NS_Emulation all; import from BSSGP_Types all; @@ -781,7 +782,7 @@ octetstring sgsn_ip_u optional }; -function f_pdp_ctx_act(PdpActPars apars) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; @@ -795,6 +796,8 @@ apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; + f_gtp_register_teid(apars.ggsn_tei_c); + f_gtp_register_teid(apars.ggsn_tei_u); var OCT1 cause := int2oct(128, 1); GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, cause, @@ -868,7 +871,7 @@ addressInfo := omit } -template (value) PdpActPars t_PdpActPars := { +template (value) PdpActPars t_PdpActPars(charstring ggsn_ip) := { tid := '000'B, nsapi := '0101'B, /* < 5 are reserved */ sapi := '0011'B, /* 3/5/9/11 */ @@ -882,8 +885,8 @@ /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, ggsn_tei_u := '0002'O, - ggsn_ip_c := '7F02'O, - ggsn_ip_u := '7F02'O, + ggsn_ip_c := f_inet_addr(ggsn_ip), + ggsn_ip_u := f_inet_addr(ggsn_ip), sgsn_tei_c := omit, sgsn_tei_u := omit, @@ -891,8 +894,87 @@ sgsn_ip_u := omit } +template (value) GtpPeer ts_GtpPeerU(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1U_PORT +} + +template (value) GtpPeer ts_GtpPeerC(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1C_PORT +} + +private function f_gtpu_send(inout PdpActPars apars,
[PATCH] osmo-ttcn3-hacks[master]: BSSGP_Emulation: Add SNDCP decoding support
Review at https://gerrit.osmocom.org/6578 BSSGP_Emulation: Add SNDCP decoding support Change-Id: Icd2e8feed9173b0a2729b7ee1cfac37a86eca6cf --- M gprs_gb/gen_links.sh M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh 5 files changed, 47 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/78/6578/1 diff --git a/gprs_gb/gen_links.sh b/gprs_gb/gen_links.sh index 85a35ab..5cbaaae 100755 --- a/gprs_gb/gen_links.sh +++ b/gprs_gb/gen_links.sh @@ -47,6 +47,11 @@ FILES="LLC_EncDec.cc LLC_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src +FILES="SNDCP_Types.ttcn" +gen_links $DIR $FILES + + DIR=../library FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn " FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc " diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 0be12e8..a26e01f 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -14,6 +14,8 @@ import from LLC_Types all; import from LLC_Templates all; +import from SNDCP_Types all; + /*** * Communication between Client Components and Main Component ***/ @@ -601,7 +603,8 @@ PDU_BSSGP bssgp, PDU_LLC llc optional, PDU_L3_MS_SGSN l3_mo optional, - PDU_L3_SGSN_MS l3_mt optional + PDU_L3_SGSN_MS l3_mt optional, + PDU_SN sndcp optional } /* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */ @@ -610,7 +613,8 @@ bssgp := bssgp, llc := omit, l3_mo := omit, - l3_mt := omit + l3_mt := omit, + sndcp := omit }; /* Decode LLC, if it is a PDU that contains LLC */ @@ -627,6 +631,11 @@ } else { dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI); } + } + + /* Decode SNDCP, if it is a LLC PDU containing user plane data */ + if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) { + dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI); } return dec; } @@ -657,21 +666,32 @@ bssgp := bg, llc := *, l3_mo := *, - l3_mt := * + l3_mt := *, + sndcp := * +} + +template BssgpDecoded tr_BD_LLC(template PDU_LLC llc) := { + bssgp := ?, + llc := llc, + l3_mo := *, + l3_mt := *, + sndcp := * } template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := { bssgp := ?, llc := ?, l3_mo := omit, - l3_mt := mt + l3_mt := mt, + sndcp := omit } template BssgpDecoded tr_BD_L3_MO(template PDU_L3_MS_SGSN mo) := { bssgp := ?, llc := ?, l3_mo := mo, - l3_mt := omit + l3_mt := omit, + sndcp := omit } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index cfe97f8..7bc4088 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -68,5 +68,12 @@ /* LLC UI frame with SAPI for L3 payload */ template PDU_LLC tr_LLC_UI_L3 := ( tr_LLC_UI(?, c_LLC_SAPI_LLGMM) ); +/* LLC UI frame with SAPI for User payload */ +template PDU_LLC tr_LLC_UI_USER := tr_LLC_UI(?, (c_LLC_SAPI_LL3, +c_LLC_SAPI_LL5, +c_LLC_SAPI_LL9, +c_LLC_SAPI_LL11) + ); + } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 6dd56ae..a381692 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -24,6 +24,11 @@ import from GTPC_Types all; import from GTPU_Types all; +import from LLC_Types all; +import from LLC_Templates all; + +import from SNDCP_Types all; + import from TELNETasp_PortType all; import from Osmocom_VTY_Functions all; diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh index b450288..c398779 100755 --- a/sgsn/gen_links.sh +++ b/sgsn/gen_links.sh @@ -59,6 +59,11 @@ FILES="LLC_EncDec.cc LLC_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src +FILES="SNDCP_Types.ttcn" +gen_links $DIR $FILES + + DIR=$BASEDIR/titan.ProtocolModules.MobileL3_v13.4.0/src FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn" gen_links $DIR $FILES -- To view, visit
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Store SGSN-side control + user plane IP addresses
Review at https://gerrit.osmocom.org/6575 sgsn: Store SGSN-side control + user plane IP addresses Change-Id: Ic82910917167e667cfb26eb084f237140b4c986e --- M sgsn/SGSN_Tests.ttcn 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/75/6575/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 988ece1..6b36bc2 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -769,9 +769,10 @@ octetstring ggsn_ip_c, octetstring ggsn_ip_u, - GtpPeer sgsn, OCT4sgsn_tei_c optional, - OCT4sgsn_tei_u optional + OCT4sgsn_tei_u optional, + octetstring sgsn_ip_c optional, + octetstring sgsn_ip_u optional }; function f_pdp_ctx_act(PdpActPars apars) runs on BSSGP_ConnHdlr { @@ -786,6 +787,8 @@ var GTPC_PDUs gtpc_rx := g_ud.gtpc.gtpc_pdu; apars.sgsn_tei_c := gtpc_rx.createPDPContextRequest.teidControlPlane.teidControlPlane; apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; + apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; + apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; var OCT1 cause := int2oct(128, 1); GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, cause, @@ -875,9 +878,10 @@ ggsn_ip_c := '7F01'O, ggsn_ip_u := '7F01'O, - sgsn := { }, sgsn_tei_c := omit, - sgsn_tei_u := omit + sgsn_tei_u := omit, + sgsn_ip_c := omit, + sgsn_ip_u := omit } private function f_TC_attach_pdp_act(charstring id) runs on BSSGP_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/6575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic82910917167e667cfb26eb084f237140b4c986e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: BSSGP_Emulation: Allow clients to send PDU_LLC directly
Review at https://gerrit.osmocom.org/6580 BSSGP_Emulation: Allow clients to send PDU_LLC directly If a client is sending a PDU_LLC on the BSSGP port, we will encode it and wrap it in BSSGP before sending it down the stack towards the IUT, just like we're doing with L3 PDUs already so far. Change-Id: Ie3385dbb9aee793bdbd006376a69e0a551b23c3c --- M library/BSSGP_Emulation.ttcn 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/80/6580/1 diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index a26e01f..9a48918 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -40,6 +40,7 @@ /* port from our (internal) point of view */ type port BSSGP_SP_PT message { in PDU_BSSGP, + PDU_LLC, PDU_L3_MS_SGSN, PDU_L3_SGSN_MS; out BssgpDecoded, @@ -59,6 +60,7 @@ PDU_L3_MS_SGSN, PDU_L3_SGSN_MS; out PDU_BSSGP, + PDU_LLC, PDU_L3_SGSN_MS, PDU_L3_MS_SGSN; } with { extension "internal" }; @@ -467,6 +469,7 @@ var BSSGP_Client_CT vc_conn; var NsUnitdataIndication udi; var PDU_BSSGP bs_pdu; + var PDU_LLC llc; var PDU_L3_MS_SGSN l3_mo; var PDU_L3_SGSN_MS l3_mt; @@ -543,7 +546,6 @@ var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '0'B, n_u))); BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); } - [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn { var integer idx := f_tbl_idx_by_comp(vc_conn); var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt); @@ -552,6 +554,12 @@ var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u))); //BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc)), g_cfg.bvci); } + + [] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn { + var integer idx := f_tbl_idx_by_comp(vc_conn); + var octetstring llc_enc := enc_PDU_LLC(llc); + BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); + } } private function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t { -- To view, visit https://gerrit.osmocom.org/6580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3385dbb9aee793bdbd006376a69e0a551b23c3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP)
Review at https://gerrit.osmocom.org/6581 sgsn: Add user plane GTP testing (GTP->Gb and Gb->GTP) Change-Id: Ifd62cca8cd9dbcffe4eac957db210ac13b8c633f --- M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 139 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/6581/1 diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 9a48918..c4628be 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -702,6 +702,15 @@ sndcp := omit } +template BssgpDecoded tr_BD_SNDCP(template BIT4 sapi, template PDU_SN sn) := { + bssgp := ?, + llc := tr_LLC_UI(?, sapi), + l3_mo := omit, + l3_mt := omit, + sndcp := sn +} + + } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 7bc4088..086207c 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -20,6 +20,12 @@ pM := bool2bit(protected) } +template (value) Control_field_U ts_LLC_CtrlU(BIT4 m_bits, BIT1 p_f) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template Control_field_UI tr_LLC_CtrlUI(template uint9_t n_u, template boolean encrypted := ?, template boolean protected := ?) := { @@ -29,6 +35,14 @@ e := bool2bit_tmpl(encrypted), pM := bool2bit_tmpl(protected) } + +template Control_field_U tr_LLC_CtrlU(template BIT4 m_bits := ?, + template BIT1 p_f := ?) := { + mBits := m_bits, + pF := p_f, + format := '111'B +} + template PDU_LLC ts_LLC_UI(octetstring payload, BIT4 sapi, BIT1 cr, uint9_t n_u, boolean encrypted := false, boolean protected := false) := { @@ -51,6 +65,19 @@ } } +template PDU_LLC tr_LLC_XID(template XID_Information xid, template BIT4 sapi := ?, + template BIT1 cr := ?, template BIT1 p_f := ?) := { + pDU_LLC_U := { + address_field := t_LLC_Addr(sapi, cr), + control_field := tr_LLC_CtrlU('1011'B, p_f), + information_field_U := { + xID := xid + }, + fCS := '00'O /* provided by decoder if FCS OK */ + } +} + + const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; const BIT4 c_LLC_SAPI_LL3 := '0011'B; diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a02d3a9..f41817f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2,6 +2,7 @@ import from General_Types all; import from Osmocom_Types all; +import from Native_Functions all; import from NS_Types all; import from NS_Emulation all; import from BSSGP_Types all; @@ -781,7 +782,7 @@ octetstring sgsn_ip_u optional }; -function f_pdp_ctx_act(PdpActPars apars) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; @@ -795,6 +796,8 @@ apars.sgsn_tei_u := gtpc_rx.createPDPContextRequest.teidDataI.teidDataI; apars.sgsn_ip_c := gtpc_rx.createPDPContextRequest.sgsn_addr_signalling.addressf; apars.sgsn_ip_u := gtpc_rx.createPDPContextRequest.sgsn_addr_traffic.addressf; + f_gtp_register_teid(apars.ggsn_tei_c); + f_gtp_register_teid(apars.ggsn_tei_u); var OCT1 cause := int2oct(128, 1); GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, cause, @@ -891,6 +894,85 @@ sgsn_ip_u := omit } +template (value) GtpPeer ts_GtpPeerU(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1U_PORT +} + +template (value) GtpPeer ts_GtpPeerC(octetstring ip) := { + connId := 1, + remName := f_inet_ntoa(ip), + remPort := GTP1C_PORT +} + +private function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { + var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); + GTP.send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload)); +} + +private altstep as_xid(PdpActPars apars) runs on BSSGP_ConnHdlr { + [] BSSGP.receive(tr_BD_LLC(tr_LLC_XID(?, apars.sapi))) { + repeat; + } +} + +template PDU_SN tr_SN_UD(template BIT4 nsapi, template octetstring payload) := { + pDU_SN_UNITDATA := { + nsapi := nsapi, + moreBit := ?, + snPduType := '1'B, + firstSegmentIndicator := ?, + spareBit := ?, + pcomp := ?, + dcomp := ?, + npduNumber :=
[PATCH] osmo-ttcn3-hacks[master]: sgsn: GTP Create PDP: Include missing required "Charging ID" IE
Review at https://gerrit.osmocom.org/6576 sgsn: GTP Create PDP: Include missing required "Charging ID" IE Change-Id: I7e4b71d7ca6e75f759f77fb47abc9816c0aa716d --- M library/GTP_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/6576/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index b64289b..f071d04 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -295,7 +295,7 @@ template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, - template EndUserAddress eua := omit, + OCT4 chg_id, template EndUserAddress eua := omit, template ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, @@ -310,7 +310,10 @@ teidControlPlane := teid_ctrl }, nsapi := ts_NSAPI(nsapi), - chargingID := omit, + chargingID := { + type_gtpc := '7F'O, + chargingID := chg_id + }, endUserAddress := eua, protConfigOptions := pco, ggsn_addr_controlPlane := ts_GsnAddr(ggsn_ip_sign), @@ -335,13 +338,13 @@ OCT1 cause, OCT4 teid_ctrl, OCT4 teid_data, BIT4 nsapi, octetstring ggsn_ip_sign, -octetstring ggsn_ip_data, +octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, template ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, - ggsn_ip_sign, ggsn_ip_data, + ggsn_ip_sign, ggsn_ip_data, chg_id, eua, pco)), seq) } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 6b36bc2..3a9db69 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -763,6 +763,7 @@ octetstring apn optional, ProtocolConfigOptionsV pco optional, OCT1exp_rej_cause optional, + OCT4chg_id, OCT4ggsn_tei_c, OCT4ggsn_tei_u, @@ -794,7 +795,7 @@ apars.sgsn_tei_c, cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u)); + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); } } alt { @@ -871,6 +872,7 @@ apn := omit, pco := omit, exp_rej_cause := omit, + chg_id := '0001'O, /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, -- To view, visit https://gerrit.osmocom.org/6576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e4b71d7ca6e75f759f77fb47abc9816c0aa716d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Fix hard-coded emulated GGSN IP addresses
Review at https://gerrit.osmocom.org/6577 sgsn: Fix hard-coded emulated GGSN IP addresses Change-Id: Iaf42c25b4c345969c2aec209a6db6e56b69f15e3 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/77/6577/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 3a9db69..6dd56ae 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -877,8 +877,8 @@ /* FIXME: make below dynamic !! */ ggsn_tei_c := '0001'O, ggsn_tei_u := '0002'O, - ggsn_ip_c := '7F01'O, - ggsn_ip_u := '7F01'O, + ggsn_ip_c := '7F02'O, + ggsn_ip_u := '7F02'O, sgsn_tei_c := omit, sgsn_tei_u := omit, -- To view, visit https://gerrit.osmocom.org/6577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf42c25b4c345969c2aec209a6db6e56b69f15e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP
Review at https://gerrit.osmocom.org/6579 sgsn: Reduce logging verbosity of IPA/GSUP/NS/BSSGP Change-Id: I55d1299ceaad1257959b298741a7321faacc4b45 --- M sgsn/SGSN_Tests.default M sgsn/SGSN_Tests.ttcn 2 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/6579/1 diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index 256c9c9..6d120fb 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -1,5 +1,11 @@ [LOGGING] +FileMask := LOG_ALL | TTCN_MATCHING; + "IPA-CTRL-IPA".FileMask := ERROR | WARNING; +"SGSN_Test-GSUP-IPA".FileMask := ERROR | WARNING; +"SGSN_Test-Gb0-NS".FileMask := ERROR | WARNING; +"SGSN_Test-Gb0-BSSGP".FileMask := ERROR | WARNING; +"SGSN_Test-GSUP".FileMask := ERROR | WARNING; [TESTPORT_PARAMETERS] *.SGSNVTY.CTRL_MODE := "client" diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a381692..a02d3a9 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -92,9 +92,9 @@ float t_guard }; -private function f_init_gb(inout GbInstance gb) runs on test_CT { - gb.vc_NS := NS_CT.create; - gb.vc_BSSGP := BSSGP_CT.create; +private function f_init_gb(inout GbInstance gb, charstring id) runs on test_CT { + gb.vc_NS := NS_CT.create(id & "-NS"); + gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP"); /* connect lower end of BSSGP emulation with NS upper port */ connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); /* connect lower end of NS emulation to NS codec port (on top of IPL4) */ @@ -175,7 +175,7 @@ sgsn_role := false }; - f_init_gb(g_gb[0]); + f_init_gb(g_gb[0], "SGSN_Test-Gb0"); f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_init_vty(); -- To view, visit https://gerrit.osmocom.org/6579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55d1299ceaad1257959b298741a7321faacc4b45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[MERGED] osmo-ttcn3-hacks[master]: ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log"
Harald Welte has submitted this change and it was merged. Change subject: ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log" .. ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log" The problem is that we use ttcn3_logmerge FOO_Tests.*.log and that the tcpdump stdout log files also match this pattern. Call them .pcap.stdout in order to avoid them falling into the globbing pattern of the TITAN log files. Change-Id: Iac1ae217b006182121d86375ffa4d3c00ef37e8b --- M ttcn3-tcpdump-start.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 0ce88e9..7321b52 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -20,7 +20,7 @@ else CMD="sudo $TCPDUMP" fi -$CMD -U -s 0 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.log 2>&1 & +$CMD -U -s 0 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.stdout 2>&1 & PID=$! echo $PID > $PIDFILE -- To view, visit https://gerrit.osmocom.org/6572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac1ae217b006182121d86375ffa4d3c00ef37e8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log"
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac1ae217b006182121d86375ffa4d3c00ef37e8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log"
Review at https://gerrit.osmocom.org/6572 ttcn3-tcpdump-start.sh: Don't call tcpdump log files ".log" The problem is that we use ttcn3_logmerge FOO_Tests.*.log and that the tcpdump stdout log files also match this pattern. Call them .pcap.stdout in order to avoid them falling into the globbing pattern of the TITAN log files. Change-Id: Iac1ae217b006182121d86375ffa4d3c00ef37e8b --- M ttcn3-tcpdump-start.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/6572/1 diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 0ce88e9..7321b52 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -20,7 +20,7 @@ else CMD="sudo $TCPDUMP" fi -$CMD -U -s 0 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.log 2>&1 & +$CMD -U -s 0 -n -i any -w "$TTCN3_PCAP_PATH/$TESTCASE.pcap" >$TTCN3_PCAP_PATH/$TESTCASE.pcap.stdout 2>&1 & PID=$! echo $PID > $PIDFILE -- To view, visit https://gerrit.osmocom.org/6572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac1ae217b006182121d86375ffa4d3c00ef37e8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
osmo-mgw[master]: osmo-mgw: Add talloc context introspection via VTY
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59feac155ba2342fcc2b27b029e803b8a10da2d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: BSSGP_Emulation: use 'isvalue()' instead of 'isbound()'
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6e9ea970a90470a98a33e50ea5cff0fd1781719 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: BSSGP_Emulation: use 'isvalue()' instead of 'isbound()'
Review at https://gerrit.osmocom.org/6571 BSSGP_Emulation: use 'isvalue()' instead of 'isbound()' This seems to be a bug in TITAN 6.1.0: isbound() on a bound-value still returns false. isvalue() however returns true if the variable is bound, while still returning false if it is not. Change-Id: If6e9ea970a90470a98a33e50ea5cff0fd1781719 --- M library/BSSGP_Emulation.ttcn 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/6571/1 diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index 1ced242..0be12e8 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -266,8 +266,8 @@ runs on BSSGP_CT { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (not isbound(ClientTable[i].comp_ref)) { - log("Adding Client IMSI=", imsi, ", TLLI=", tlli, ", index=", i); + if (not isvalue(ClientTable[i].comp_ref)) { + log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i); ClientTable[i] := { tlli := tlli, tlli_old := omit, @@ -289,7 +289,7 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (isbound(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) { + if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) { if (ClientTable[i].comp_ref != vc_conn) { setverdict(fail, "Cannot unregister IMSI ", imsi, " registred to ", ClientTable[i].comp_ref, " from ", vc_conn); @@ -326,7 +326,7 @@ private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (isbound(ClientTable[i].imsi) and isbound(ClientTable[i].comp_ref) + if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref) and ClientTable[i].imsi == imsi) { return ClientTable[i].comp_ref; } @@ -338,9 +338,9 @@ private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (isbound(ClientTable[i].comp_ref) and - (isbound(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or -isbound(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) { + if (isvalue(ClientTable[i].comp_ref) and + (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or +isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) { return ClientTable[i].comp_ref; } } @@ -351,7 +351,7 @@ private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) { + if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) { return i; } } @@ -362,7 +362,7 @@ private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { - if (isbound(ClientTable[i].tlli) and isbound(ClientTable[i].comp_ref) + if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) { return ClientTable[i].tlli; } -- To view, visit https://gerrit.osmocom.org/6571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6e9ea970a90470a98a33e50ea5cff0fd1781719 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[MERGED] osmo-ttcn3-hacks[master]: Makefile: Add 'sgsn' sub-directory in list of projects
Harald Welte has submitted this change and it was merged. Change subject: Makefile: Add 'sgsn' sub-directory in list of projects .. Makefile: Add 'sgsn' sub-directory in list of projects Change-Id: I2b9e5a28e60f06d05ac4ac2e3ed90c6bf72e03f2 --- M Makefile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index 8999ec8..2fcc561 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sysinfo +SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo PARALLEL_MAKE:=-j4 -- To view, visit https://gerrit.osmocom.org/6570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b9e5a28e60f06d05ac4ac2e3ed90c6bf72e03f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: Makefile: Add 'sgsn' sub-directory in list of projects
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b9e5a28e60f06d05ac4ac2e3ed90c6bf72e03f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Fix syntax errors introduced in PDP Context Act patches
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Fix syntax errors introduced in PDP Context Act patches .. sgsn: Fix syntax errors introduced in PDP Context Act patches those were undetected as 'sgsn' is not yet part of the subdirectory list in the master Makefile :/ Change-Id: I46b2baa10cc5a20cd0cb9c0bf32cc0e1a19d38e6 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 9209c69..138b63b 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -795,16 +795,16 @@ } } alt { - [exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { + [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { setverdict(pass); } - [exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_ACCEPT)) { + [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) { setverdict(fail, "Unexpected PDP CTX ACT ACC"); } - [not exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { + [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { setverdict(fail, "Unexpected PDP CTX ACT FAIL"); } - [not exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { + [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); } } -- To view, visit https://gerrit.osmocom.org/6569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I46b2baa10cc5a20cd0cb9c0bf32cc0e1a19d38e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Fix syntax errors introduced in PDP Context Act patches
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b2baa10cc5a20cd0cb9c0bf32cc0e1a19d38e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-ttcn3-hacks[master]: sgsn: Fix syntax errors introduced in PDP Context Act patches
Review at https://gerrit.osmocom.org/6569 sgsn: Fix syntax errors introduced in PDP Context Act patches those were undetected as 'sgsn' is not yet part of the subdirectory list in the master Makefile :/ Change-Id: I46b2baa10cc5a20cd0cb9c0bf32cc0e1a19d38e6 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/6569/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 9209c69..138b63b 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -795,16 +795,16 @@ } } alt { - [exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { + [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { setverdict(pass); } - [exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_ACCEPT)) { + [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) { setverdict(fail, "Unexpected PDP CTX ACT ACC"); } - [not exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { + [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { setverdict(fail, "Unexpected PDP CTX ACT FAIL"); } - [not exp_rej] BSSGP.receive(tr_BD_L3(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { + [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); } } -- To view, visit https://gerrit.osmocom.org/6569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46b2baa10cc5a20cd0cb9c0bf32cc0e1a19d38e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
[PATCH] osmo-ttcn3-hacks[master]: Makefile: Add 'sgsn' sub-directory in list of projects
Review at https://gerrit.osmocom.org/6570 Makefile: Add 'sgsn' sub-directory in list of projects Change-Id: I2b9e5a28e60f06d05ac4ac2e3ed90c6bf72e03f2 --- M Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/70/6570/1 diff --git a/Makefile b/Makefile index 8999ec8..2fcc561 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sysinfo +SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sgsn sysinfo PARALLEL_MAKE:=-j4 -- To view, visit https://gerrit.osmocom.org/6570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b9e5a28e60f06d05ac4ac2e3ed90c6bf72e03f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte
osmo-ttcn3-hacks[master]: sgsn: First PDP CTX ACT test: TC_attach_pdp_act
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1bfaca99a2a70bb097e2ee44f54e4a31b849a1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: First PDP CTX ACT test: TC_attach_pdp_act
Harald Welte has submitted this change and it was merged. Change subject: sgsn: First PDP CTX ACT test: TC_attach_pdp_act .. sgsn: First PDP CTX ACT test: TC_attach_pdp_act Change-Id: Ia1bfaca99a2a70bb097e2ee44f54e4a31b849a1b --- M library/GSUP_Types.ttcn M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh M sgsn/regen_makefile.sh 6 files changed, 420 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 0a21999..5e6b20a 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -105,7 +105,12 @@ msisdn, tag = OSMO_GSUP_MSISDN_IE; hlr_number, tag = OSMO_GSUP_HLR_NUMBER_IE; cn_domain, tag = OSMO_GSUP_CN_DOMAIN_IE; -charg_char, tag = OSMO_GSUP_CHARG_CHAR_IE)" +pdp_info, tag = OSMO_GSUP_PDP_INFO_IE; +apn, tag = OSMO_GSUP_ACCESS_POINT_NAME_IE; +pdp_qos, tag = OSMO_GSUP_PDP_QOS_IE; +pdp_type, tag = OSMO_GSUP_PDP_TYPE_IE; +charg_char, tag = OSMO_GSUP_CHARG_CHAR_IE; + )" }; type record of GSUP_IE GSUP_IEs; @@ -116,7 +121,6 @@ GSUP_CancelType cancel_type, //boolean pdp_info_compl, //boolean freeze_ptmsi, - GSUP_IEspdp_info, GSUP_IEsauth_tuple, octetstring auts, octetstring rand, @@ -129,6 +133,11 @@ GSUP_MSISDN msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, + /* PDP context + nested IEs */ + GSUP_IEspdp_info, + octetstring apn, + octetstring pdp_qos, + OCT2pdp_type, octetstring charg_char }; @@ -216,6 +225,35 @@ } } } + +template GSUP_IE ts_GSUP_IE_PdpInfo(octetstring apn, octetstring pdp_type, octetstring pdp_qos) := { + tag := OSMO_GSUP_PDP_INFO_IE, + len := 0, /* overwritten */ + val := { + pdp_info := { + valueof(ts_GSUP_IE_APN(apn)), + valueof(ts_GSUP_IE_PDP_TYPE(pdp_type)), + valueof(ts_GSUP_IE_PDP_QOS(pdp_qos)) + } + } +} + +template (value) GSUP_IE ts_GSUP_IE_PDP_TYPE(OCT2 pdp_type) := { + tag := OSMO_GSUP_PDP_TYPE_IE, + len := 0, + val := { + pdp_type := pdp_type + } +} + +template (value) GSUP_IE ts_GSUP_IE_PDP_QOS(octetstring pdp_qos) := { + tag := OSMO_GSUP_PDP_QOS_IE, + len := 0, + val := { + pdp_qos := pdp_qos + } +} + template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := { msg_type := msgt, @@ -428,6 +466,14 @@ } } +template (value) GSUP_IE ts_GSUP_IE_APN(octetstring apn) := { + tag := OSMO_GSUP_ACCESS_POINT_NAME_IE, + len := 0, /* overwritten */ + val := { + apn := apn + } +} + } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 02a31b6..b64289b 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -280,6 +280,71 @@ sgsn_ip_data, msisdn, pco)), seq) } + + template NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { + type_gtpc := '14'O, + nsapi := nsapi, + unused := ''B + } + + template ReorderingRequired ts_ReorderReq(boolean req := false) := { + type_gtpc := '08'O, + reordreq := bool2bit(req), + spare := '000'B + } + + template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, + octetstring ggsn_ip_sign, octetstring ggsn_ip_data, + template EndUserAddress eua := omit, + template ProtConfigOptions pco := omit) := { + createPDPContextResponse := { + cause := { '00'O, cause }, + reorderingRequired := ts_ReorderReq(false), + recovery := omit, + teidDataI := { + type_gtpc := '00'O, + teidDataI := teid_data + }, + teidControlPlane := { + type_gtpc := '00'O, + teidControlPlane :=
[ABANDON] osmo-ttcn3-hacks[master]: sgsn: Parse Attach Accept (RA, P-TMSI, P-TMSI SIG, ...)
Harald Welte has abandoned this change. Change subject: sgsn: Parse Attach Accept (RA, P-TMSI, P-TMSI SIG, ...) .. Abandoned Included in Id36733e7e51b252407c7513d8441db9a555fd30d -- To view, visit https://gerrit.osmocom.org/6556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5778aa98181e0418d4fe11e31619b679f226f043 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Jenkins Builder
[PATCH] osmo-ttcn3-hacks[master]: sgsn: First PDP CTX ACT test: TC_attach_pdp_act
Review at https://gerrit.osmocom.org/6568 sgsn: First PDP CTX ACT test: TC_attach_pdp_act Change-Id: Ia1bfaca99a2a70bb097e2ee44f54e4a31b849a1b --- M library/GSUP_Types.ttcn M library/GTP_Templates.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh M sgsn/regen_makefile.sh 6 files changed, 420 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/6568/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 0a21999..5e6b20a 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -105,7 +105,12 @@ msisdn, tag = OSMO_GSUP_MSISDN_IE; hlr_number, tag = OSMO_GSUP_HLR_NUMBER_IE; cn_domain, tag = OSMO_GSUP_CN_DOMAIN_IE; -charg_char, tag = OSMO_GSUP_CHARG_CHAR_IE)" +pdp_info, tag = OSMO_GSUP_PDP_INFO_IE; +apn, tag = OSMO_GSUP_ACCESS_POINT_NAME_IE; +pdp_qos, tag = OSMO_GSUP_PDP_QOS_IE; +pdp_type, tag = OSMO_GSUP_PDP_TYPE_IE; +charg_char, tag = OSMO_GSUP_CHARG_CHAR_IE; + )" }; type record of GSUP_IE GSUP_IEs; @@ -116,7 +121,6 @@ GSUP_CancelType cancel_type, //boolean pdp_info_compl, //boolean freeze_ptmsi, - GSUP_IEspdp_info, GSUP_IEsauth_tuple, octetstring auts, octetstring rand, @@ -129,6 +133,11 @@ GSUP_MSISDN msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, + /* PDP context + nested IEs */ + GSUP_IEspdp_info, + octetstring apn, + octetstring pdp_qos, + OCT2pdp_type, octetstring charg_char }; @@ -216,6 +225,35 @@ } } } + +template GSUP_IE ts_GSUP_IE_PdpInfo(octetstring apn, octetstring pdp_type, octetstring pdp_qos) := { + tag := OSMO_GSUP_PDP_INFO_IE, + len := 0, /* overwritten */ + val := { + pdp_info := { + valueof(ts_GSUP_IE_APN(apn)), + valueof(ts_GSUP_IE_PDP_TYPE(pdp_type)), + valueof(ts_GSUP_IE_PDP_QOS(pdp_qos)) + } + } +} + +template (value) GSUP_IE ts_GSUP_IE_PDP_TYPE(OCT2 pdp_type) := { + tag := OSMO_GSUP_PDP_TYPE_IE, + len := 0, + val := { + pdp_type := pdp_type + } +} + +template (value) GSUP_IE ts_GSUP_IE_PDP_QOS(octetstring pdp_qos) := { + tag := OSMO_GSUP_PDP_QOS_IE, + len := 0, + val := { + pdp_qos := pdp_qos + } +} + template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := { msg_type := msgt, @@ -428,6 +466,14 @@ } } +template (value) GSUP_IE ts_GSUP_IE_APN(octetstring apn) := { + tag := OSMO_GSUP_ACCESS_POINT_NAME_IE, + len := 0, /* overwritten */ + val := { + apn := apn + } +} + } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 02a31b6..b64289b 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -280,6 +280,71 @@ sgsn_ip_data, msisdn, pco)), seq) } + + template NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { + type_gtpc := '14'O, + nsapi := nsapi, + unused := ''B + } + + template ReorderingRequired ts_ReorderReq(boolean req := false) := { + type_gtpc := '08'O, + reordreq := bool2bit(req), + spare := '000'B + } + + template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, + octetstring ggsn_ip_sign, octetstring ggsn_ip_data, + template EndUserAddress eua := omit, + template ProtConfigOptions pco := omit) := { + createPDPContextResponse := { + cause := { '00'O, cause }, + reorderingRequired := ts_ReorderReq(false), + recovery := omit, + teidDataI := { + type_gtpc := '00'O, + teidDataI := teid_data + }, + teidControlPlane := { + type_gtpc := '00'O, + teidControlPlane := teid_ctrl + }, + nsapi := ts_NSAPI(nsapi), + chargingID := omit, +
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Reduce code duplication by introducing f_mi_get_lv()
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Reduce code duplication by introducing f_mi_get_lv() .. sgsn: Reduce code duplication by introducing f_mi_get_lv() Change-Id: I8b970049074f5de9051a5a791278cd5d29f9d5ed --- M sgsn/SGSN_Tests.ttcn 1 file changed, 19 insertions(+), 79 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 490fbc2..248a9c3 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -305,18 +305,20 @@ return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); } +/* return a MobileIdentityLV: P-TMSI if we have one, IMSI otherwise */ +private function f_mi_get_lv() runs on BSSGP_ConnHdlr return MobileIdentityLV { + if (ispresent(g_pars.p_tmsi)) { + return valueof(ts_MI_TMSI_LV(g_pars.p_tmsi)); + } else { + return valueof(ts_MI_IMSI_LV(g_pars.imsi)); + } +} + private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - 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)); + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); f_gmm_auth(); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); @@ -342,16 +344,9 @@ /* MS never responds to ID REQ, expect ATTACH REJECT */ private function f_TC_attach_auth_id_timeout(charstring id) runs on BSSGP_ConnHdlr { - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - 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)); + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); alt { [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ(?))) { /* don't send ID Response */ @@ -374,16 +369,9 @@ /* HLR never responds to SAI REQ, expect ATTACH REJECT */ private function f_TC_attach_auth_sai_timeout(charstring id) runs on BSSGP_ConnHdlr { - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - 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)); + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); alt { [] as_mm_identity(); [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { } @@ -401,16 +389,9 @@ /* HLR rejects SAI, expect ATTACH REJECT */ private function f_TC_attach_auth_sai_reject(charstring id) runs on BSSGP_ConnHdlr { - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - 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)); + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); alt { [] as_mm_identity(); [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { @@ -430,16 +411,9 @@ /* HLR never responds to UL REQ, expect ATTACH REJECT */ private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - 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)); + BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); f_gmm_auth(); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); @@ -465,16 +439,9 @@ /* HLR rejects UL REQ, expect ATTACH REJECT */ private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; - var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); - if
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Implement TLLI assignment/modification/unassignment
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Implement TLLI assignment/modification/unassignment .. sgsn: Implement TLLI assignment/modification/unassignment It's important that we implement the proper TLLI handling whenever our P-TMSI changes. Change-Id: I5b95b9e49f0a1db9659714c4d01f340fd44fafe8 --- M library/BSSGP_Emulation.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 46 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index f981adb..fb3f7d4 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -63,9 +63,10 @@ signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id); signature BSSGP_unregister_client(hexstring imsi); +signature BSSGP_llgmm_assign(OCT4 tlli_old, OCT4 tlli); type port BSSGP_PROC_PT procedure { - inout BSSGP_register_client, BSSGP_unregister_client; + inout BSSGP_register_client, BSSGP_unregister_client, BSSGP_llgmm_assign; } with { extension "internal" }; @@ -303,6 +304,25 @@ self.stop; } +/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ +private function f_tbl_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_Client_CT vc_conn) +runs on BSSGP_CT { + var integer i := f_tbl_idx_by_comp(vc_conn); + + if (tlli_old == ''O and tlli_new != ''O) { + /* TLLI assignment */ + ClientTable[i].tlli := tlli_new; + ClientTable[i].tlli_old := omit; + } else if (tlli_old != ''O and tlli_new != ''O) { + /* TLLI change: both active */ + ClientTable[i].tlli := tlli_new; + ClientTable[i].tlli_old := tlli_old; + } else if (tlli_old != ''O and tlli_new == ''O) { + /* TLLI unassignment: old shall be unassigned; new stays */ + ClientTable[i].tlli_old := omit; + } +} + private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT { var integer i; for (i := 0; i < sizeof(ClientTable); i := i+1) { @@ -357,7 +377,7 @@ var NsStatusIndication nsi; var ASP_Event evt; var hexstring imsi; - var OCT4 tlli; + var OCT4 tlli, tlli_old; var BssgpCellId cell_id; /* Respond to BLOCK for wrong NSVCI */ @@ -421,6 +441,11 @@ f_tbl_client_del(imsi, vc_conn); BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}); } + [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn { + f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn); + BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}); + } + } altstep as_blocked() runs on BSSGP_CT { @@ -620,13 +645,20 @@ } } +/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ +function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC) +runs on BSSGP_Client_CT { + PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) { + [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {}; + } +} + template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := { bssgp := bg, llc := *, l3_mo := *, l3_mt := * } - template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := { bssgp := ?, @@ -641,7 +673,6 @@ l3_mo := mo, l3_mt := omit } - diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 70e8124..a59bde3 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -69,6 +69,7 @@ OCT3 p_tmsi_sig optional, /* TLLI of the simulated MS */ OCT4 tlli, + OCT4 tlli_old optional, RoutingAreaIdentificationV ra optional, BssgpCellId bssgp_cell_id, AuthVector vec optional, @@ -168,6 +169,7 @@ p_tmsi := omit, p_tmsi_sig := omit, tlli := f_gprs_tlli_random(), + tlli_old := omit, ra := omit, bssgp_cell_id := gb.cfg.cell_id, vec := omit, @@ -278,6 +280,14 @@ deactivate(di); } +function f_upd_ptmsi_and_tlli(OCT4 p_tmsi) runs on BSSGP_ConnHdlr { + g_pars.p_tmsi := p_tmsi; + /* update TLLI */ + g_pars.tlli_old := g_pars.tlli; + g_pars.tlli := g_pars.p_tmsi or4b 'c000'O; + f_bssgp_client_llgmm_assign(g_pars.tlli_old, g_pars.tlli); +} + function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr { /* mandatory IE */ g_pars.ra := aa.routingAreaIdentification; @@ -286,8 +296,7 @@ setverdict(fail, "unexpected P-TMSI allocation"); self.stop; } -
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_gsup_lu_reject
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_attach_gsup_lu_reject .. sgsn: Add TC_attach_gsup_lu_reject Change-Id: Id36733e7e51b252407c7513d8441db9a555fd30d --- M sgsn/SGSN_Tests.ttcn 1 file changed, 45 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index bb97c64..490fbc2 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -423,7 +423,7 @@ testcase TC_attach_auth_sai_reject() runs on test_CT { var BSSGP_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 3); + vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 4); vc_conn.done; } @@ -458,9 +458,46 @@ var BSSGP_ConnHdlr vc_conn; f_init(); f_sleep(1.0); - vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb[0], 4); + vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb[0], 5); vc_conn.done; } + +/* HLR rejects UL REQ, expect ATTACH REJECT */ +private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdlr { + var BssgpDecoded bd; + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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)); + f_gmm_auth(); + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { + GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 0)); + } + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { + setverdict(pass); + } + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { + f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); + setverdict(fail); + } + } +} +testcase TC_attach_gsup_lu_reject() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_reject), testcasename(), g_gb[0], 6); + vc_conn.done; +} + /* Attempt of combined GPRS + IMSI attach: network should ACK only GPRS attach */ private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr { @@ -492,7 +529,7 @@ var BSSGP_ConnHdlr vc_conn; f_init(); f_sleep(1.0); - vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 5); + vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 7); vc_conn.done; } @@ -523,7 +560,7 @@ f_init(); f_sleep(1.0); f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all"); - vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 6); + vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 8); vc_conn.done; } @@ -560,10 +597,10 @@ 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 := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9); 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 := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 10); vc_conn.done; } @@ -591,7 +628,7 @@ var BSSGP_ConnHdlr vc_conn; f_init(); f_sleep(1.0); - vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb[0], 9); + vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb[0], 11); vc_conn.done; } @@ -604,6 +641,7 @@ execute( TC_attach_auth_sai_timeout() ); execute( TC_attach_auth_sai_reject() ); execute( TC_attach_gsup_lu_timeout() ); + execute( TC_attach_gsup_lu_reject() ); execute( TC_attach_combined() ); execute( TC_attach_accept_all() ); execute( TC_attach_closed() ); -- To view, visit https://gerrit.osmocom.org/6558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id36733e7e51b252407c7513d8441db9a555fd30d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_combined
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_attach_combined .. sgsn: Add TC_attach_combined Change-Id: I87700d89389f4adb60a056d139674bb5f5addf7b --- M sgsn/SGSN_Tests.ttcn 1 file changed, 33 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index fd5a664..d667482 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -387,6 +387,38 @@ vc_conn.done; } +/* Attempt of combined GPRS + IMSI attach: network should ACK only GPRS attach */ +private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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, true, false, omit, omit)); + f_gmm_auth(); + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); + BSSGP.send(ts_GMM_ATTACH_COMPL); + setverdict(pass); +} + +testcase TC_attach_combined() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 5); + vc_conn.done; +} + control { @@ -394,6 +426,7 @@ execute( TC_attach_auth_id_timeout() ); execute( TC_attach_auth_sai_timeout() ); execute( TC_attach_gsup_lu_timeout() ); + execute( TC_attach_combined() ); } -- To view, visit https://gerrit.osmocom.org/6549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I87700d89389f4adb60a056d139674bb5f5addf7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_rau: Attach followed by RA Update
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add new TC_attach_rau: Attach followed by RA Update .. sgsn: Add new TC_attach_rau: Attach followed by RA Update Change-Id: I8f71bf83f4e6504f1cfbdc55a57e3ed62b3e5f25 --- M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 90 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index b37ee25..5b6b481 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1514,6 +1514,45 @@ } } +template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?, + template RoutingAreaIdentificationV ra := ?, + template OCT4 ptmsi := *) := { + discriminator := '1000'B, + tiOrSkip := { + skipIndicator := ''B + }, + msgs := { + gprs_mm := { + routingAreaUpdateAccept := { + messageType := '1001'B, + forceToStandby := ?, + updateResult := { res, ? }, + raUpdateTimer := ?, + routingAreaId := ra, + ptmsiSignature := *, + allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), + msIdentity := *, + receiveNPDUNumbers := *, + readyTimer := *, + gmmCause := *, + t3302 := *, + cellNotification := *, + equivalentPLMNs := *, + pdpContextStatus := *, + networkFeatureSupport := *, + emergencyNumberList := *, + mBMS_ContextStatus := *, + requestedMSInformation := *, + t3319 := *, + t3323 := *, + t3312_ExtendedValue := *, + additionalNetworkFeatureSupport := *, + t3324 := *, + extendedDRXParameters := * + } + } + } +} template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { discriminator := ''B, /* overwritten */ diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a59bde3..9e00a13 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -311,6 +311,30 @@ /* T3302, T3319, T3323, T3312_ext, T3324 */ } +function f_process_rau_accept(PDU_GMM_RoutingAreaUpdateAccept ra) runs on BSSGP_ConnHdlr { + /* mandatory IE */ + g_pars.ra := ra.routingAreaId; + if (ispresent(ra.allocatedPTMSI)) { + if (not g_pars.net.expect_ptmsi) { + setverdict(fail, "unexpected P-TMSI allocation"); + self.stop; + } + f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); + } + if (ispresent(ra.msIdentity)) { + setverdict(fail, "unexpected TMSI allocation in non-combined attach"); + self.stop; + } + /* P-TMSI.sig */ + if (ispresent(ra.ptmsiSignature)) { + g_pars.p_tmsi_sig := ra.ptmsiSignature.valueField; + } + /* updateTimer */ + // aa.readyTimer + /* T3302, T3319, T3323, T3312_ext, T3324 */ +} + + function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV { return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); } @@ -584,6 +608,32 @@ vc_conn.done; } +private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr { + var BssgpDecoded bd; + + /* first perform regular attach */ + f_TC_attach(id); + + /* then send RAU */ + BSSGP.send(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit)); + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_ACCEPT)) -> value bd { + f_process_rau_accept(bd.l3_mt.msgs.gprs_mm.routingAreaUpdateAccept); + setverdict(pass); + } + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) { + setverdict(fail, "Unexpected RAU Reject"); + } + [] BSSGP.receive { repeat; } + } +} +testcase TC_attach_rau() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_rau), testcasename(), g_gb[0], 12); +
[MERGED] osmo-ttcn3-hacks[master]: First actual SGSN test case
Harald Welte has submitted this change and it was merged. Change subject: First actual SGSN test case .. First actual SGSN test case Change-Id: Id66ddf8dbe1c5cfa96a087235588ba67763b7f05 --- D gprs_gb/LLC_Types.ttcn M gprs_gb/Test.ttcn M gprs_gb/gen_links.sh M gprs_gb/regen_makefile.sh M library/BSSGP_Emulation.ttcn A library/LLC_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh M sgsn/regen_makefile.sh 9 files changed, 857 insertions(+), 301 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gprs_gb/LLC_Types.ttcn b/gprs_gb/LLC_Types.ttcn deleted file mode 100644 index 8ca8f39..000 --- a/gprs_gb/LLC_Types.ttcn +++ /dev/null @@ -1,165 +0,0 @@ -module LLC_Types { - import from General_Types all; - import from Osmocom_Types all; - - /* TS 44.064 Chapter 6.2 */ - type record LlcAddressField { - BIT1 pd ('0'B), - boolean c_r, - BIT2 reserved, - LlcSapi sapi - } with { - variant (c_r) "FIELDLENGTH(1)" - }; - - template LlcAddressField t_LLC_Addr(template boolean c_r, template LlcSapi sapi) := { - pd := '0'B, - c_r := c_r, - reserved := '00'B, - sapi := sapi - }; - - const boolean LLC_CR_DL_CMD := true; - const boolean LLC_CR_DL_RSP := false; - const boolean LLC_CR_UL_CMD := false; - const boolean LLC_CR_UL_RSP := true; - - template LlcAddressField t_LLC_Addr_DlCmd(template LlcSapi sapi) := t_LLC_Addr(true, sapi); - template LlcAddressField t_LLC_Addr_DlRsp(template LlcSapi sapi) := t_LLC_Addr(false, sapi); - template LlcAddressField t_LLC_Addr_UlCmd(template LlcSapi sapi) := t_LLC_Addr(false, sapi); - template LlcAddressField t_LLC_Addr_UlRsp(template LlcSapi sapi) := t_LLC_Addr(true, sapi); - - type enumerated LlcSapi { - LLC_SAPI_RESERVED_0 (''B), - LLC_SAPI_GMM('0001'B), - LLC_SAPI_TOM2 ('0010'B), - LLC_SAPI_LL3('0011'B), - LLC_SAPI_RESERVED_4 ('0100'B), - LLC_SAPI_LL5('0101'B), - LLC_SAPI_RESERVED_6 ('0110'B), - LLC_SAPI_SMS('0111'B), - LLC_SAPI_TOM8 ('1000'B), - LLC_SAPI_LL9('1001'B), - LLC_SAPI_RESERVED_10('1010'B), - LLC_SAPI_LL11 ('1011'B), - LLC_SAPI_RESERVED_12('1100'B), - LLC_SAPI_RESERVED_13('1101'B), - LLC_SAPI_RESERVED_14('1110'B), - LLC_SAPI_RESERVED_15(''B) - } with { variant "FIELDLENGTH(4)" }; - - /* TS 44.064 Chapter 6.3 */ - type record LlcCtrlFieldI { - BIT1 presence ('0'B), - boolean a, - BIT1 spare, - uint9_t n_s, - BIT1 spare2, - uint9_t n_r, - LlcCtrlS s - } with { variant - (a) "FIELDLENGTH(1)" - }; - - /* TS 44.064 Chapter 6.3 */ - type record LlcCtrlFieldS { - BIT2 presence ('10'B), - boolean a, - BIT2 spare, - uint9_t n_r, - LlcCtrlS s - } with { - variant (a) "FIELDLENGTH(1)" - }; - - /* TS 44.064 Chapter 6.3 */ - type record LlcCtrlFieldUI { - BIT3 presence ('110'B), - BIT2 spare, - uint9_t n_u, - boolean e, - boolean pm - } with { - variant (e) "FIELDLENGTH(1)" - variant (pm) "FIELDLENGTH(1)" - }; - - template LlcCtrlFieldUI t_LlcCtrlUI(template uint8_t n_u) := { - presence := '110'B, - spare := '00'B, - n_u := n_u, - e := false, - pm := true - }; - - /* TS 44.064 Chapter 6.3 */ - type record LlcCtrlFieldU { - BIT3 presence ('111'B), - boolean p_f, - LlcCtrlM m - } with { - variant (p_f) "FIELDLENGTH(1)" - }; - - - /* TS 44.064 Chapter 6.4 */ - type enumerated LlcCtrlS { - LLC_S_RR('00'B), - LLC_S_ACK ('01'B), - LLC_S_RNR ('10'B), - LLC_S_SACK ('11'B) - } with { variant "FIELDLENGTH(2)" }; - - /* TS 44.064 Chapter 6.4 */ - type enumerated LlcCtrlM { - LLC_M_DM('0001'B), - LLC_M_DISC ('0100'B), - LLC_M_UA('0110'B), - LLC_M_SABM ('0111'B), - LLC_M_FRMR ('1000'B), - LLC_M_XID ('1011'B), - LLC_M_NULL
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Integrate VTY access into SGSN_Tests
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Integrate VTY access into SGSN_Tests .. sgsn: Integrate VTY access into SGSN_Tests Change-Id: I661963368a285ab9358d7f4845b42dc70c35a553 --- M sgsn/SGSN_Tests.default M sgsn/SGSN_Tests.ttcn 2 files changed, 15 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index 6d8822b..256c9c9 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -4,7 +4,7 @@ [TESTPORT_PARAMETERS] *.SGSNVTY.CTRL_MODE := "client" *.SGSNVTY.CTRL_HOSTNAME := "127.0.0.1" -*.SGSNVTY.CTRL_PORTNUM := "4254" +*.SGSNVTY.CTRL_PORTNUM := "4245" *.SGSNVTY.CTRL_LOGIN_SKIPPED := "yes" *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index c147b84..3abff8c 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -18,6 +18,9 @@ import from GSUP_Types all; import from IPA_Emulation all; +import from TELNETasp_PortType all; +import from Osmocom_VTY_Functions all; + modulepar { /* IP/port on which we run our internal GSUP/HLR emulation */ charstring mp_hlr_ip := "127.0.0.1"; @@ -37,6 +40,8 @@ var IPA_Emulation_CT vc_GSUP_IPA; /* only to get events from IPA underneath GSUP */ port IPA_CTRL_PT GSUP_IPA_EVENT; + + port TELNETasp_PT SGSNVTY; var boolean g_initialized := false; }; @@ -111,6 +116,14 @@ } } +private function f_init_vty() runs on test_CT { + map(self:SGSNVTY, system:SGSNVTY); + f_vty_set_prompts(SGSNVTY); + f_vty_transceive(SGSNVTY, "enable"); + f_vty_config(SGSNVTY, "sgsn", "auth-policy remote"); +} + + function f_init() runs on test_CT { if (g_initialized == true) { return; @@ -132,6 +145,7 @@ f_init_gb(g_gb[0]); f_init_gsup("SGSN_Test"); + f_init_vty(); } type function void_fn(charstring id) runs on BSSGP_ConnHdlr; -- To view, visit https://gerrit.osmocom.org/6552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I661963368a285ab9358d7f4845b42dc70c35a553 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_i...
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_isd() .. sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_isd() Change-Id: I7a43eaa75201fc6c3afba67f6161aef872aca546 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 11 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 248a9c3..70e8124 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -247,6 +247,7 @@ } } +/* perform GMM authentication (if expected) */ function f_gmm_auth () runs on BSSGP_ConnHdlr { var BssgpDecoded bd; var PDU_L3_MS_SGSN l3_mo; @@ -314,6 +315,14 @@ } } +private function f_gmm_gsup_lu_isd() runs on BSSGP_ConnHdlr { + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); +} + private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; var RoutingAreaIdentificationV old_ra := f_random_RAI(); @@ -321,10 +330,7 @@ BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit)); f_gmm_auth(); /* Expect MSC to perform LU with HLR */ - GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); - GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); - GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + f_gmm_gsup_lu_isd(); BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); @@ -474,10 +480,7 @@ BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit)); f_gmm_auth(); /* Expect MSC to perform LU with HLR */ - GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); - GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); - GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + f_gmm_gsup_lu_isd(); BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); -- To view, visit https://gerrit.osmocom.org/6560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a43eaa75201fc6c3afba67f6161aef872aca546 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: move GTP_CodecPort from ggsn to library (for sgsn reuse)
Harald Welte has submitted this change and it was merged. Change subject: move GTP_CodecPort from ggsn to library (for sgsn reuse) .. move GTP_CodecPort from ggsn to library (for sgsn reuse) Change-Id: If1b25f3c4705fcf4763886b54c5ef1f7ae08628f --- M ggsn_tests/gen_links.sh R library/GTP_CodecPort.ttcn R library/GTP_CodecPort_CtrlFunct.ttcn R library/GTP_CodecPort_CtrlFunctDef.cc 4 files changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 1ab8009..c04d19e 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash BASEDIR=../deps @@ -48,5 +48,6 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn" +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn " +FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES diff --git a/ggsn_tests/GTP_CodecPort.ttcn b/library/GTP_CodecPort.ttcn similarity index 100% rename from ggsn_tests/GTP_CodecPort.ttcn rename to library/GTP_CodecPort.ttcn diff --git a/ggsn_tests/GTP_CodecPort_CtrlFunct.ttcn b/library/GTP_CodecPort_CtrlFunct.ttcn similarity index 100% rename from ggsn_tests/GTP_CodecPort_CtrlFunct.ttcn rename to library/GTP_CodecPort_CtrlFunct.ttcn diff --git a/ggsn_tests/GTP_CodecPort_CtrlFunctDef.cc b/library/GTP_CodecPort_CtrlFunctDef.cc similarity index 100% rename from ggsn_tests/GTP_CodecPort_CtrlFunctDef.cc rename to library/GTP_CodecPort_CtrlFunctDef.cc -- To view, visit https://gerrit.osmocom.org/6566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1b25f3c4705fcf4763886b54c5ef1f7ae08628f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_rau_unknown
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_rau_unknown .. sgsn: Add TC_rau_unknown Change-Id: If33fc690cedcc362c3cd5d7c1951440ecba328c2 --- M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 95 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 396a361..b37ee25 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1471,6 +1471,7 @@ mSNetworkCapability := omit, pdpContextStatus := omit, /* TODO */ pC_LCSCapability := omit, + mBMS_ContextStatus := omit, uENetworkCapability := omit, additionalMobileIdentity := omit, oldRoutingAreaIdentification2 := omit, @@ -1492,6 +1493,28 @@ } } +template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := { + discriminator := '1000'B, + tiOrSkip := { + skipIndicator := ''B + }, + msgs := { + gprs_mm := { + routingAreaUpdateReject := { + messageType := '1011'B, + gmmCause := { + causeValue := cause + }, + forceToStandby := ?, + spare := ''B, + t3302 := *, + t3346 := * + } + } + } +} + + template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { discriminator := ''B, /* overwritten */ tiOrSkip := { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index be1af57..7e1c48e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -66,6 +66,7 @@ hexstring msisdn, /* P-TMSI allocated to the simulated MS */ OCT4 p_tmsi optional, + OCT3 p_tmsi_sig optional, /* TLLI of the simulated MS */ OCT4 tlli, RoutingAreaIdentificationV ra optional, @@ -165,6 +166,7 @@ imsi := f_gen_imsi(imsi_suffix), msisdn := f_gen_msisdn(imsi_suffix), p_tmsi := omit, + p_tmsi_sig := omit, tlli := f_gprs_tlli_random(), ra := omit, bssgp_cell_id := gb.cfg.cell_id, @@ -211,14 +213,11 @@ } /* TODO: - * RAU without Attach * Detach without Attach * SM procedures without attach / RAU * ATTACH / RAU ** with / without authentication ** with / without P-TMSI allocation - ** timeout from HLR on SAI - ** timeout from HLR on UL ** reject from HLR on SAI ** reject from HLR on UL * re-transmissions of LLC frames @@ -278,11 +277,36 @@ deactivate(di); } +function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr { + /* mandatory IE */ + g_pars.ra := aa.routingAreaIdentification; + if (ispresent(aa.allocatedPTMSI)) { + if (not g_pars.net.expect_ptmsi) { + setverdict(fail, "unexpected P-TMSI allocation"); + self.stop; + } + g_pars.p_tmsi := aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets; + /* update TLLI? */ + } + if (ispresent(aa.msIdentity)) { + setverdict(fail, "unexpected TMSI allocation in non-combined attach"); + self.stop; + } + /* P-TMSI.sig */ + if (ispresent(aa.ptmsiSignature)) { + g_pars.p_tmsi_sig := aa.ptmsiSignature.valueField; + } + /* updateTimer */ + // aa.readyTimer + /* T3302, T3319, T3323, T3312_ext, T3324 */ +} + function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV { return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); } private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { + var BssgpDecoded bd; var MobileIdentityLV mi; var RoutingAreaIdentificationV old_ra := f_random_RAI(); @@ -300,7 +324,10 @@ GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); - BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { + f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); + } + /* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */ BSSGP.send(ts_GMM_ATTACH_COMPL); setverdict(pass); } @@
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_detach_* for various GPRS DETACH use cases
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_detach_* for various GPRS DETACH use cases .. sgsn: Add TC_detach_* for various GPRS DETACH use cases Change-Id: I2243b850400482b911d687585929a2eef3490954 --- M library/GSUP_Types.ttcn M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 165 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index fda9549..0a21999 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -286,6 +286,14 @@ tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); +template GSUP_PDU tr_GSUP_PURGE_MS_REQ(template hexstring imsi, template GSUP_CnDomain dom := ?) := + tr_GSUP(OSMO_GSUP_MSGT_PURGE_MS_REQUEST, { + tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE_CnDomain(dom) }); + +template (value) GSUP_PDU ts_GSUP_PURGE_MS_RES(hexstring imsi) := + ts_GSUP(OSMO_GSUP_MSGT_PURGE_MS_RESULT, { + valueof(ts_GSUP_IE_IMSI(imsi)) }); + template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := { tag := OSMO_GSUP_CANCEL_TYPE_IE, @@ -298,6 +306,9 @@ template GSUP_IE tr_GSUP_IE_CancelType(template GSUP_CancelType ctype) := tr_GSUP_IE(OSMO_GSUP_CANCEL_TYPE_IE, GSUP_IeValue:{cancel_type:=ctype}); +template GSUP_IE tr_GSUP_IE_CnDomain(template GSUP_CnDomain domain) := + tr_GSUP_IE(OSMO_GSUP_CN_DOMAIN_IE, GSUP_IeValue:{cn_domain:=domain}); + template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, len := ?, diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 5b6b481..9bd74db 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -65,10 +65,18 @@ } /* send template fro Mobile Identity (TMSI) */ -template MobileIdentityTLV ts_MI_TMSI_TLV(OCT4 tmsi) := { - elementIdentifier := '0100011'B, - spare1 := '0'B, - mobileIdentityLV := ts_MI_TMSI_LV(tmsi) +function ts_MI_TMSI_TLV(template (omit) OCT4 tmsi) return template (omit) MobileIdentityTLV { + var template (omit) MobileIdentityTLV ret; + if (istemplatekind(tmsi, "omit")) { + return omit; + } else { + ret := { + elementIdentifier := '0100011'B, + spare1 := '0'B, + mobileIdentityLV := ts_MI_TMSI_LV(valueof(tmsi)) + } + return ret; + } } template MobileIdentityTLV ts_MI_IMEISV_TLV(hexstring imeisv) := { @@ -1689,12 +1697,42 @@ const BIT3 c_GMM_DTT_MO_IMSI := '010'B; const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B; -template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt) := { +template (value) DetachTypeV ts_GMM_DetType(BIT3 dtt, boolean power_off := false) := { detachType := dtt, - powerOffFlag := '0'B + powerOffFlag := bool2bit(power_off) } -template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS) := { +function ts_PtmsiSigTV(template (omit) OCT3 val) return template (omit) P_TMSISignatureTV { + var template (omit) P_TMSISignatureTV ret; + if (istemplatekind(val, "omit")) { + return omit; + } else { + ret := { + elementIdentifier := '19'O, + valueField := valueof(val) + } + return ret; + } +} + +function ts_PtmsiSigTLV(template (omit) OCT3 val) return template (omit) P_TMSISignature2TLV { + var template (omit) P_TMSISignature2TLV ret; + if (istemplatekind(val, "omit")) { + return omit; + } else { + ret := { + elementIdentifier := '19'O, + lengthIndicator := 3, + valueField := valueof(val) + } + return ret; + } +} + +template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS, + boolean power_off := false, + template (omit) OCT4 p_tmsi := omit, + template (omit) OCT3 p_tmsi_sig := omit) := { discriminator := ''B, /* overwritten */ tiOrSkip := { skipIndicator := ''B @@ -1703,10 +1741,26 @@ gprs_mm := { detachRequest_MS_SGSN := { messageType := ''B, /* overwritten */ - detachType := valueof(ts_GMM_DetType(dtt)), + detachType := valueof(ts_GMM_DetType(dtt, power_off)), spare :=
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Use Random RAI when performing attach request
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Use Random RAI when performing attach request .. sgsn: Use Random RAI when performing attach request Change-Id: Id349c7cd0899d6b87114a3ece8bc2ee625f64116 --- M library/General_Types.ttcn M library/L3_Common.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 24 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn index aab0609..b404fe1 100644 --- a/library/General_Types.ttcn +++ b/library/General_Types.ttcn @@ -163,6 +163,7 @@ type hexstring HEX24n length(24) with { variant "" }; //hexstring with length interval + type hexstring HEX0_3n length(0..3) with { variant "" }; type hexstring HEX0_18n length(0..18) with { variant "" }; type hexstring HEX1_20n length(1..20) with { variant "" }; type hexstring HEX1_34n length(1..34) with { variant "" }; diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index a7c2eb2..19e52eb 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -2,6 +2,7 @@ import from Osmocom_Types all; import from General_Types all; +import from MobileL3_GMM_SM_Types all; type record AuthVector { OCT16 rand, @@ -66,6 +67,22 @@ return tlli or4b 'c000'O; } +function f_RAI(HEX0_3n mcc, HEX0_3n mnc, OCT2 lac, OCT1 rac) return RoutingAreaIdentificationV { + if (lengthof(mnc) == 2) { + mnc := mnc & 'F'H; + } + var RoutingAreaIdentificationV ret := { + mccDigit1 := mcc[0], + mccDigit2 := mcc[1], + mccDigit3 := mcc[2], + mncDigit3 := mnc[2], + mncDigit1 := mnc[0], + mncDigit2 := mnc[1], + lac := lac, + rac := rac + } + return ret; +} } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index cf354a7..bb97a68 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -247,9 +247,13 @@ deactivate(di); } +function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV { + return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); +} + private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { var MobileIdentityLV mi; - var RoutingAreaIdentificationV old_ra := { '2'H, '6'H, '2'H, 'F'H, '4'H, '2'H, '2342'O, '00'O }; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); if (ispresent(g_pars.p_tmsi)) { mi := valueof(ts_MI_TMSI_LV(g_pars.p_tmsi)); @@ -267,12 +271,7 @@ BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(?, ?, ?))); BSSGP.send(ts_GMM_ATTACH_COMPL); -/* - alt { - [] as_mm_identity(); - } -*/ - f_sleep(5.0); + setverdict(pass); } testcase TC_attach() runs on test_CT { -- To view, visit https://gerrit.osmocom.org/6546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id349c7cd0899d6b87114a3ece8bc2ee625f64116 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Introduce global guard timer
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Introduce global guard timer .. sgsn: Introduce global guard timer Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d --- M sgsn/SGSN_Tests.ttcn 1 file changed, 17 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index bb97a68..a326a83 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -43,6 +43,7 @@ type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr { var BSSGP_ConnHdlrPars g_pars; + timer g_Tguard; } type record SGSN_ConnHdlrNetworkPars { @@ -65,7 +66,8 @@ RoutingAreaIdentificationV ra optional, BssgpCellId bssgp_cell_id, AuthVector vec optional, - SGSN_ConnHdlrNetworkPars net + SGSN_ConnHdlrNetworkPars net, + float t_guard }; @@ -136,7 +138,8 @@ type function void_fn(charstring id) runs on BSSGP_ConnHdlr; /* helper function to create, connect and start a BSSGP_ConnHdlr component */ -function f_start_handler(void_fn fn, charstring id, GbInstance gb, integer imsi_suffix) +function f_start_handler(void_fn fn, charstring id, GbInstance gb, integer imsi_suffix, +float t_guard := 30.0) runs on test_CT return BSSGP_ConnHdlr { var BSSGP_ConnHdlr vc_conn; var SGSN_ConnHdlrNetworkPars net_pars := { @@ -153,7 +156,8 @@ ra := omit, bssgp_cell_id := gb.cfg.cell_id, vec := omit, - net := net_pars + net := net_pars, + t_guard := t_guard }; vc_conn := BSSGP_ConnHdlr.create(id); @@ -167,6 +171,13 @@ return vc_conn; } +private altstep as_Tguard() runs on BSSGP_ConnHdlr { + [] g_Tguard.timeout { + setverdict(fail, "Tguard timeout"); + self.stop; + } +} + /* first function called in every ConnHdlr */ private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars) runs on BSSGP_ConnHdlr { @@ -178,6 +189,9 @@ /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); + g_Tguard.start(pars.t_guard); + activate(as_Tguard()); + /* call the user-supplied test case function */ fn.apply(id); f_bssgp_client_unregister(g_pars.imsi); -- To view, visit https://gerrit.osmocom.org/6547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c1fd2a38a4f412079b5f28302b15124d9fd3b3d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Implement TLLI assignment/modification/unassignment
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b95b9e49f0a1db9659714c4d01f340fd44fafe8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Use random TLLI when performing ATTACH
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Use random TLLI when performing ATTACH .. sgsn: Use random TLLI when performing ATTACH Change-Id: If104add9a6d029b674e46e01af71f2e336aa35f0 --- M library/L3_Common.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 40 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 69ab51d..a7c2eb2 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -27,6 +27,45 @@ return vec; } +/* 3GPP TS 23.003 2.6 */ +type enumerated TlliType { + TLLI_LOCAL, + TLLI_FOREIGN, + TLLI_RANDOM, + TLLI_AUXILIARY, + TLLI_RESERVED, + TLLI_G_RNTI, + TLLI_RAND_G_RNTI +} + +/* 3GPP TS 23.003 2.6 */ +function f_gprs_tlli_type(OCT4 tlli) return TlliType { + var bitstring tllib := oct2bit(tlli); + if (substr(tllib, 0, 2) == '11'B) { + return TLLI_LOCAL; + } else if (substr(tllib, 0, 2) == '10'B) { + return TLLI_FOREIGN; + } else if (substr(tllib, 0, 5) == '0'B) { + return TLLI_RANDOM; + } else if (substr(tllib, 0, 4) == '0110'B) { + return TLLI_RESERVED; + } else if (substr(tllib, 0, 3) == '010'B) { + return TLLI_RESERVED; + } else if (substr(tllib, 0, 4) == ''B) { + return TLLI_G_RNTI; + } else if (substr(tllib, 0, 4) == '0001'B) { + return TLLI_RAND_G_RNTI; + } else { + setverdict(fail, "Unknonw TLLI Type ", tllib); + self.stop; + } +} + +function f_gprs_tlli_random() return OCT4 { + var OCT4 tlli := f_rnd_octstring(4); + return tlli or4b 'c000'O; +} + } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index c47403e..cf354a7 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -149,7 +149,7 @@ imsi := f_gen_imsi(imsi_suffix), msisdn := f_gen_msisdn(imsi_suffix), p_tmsi := omit, - tlli := ''O, + tlli := f_gprs_tlli_random(), ra := omit, bssgp_cell_id := gb.cfg.cell_id, vec := omit, -- To view, visit https://gerrit.osmocom.org/6545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If104add9a6d029b674e46e01af71f2e336aa35f0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_i...
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a43eaa75201fc6c3afba67f6161aef872aca546 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Ensure ATTACH is always only for GPRS, not combined
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Ensure ATTACH is always only for GPRS, not combined .. sgsn: Ensure ATTACH is always only for GPRS, not combined OsmoSGSN doesn't do combined GPRS+IMSI Attach. Change-Id: Ib11f5d720a0e4e1d574982d1f33ba9aaa6b3a3cf --- M sgsn/SGSN_Tests.ttcn 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d667482..c147b84 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -282,7 +282,7 @@ GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); - BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(?, ?, ?))); + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); BSSGP.send(ts_GMM_ATTACH_COMPL); setverdict(pass); } @@ -308,14 +308,14 @@ BSSGP.send(ts_GMM_ATTACH_REQ(mi, old_ra, false, false, omit, omit)); alt { - [] BSSGP.receive(tr_BD_L3(tr_GMM_ID_REQ(?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ID_REQ(?))) { /* don't send ID Response */ repeat; } - [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT('09'O))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('09'O))) { setverdict(pass); } - [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(fail, "Wrong Attach Reject Cause"); } } @@ -344,7 +344,7 @@ [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { } } /* don't send SAI-response from HLR */ - BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))); + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))); setverdict(pass); } testcase TC_attach_auth_sai_timeout() runs on test_CT { @@ -371,10 +371,10 @@ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); /* Never follow-up with ISD_REQ or UL_RES */ alt { - [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(pass); } - [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT(?, ?, ?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) { setverdict(fail); } } @@ -406,7 +406,7 @@ GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); - BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); BSSGP.send(ts_GMM_ATTACH_COMPL); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib11f5d720a0e4e1d574982d1f33ba9aaa6b3a3cf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_accept_all for "auth-policy accept-all"
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_attach_accept_all for "auth-policy accept-all" .. sgsn: Add TC_attach_accept_all for "auth-policy accept-all" Change-Id: I9501595126abf15c9e8b25f06897cf62ab99d8f2 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 32 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 3abff8c..134193c 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -270,7 +270,11 @@ valueof(ts_MI_IMEISV_TLV(g_pars.imei & '0'H)); } BSSGP.send(l3_mo); + } else { + /* wait for identity procedure */ + f_sleep(1.0); } + deactivate(di); } @@ -433,6 +437,33 @@ vc_conn.done; } +/* Attempt of GPRS ATTACH in 'accept all' mode */ +private function f_TC_attach_accept_all(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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)); + f_gmm_auth(); + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))); + BSSGP.send(ts_GMM_ATTACH_COMPL); + setverdict(pass); +} +testcase TC_attach_accept_all() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all"); + vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 6); + vc_conn.done; +} control { @@ -441,6 +472,7 @@ execute( TC_attach_auth_sai_timeout() ); execute( TC_attach_gsup_lu_timeout() ); execute( TC_attach_combined() ); + execute( TC_attach_accept_all() ); } -- To view, visit https://gerrit.osmocom.org/6553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9501595126abf15c9e8b25f06897cf62ab99d8f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Add TC_detach_* for various GPRS DETACH use cases
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2243b850400482b911d687585929a2eef3490954 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add new TC_attach_rau: Attach followed by RA Update
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f71bf83f4e6504f1cfbdc55a57e3ed62b3e5f25 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: Implement TC_attach_auth_sai_reject
Harald Welte has submitted this change and it was merged. Change subject: Implement TC_attach_auth_sai_reject .. Implement TC_attach_auth_sai_reject Change-Id: I8a27c26bb2b6372faccd34c48a597a57783a924f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 29 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 7e1c48e..bb97c64 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -399,6 +399,34 @@ vc_conn.done; } +/* HLR rejects SAI, expect ATTACH REJECT */ +private function f_TC_attach_auth_sai_reject(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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(); + [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { + GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 23)); + } + } + BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))); + setverdict(pass); +} +testcase TC_attach_auth_sai_reject() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 3); + vc_conn.done; +} + /* HLR never responds to UL REQ, expect ATTACH REJECT */ private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; @@ -574,6 +602,7 @@ execute( TC_attach() ); execute( TC_attach_auth_id_timeout() ); execute( TC_attach_auth_sai_timeout() ); + execute( TC_attach_auth_sai_reject() ); execute( TC_attach_gsup_lu_timeout() ); execute( TC_attach_combined() ); execute( TC_attach_accept_all() ); -- To view, visit https://gerrit.osmocom.org/6557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a27c26bb2b6372faccd34c48a597a57783a924f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: TC_attach_*_timeout test cases
Harald Welte has submitted this change and it was merged. Change subject: sgsn: TC_attach_*_timeout test cases .. sgsn: TC_attach_*_timeout test cases Change-Id: If8cd9e4387588e8299b7675b8b57392d7da66bd9 --- M library/L3_Templates.ttcn M sgsn/SGSN_Tests.ttcn 2 files changed, 117 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 0d1c229..396a361 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1408,6 +1408,26 @@ } } +template PDU_L3_SGSN_MS tr_GMM_ATTACH_REJECT(template OCT1 cause) := { + discriminator := '1000'B, + tiOrSkip := { + skipIndicator := ''B + }, + msgs := { + gprs_mm := { + attachReject := { + messageType := '0100'B, + gmmCause := { + causeValue := cause + }, + t3302 := *, + t3346 := * + } + } + } +} + + template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := { discriminator := ''B, /* overwritten */ tiOrSkip := { diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a326a83..fd5a664 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -70,7 +70,6 @@ float t_guard }; - private function f_init_gb(inout GbInstance gb) runs on test_CT { gb.vc_NS := NS_CT.create; gb.vc_BSSGP := BSSGP_CT.create; @@ -296,9 +295,105 @@ vc_conn.done; } +/* MS never responds to ID REQ, expect ATTACH REJECT */ +private function f_TC_attach_auth_id_timeout(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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 { + [] BSSGP.receive(tr_BD_L3(tr_GMM_ID_REQ(?))) { + /* don't send ID Response */ + repeat; + } + [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT('09'O))) { + setverdict(pass); + } + [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))) { + setverdict(fail, "Wrong Attach Reject Cause"); + } + } +} +testcase TC_attach_auth_id_timeout() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_auth_id_timeout), testcasename(), g_gb[0], 2, 40.0); + vc_conn.done; +} + +/* HLR never responds to SAI REQ, expect ATTACH REJECT */ +private function f_TC_attach_auth_sai_timeout(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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(); + [] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { } + } + /* don't send SAI-response from HLR */ + BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))); + setverdict(pass); +} +testcase TC_attach_auth_sai_timeout() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_timeout), testcasename(), g_gb[0], 3); + vc_conn.done; +} + +/* HLR never responds to UL REQ, expect ATTACH REJECT */ +private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHdlr { + var MobileIdentityLV mi; + var RoutingAreaIdentificationV old_ra := f_random_RAI(); + + 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)); + f_gmm_auth(); + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + /* Never follow-up with ISD_REQ or UL_RES */ + alt { + [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))) { + setverdict(pass); + } + [] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT(?, ?, ?))) { + setverdict(fail); + } + } +} +testcase TC_attach_gsup_lu_timeout() runs on test_CT { + var
osmo-ttcn3-hacks[master]: move GTP_CodecPort from ggsn to library (for sgsn reuse)
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1b25f3c4705fcf4763886b54c5ef1f7ae08628f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions
Harald Welte has submitted this change and it was merged. Change subject: move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions .. move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c --- M library/Osmocom_VTY_Functions.ttcn M msc/MSC_Tests.ttcn A sgsn/SGSN_Tests.default 3 files changed, 39 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index eb51a03..a375df6 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -109,4 +109,16 @@ f_vty_transceive(pt, "timeslot " & int2str(ts)); } +function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) +{ + /* enter config mode; enter node */ + f_vty_enter_config(pt); + f_vty_transceive(pt, config_node); + /* execute command */ + f_vty_transceive(pt, cmd); + /* leave config mode */ + f_vty_transceive(pt, "end"); +} + + } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index c46ec80..c9cd8d7 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -381,17 +381,6 @@ return vc_conn; } -function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) -{ - /* enter config mode; enter node */ - f_vty_enter_config(pt); - f_vty_transceive(pt, config_node); - /* execute command */ - f_vty_transceive(pt, cmd); - /* leave config mode */ - f_vty_transceive(pt, "end"); -} - private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); f_perform_lu(true); diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default new file mode 100644 index 000..6d8822b --- /dev/null +++ b/sgsn/SGSN_Tests.default @@ -0,0 +1,27 @@ +[LOGGING] +"IPA-CTRL-IPA".FileMask := ERROR | WARNING; + +[TESTPORT_PARAMETERS] +*.SGSNVTY.CTRL_MODE := "client" +*.SGSNVTY.CTRL_HOSTNAME := "127.0.0.1" +*.SGSNVTY.CTRL_PORTNUM := "4254" +*.SGSNVTY.CTRL_LOGIN_SKIPPED := "yes" +*.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" +*.SGSNVTY.CTRL_READMODE := "buffered" +*.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SGSNVTY.PROMPT1 := "OsmoSGSN> " + + +[MODULE_PARAMETERS] +#NS_Emulation.mp_local_ip := "192.168.100.239" +NS_Emulation.mp_local_udp_port := 21000 +#NS_Emulation.mp_remote_ip := "192.168.100.196" +NS_Emulation.mp_remote_udp_port := 23000 +NS_Emulation.mp_nsvci := 97 +NS_Emulation.mp_nsei := 96 +Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoSGSN"; + +[MAIN_CONTROLLER] + +[EXECUTE] +SGSN_Tests.control -- To view, visit https://gerrit.osmocom.org/6551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
[MERGED] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_closed for "auth-policy closed"
Harald Welte has submitted this change and it was merged. Change subject: sgsn: Add TC_attach_closed for "auth-policy closed" .. sgsn: Add TC_attach_closed for "auth-policy closed" Change-Id: Ic8aa77d1825fa2e39a09c3f0f0918ef24a3b3f7b --- M sgsn/SGSN_Tests.ttcn 1 file changed, 42 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified 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 @@ 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 @@ execute( TC_attach_gsup_lu_timeout() ); execute( TC_attach_combined() ); execute( TC_attach_accept_all() ); + execute( TC_attach_closed() ); } -- To view, visit https://gerrit.osmocom.org/6554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8aa77d1825fa2e39a09c3f0f0918ef24a3b3f7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Ensure ATTACH is always only for GPRS, not combined
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib11f5d720a0e4e1d574982d1f33ba9aaa6b3a3cf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_accept_all for "auth-policy accept-all"
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9501595126abf15c9e8b25f06897cf62ab99d8f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_closed for "auth-policy closed"
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8aa77d1825fa2e39a09c3f0f0918ef24a3b3f7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_gsup_lu_reject
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36733e7e51b252407c7513d8441db9a555fd30d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: BSSGP/LLC: Fix LLCC SAPI for SM
Harald Welte has submitted this change and it was merged. Change subject: BSSGP/LLC: Fix LLCC SAPI for SM .. BSSGP/LLC: Fix LLCC SAPI for SM While in TS 24.007 there is a separate L3 SAPI for GMM and SM, this only applies to messages sent over LAPDm, and not LLC. In LLC, both GMM and SM are sent via the same LLGMM LLC-SAPI. Change-Id: I7814c952cd7f603b190d396aaa0570571bfc --- M library/BSSGP_Emulation.ttcn M library/LLC_Templates.ttcn 2 files changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index fb3f7d4..1ced242 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -562,7 +562,7 @@ if (ischosen(l3_mo.msgs.gprs_mm)) { return c_LLC_SAPI_LLGMM; } else if (ischosen(l3_mo.msgs.gprs_sm)) { - return c_LLC_SAPI_LLSM; + return c_LLC_SAPI_LLGMM; } else if (ischosen(l3_mo.msgs.sms)) { return c_LLC_SAPI_LLSMS; } @@ -574,7 +574,7 @@ if (ischosen(l3_mt.msgs.gprs_mm)) { return c_LLC_SAPI_LLGMM; } else if (ischosen(l3_mt.msgs.gprs_sm)) { - return c_LLC_SAPI_LLSM; + return c_LLC_SAPI_LLGMM; } else if (ischosen(l3_mt.msgs.sms)) { return c_LLC_SAPI_LLSMS; } diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index e387b36..cfe97f8 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -58,7 +58,6 @@ const BIT4 c_LLC_SAPI_LLSMS := '0111'B; const BIT4 c_LLC_SAPI_TOM8 := '1000'B; const BIT4 c_LLC_SAPI_LL9 := '1001'B; -const BIT4 c_LLC_SAPI_LLSM := '1010'B; const BIT4 c_LLC_SAPI_LL11 := '1011'B; const BIT1 LLC_CR_DL_CMD := '1'B; @@ -67,7 +66,7 @@ const BIT1 LLC_CR_UL_RSP := '1'B; /* LLC UI frame with SAPI for L3 payload */ -template PDU_LLC tr_LLC_UI_L3 := ( tr_LLC_UI(?, c_LLC_SAPI_LLGMM), tr_LLC_UI(?, c_LLC_SAPI_LLSM) ); +template PDU_LLC tr_LLC_UI_L3 := ( tr_LLC_UI(?, c_LLC_SAPI_LLGMM) ); } -- To view, visit https://gerrit.osmocom.org/6565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7814c952cd7f603b190d396aaa0570571bfc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder
osmo-ttcn3-hacks[master]: sgsn: Reduce code duplication by introducing f_mi_get_lv()
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b970049074f5de9051a5a791278cd5d29f9d5ed Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_rau_unknown
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If33fc690cedcc362c3cd5d7c1951440ecba328c2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[MERGED] osmo-ttcn3-hacks[master]: ggsn: Move GTP templates to separate GTP_Templates + Add GTP...
Harald Welte has submitted this change and it was merged. Change subject: ggsn: Move GTP templates to separate GTP_Templates + Add GTP_Emulation .. ggsn: Move GTP templates to separate GTP_Templates + Add GTP_Emulation Change-Id: I384e59738a9e0fc0186b69f0806f217a2a8d8a4b --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh A library/GTP_Emulation.ttcn A library/GTP_Templates.ttcn 4 files changed, 777 insertions(+), 510 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 28f461c..f320c20 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -6,6 +6,7 @@ import from IPL4asp_Types all; import from GTP_CodecPort all; import from GTP_CodecPort_CtrlFunct all; + import from GTP_Templates all; import from GTPC_Types all; import from GTPU_Types all; import from IPCP_Types all; @@ -93,515 +94,6 @@ g_restart_ctr := f_rnd_octstring(1); g_c_seq_nr := f_rnd_int(65535); g_d_seq_nr := f_rnd_int(65535); - } - - /* generalized GTP-C receive template */ - template PDU_GTPC tr_GTP1C_PDU(template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdu := ?) := { - /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an -* error if this flag is set to '1'. */ - pn_bit := '0'B, - /* Sequence number flag (S) shall be set to '1'. */ - s_bit := '1'B, - e_bit := ?, - spare := ?, - /* Protocol Type flag (PT) shall be set to '1'.*/ - pt := '1'B, - /* Version shall be set to decimal 1 ('001'). */ - version := '001'B, - messageType := msg_type, - lengthf := ?, - teid := teid, - opt_part := *, - gtpc_pdu := pdu - } - - /* generalized GTP-C send template */ - template PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { - /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an -* error if this flag is set to '1'. */ - pn_bit := '0'B, - /* Sequence number flag (S) shall be set to '1'. */ - s_bit := '1'B, - e_bit := '0'B, - spare := '0'B, - /* Protocol Type flag (PT) shall be set to '1'.*/ - pt := '1'B, - /* Version shall be set to decimal 1 ('001'). */ - version := '001'B, - messageType := msg_type, - lengthf := 0, /* we assume encoder overwrites this */ - teid := teid, - opt_part := { - sequenceNumber := int2oct(seq_nr, 2), - npduNumber := '00'O, - nextExtHeader := '00'O, - gTPC_extensionHeader_List := omit - }, - gtpc_pdu := pdu - } - - /* recovery IE */ - template Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { - type_gtpc := '0E'O, - restartCounter := restart_counter - } - - template Recovery_gtpc tr_Recovery(template OCT1 restart_counter) := { - type_gtpc := '0E'O, - restartCounter := restart_counter - } - - /* template matching reception of GTP-C echo-request */ - template Gtp1cUnitdata tr_GTPC_MsgType(template GtpPeer peer, template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdus := ?) := { - peer := peer, - gtpc := tr_GTP1C_PDU(msg_type, teid, pdus) - } - - /* template matching reception of GTP-C echo-request */ - template Gtp1cUnitdata tr_GTPC_PING(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoRequest, ''O); - - template GTPC_PDUs tr_EchoRespPDU(template OCT1 restart_counter) := { - echoResponse := { - recovery := tr_Recovery(restart_counter), - private_extension_gtpc := * - } - } - - /* template matching reception of GTP-C echo-response */ - template Gtp1cUnitdata tr_GTPC_PONG(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoResponse, ''O, tr_EchoRespPDU(?)); - - template GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { - echoResponse := { - recovery := ts_Recovery(restart_counter), - private_extension_gtpc := omit - } - } - - /* master template for senidng a GTP-C echo response */ - template Gtp1cUnitdata ts_GTPC_PONG(GtpPeer peer, uint16_t seq, OCT1
osmo-ttcn3-hacks[master]: BSSGP/LLC: Fix LLCC SAPI for SM
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7814c952cd7f603b190d396aaa0570571bfc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: ggsn: Move GTP templates to separate GTP_Templates + Add GTP...
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I384e59738a9e0fc0186b69f0806f217a2a8d8a4b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_combined
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87700d89389f4adb60a056d139674bb5f5addf7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: Implement TC_attach_auth_sai_reject
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a27c26bb2b6372faccd34c48a597a57783a924f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: sgsn: Integrate VTY access into SGSN_Tests
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I661963368a285ab9358d7f4845b42dc70c35a553 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
osmo-ttcn3-hacks[master]: First actual SGSN test case
Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id66ddf8dbe1c5cfa96a087235588ba67763b7f05 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald WelteGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No