pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38591?usp=email )
Change subject: hnbgw: Move gtp_pars to Connhdlr ......................................................................
hnbgw: Move gtp_pars to Connhdlr
Change-Id: I40f723256b592d0d9141dfd192a1623a4804b4ea --- M hnbgw/ConnHdlr.ttcn M hnbgw/HNBGW_Tests.ttcn 2 files changed, 64 insertions(+), 67 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/38591/1
diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn index adbfcae..46cd6f2 100644 --- a/hnbgw/ConnHdlr.ttcn +++ b/hnbgw/ConnHdlr.ttcn @@ -146,6 +146,53 @@ got_osmux_count := 0 }
+type record FTeid { + HostName addr, + OCT4 teid +} + +type record FTeids { + FTeid local, + FTeid remote +} + +/* 'local' and 'remote' refer to the GTP information from the UPF's point of view: + * HNB UPF CN + * access.remote <---> access.local | core.local <---> core.remote + */ +type record GtpParameters { + FTeids core, + FTeids access +} + +/* HNB UPF CN + * access.remote <---> access.local | core.local <---> core.remote + * 127.0.0.4 127.0.0.3 127.0.0.2 127.0.0.1 + * 0x44004400 0x30303030 0x22002200 0x10101010 + */ +template (value) GtpParameters t_GtpParams := { + core := { + local := { + addr := "127.0.0.2", + teid := '22002200'O + }, + remote := { + addr := "127.0.0.1", + teid := '10101010'O + } + }, + access := { + local := { + addr := "127.0.0.3", + teid := '30303030'O + }, + remote := { + addr := "127.0.0.4", + teid := '44004400'O + } + } +} + type record HnbConfig { LocationAreaIdentification lai, integer sac @@ -159,6 +206,7 @@ hexstring imsi, boolean ps_domain, MgcpParameters mgcp_pars, + GtpParameters gtp_pars, HnbConfig hnb optional, boolean expect_separate_sccp_cr, integer tx_sccp_cr_data_len, @@ -193,6 +241,7 @@ imsi := f_gen_imsi(imsi_suffix), ps_domain := ps_domain, mgcp_pars := t_MgcpParams, + gtp_pars := t_GtpParams, hnb := omit, /* filled in later */ expect_separate_sccp_cr := expect_separate_sccp_cr, tx_sccp_cr_data_len := tx_sccp_cr_data_len, diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 3d0907a..a4c9703 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -1379,54 +1379,6 @@ f_shutdown_helper(); }
-type record FTeid { - HostName addr, - OCT4 teid -} - -type record FTeids { - FTeid local, - FTeid remote -} - - -/* 'local' and 'remote' refer to the GTP information from the UPF's point of view: - * HNB UPF CN - * access.remote <---> access.local | core.local <---> core.remote - */ -type record GtpParameters { - FTeids core, - FTeids access -} - -/* HNB UPF CN - * access.remote <---> access.local | core.local <---> core.remote - * 127.0.0.4 127.0.0.3 127.0.0.2 127.0.0.1 - * 0x44004400 0x30303030 0x22002200 0x10101010 - */ -template GtpParameters t_GtpParameters := { - core := { - local := { - addr := "127.0.0.2", - teid := '22002200'O - }, - remote := { - addr := "127.0.0.1", - teid := '10101010'O - } - }, - access := { - local := { - addr := "127.0.0.3", - teid := '30303030'O - }, - remote := { - addr := "127.0.0.4", - teid := '44004400'O - } - } -} - friend function f_tc_ps_rab_assignment_with_pfcp(charstring id) runs on ConnHdlr { const OCT8 c_SEID0 := '0000000000000000'O; const OCT8 c_SEID1 := '1111111111111111'O; @@ -1453,11 +1405,9 @@ tx := f_build_initial_ue(g_pars); f_iuh2iu_connect(tx);
- var GtpParameters gtp_pars := valueof(t_GtpParameters); - var template RAB_SetupOrModifyList rab_sml; - /* Send RAB Assignment Request */ - rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.remote.addr), gtp_pars.core.remote.teid); + var template RAB_SetupOrModifyList rab_sml; + rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.core.remote.addr), g_pars.gtp_pars.core.remote.teid); tx := valueof(ts_RANAP_RabAssReq(rab_sml)); BSSAP.send(tx);
@@ -1474,10 +1424,10 @@ /* Acting as UPF, invent a new PFCP SEID to send to HNBGW. Respond to the Session Establishment. * The PFCP response must have the same sequence_number as the request. */ var template F_SEID up_f_seid := ts_PFCP_F_SEID_ipv4(f_inet_addr("127.0.0.1"), c_SEID1); - var template F_TEID f_teid1 := ts_PFCP_F_TEID_ipv4(gtp_pars.core.local.teid, - f_inet_addr(gtp_pars.core.local.addr)); - var template F_TEID f_teid2 := ts_PFCP_F_TEID_ipv4(gtp_pars.access.local.teid, - f_inet_addr(gtp_pars.access.local.addr)); + var template F_TEID f_teid1 := ts_PFCP_F_TEID_ipv4(g_pars.gtp_pars.core.local.teid, + f_inet_addr(g_pars.gtp_pars.core.local.addr)); + var template F_TEID f_teid2 := ts_PFCP_F_TEID_ipv4(g_pars.gtp_pars.access.local.teid, + f_inet_addr(g_pars.gtp_pars.access.local.addr)); var template Created_PDR pdr1 := ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[0].grouped_ie.pdr_id, local_F_TEID := f_teid1); var template Created_PDR pdr2 := ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[1].grouped_ie.pdr_id, @@ -1490,15 +1440,15 @@ PFCP.send(r);
/* Expect on Iuh: RAB Assignment Request with IP/port from PFCP Session Est Resp */ - rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.local.addr), - gtp_pars.access.local.teid); + rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.access.local.addr), + g_pars.gtp_pars.access.local.teid); rx := valueof(ts_RANAP_RabAssReq(rab_sml)); f_rua_expect(rx);
/* Send back RAB Assignment Response via Iuh */ var template RAB_SetupOrModifiedList rab_smdl; - rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.remote.addr), - gtp_pars.access.remote.teid); + rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.access.remote.addr), + g_pars.gtp_pars.access.remote.teid); tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); RUA.send(tx);
@@ -1506,7 +1456,7 @@ r := ts_PFCP_Session_Mod_Resp(m.sequence_number, hnbgw_f_seid.seid); PFCP.send(r);
- rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.local.addr), gtp_pars.core.local.teid); + rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.core.local.addr), g_pars.gtp_pars.core.local.teid); f_bssap_expect(tr_RANAP_RabAssResp(rab_smdl));
f_sleep(2.0); @@ -1550,11 +1500,9 @@ tx := f_build_initial_ue(g_pars); f_iuh2iu_connect(tx);
- var GtpParameters gtp_pars := valueof(t_GtpParameters); - var template RAB_SetupOrModifyList rab_sml; - /* Send RAB Assignment Request */ - rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.remote.addr), gtp_pars.core.remote.teid); + var template RAB_SetupOrModifyList rab_sml; + rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.core.remote.addr), g_pars.gtp_pars.core.remote.teid); tx := valueof(ts_RANAP_RabAssReq(rab_sml)); BSSAP.send(tx);
@@ -1564,8 +1512,8 @@
/* Send back RAB Assignment Response via Iuh */ var template RAB_SetupOrModifiedList rab_smdl; - rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.remote.addr), - gtp_pars.access.remote.teid); + rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(g_pars.gtp_pars.access.remote.addr), + g_pars.gtp_pars.access.remote.teid); tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); RUA.send(tx);