laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38060?usp=email )
Change subject: upf: remove unused port PFCP from test_CT
......................................................................
upf: remove unused port PFCP from test_CT
Change-Id: Iba31a6aaa9a9ec854ba36956d1b853dcf66a804d
---
M upf/UPF_Tests.ttcn
1 file changed, 0 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/upf/UPF_Tests.ttcn b/upf/UPF_Tests.ttcn
index 37af9b3..b92701f 100644
--- a/upf/UPF_Tests.ttcn
+++ b/upf/UPF_Tests.ttcn
@@ -52,8 +52,6 @@
}
type component test_CT extends CTRL_Adapter_CT {
- port PFCPEM_PT PFCP;
-
port TELNETasp_PT UPFVTY;
/* global test case guard timer (actual timeout value is set in f_init()) */
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38060?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iba31a6aaa9a9ec854ba36956d1b853dcf66a804d
Gerrit-Change-Number: 38060
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38032?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: library/PFCP_Emulation: look up by SeqNr and SEID separately
......................................................................
library/PFCP_Emulation: look up by SeqNr and SEID separately
This allows routing of PFCP PDUs without SEID by SeqNr.
An example of such a PDU is the Heartbeat Request.
Change-Id: Ic7912d944e94852a587993708d51439ec90f08cd
---
M library/PFCP_Emulation.ttcn
1 file changed, 27 insertions(+), 7 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/library/PFCP_Emulation.ttcn b/library/PFCP_Emulation.ttcn
index 9cd9a86..74f4cdd 100644
--- a/library/PFCP_Emulation.ttcn
+++ b/library/PFCP_Emulation.ttcn
@@ -74,13 +74,20 @@
type record of PFCPEM_conn PFCPEM_conns;
-private function f_PFCPEM_conn_by_seid_or_seqnr(OCT8 seid, LIN3_BO_LAST seqnr) runs on PFCP_Emulation_CT return PFCP_ConnHdlr {
- log("looking for seid ", seid, " seqnr ", seqnr, " in conns ", g_conns);
+private function f_PFCPEM_conn_by_seqnr(LIN3_BO_LAST seqnr)
+runs on PFCP_Emulation_CT return PFCP_ConnHdlr {
for (var integer i := 0; i < lengthof(g_conns); i := i + 1) {
if (isbound(g_conns[i].pfcp_msg_sequence_number)
and seqnr == g_conns[i].pfcp_msg_sequence_number) {
return g_conns[i].vc_conn;
}
+ }
+ return null;
+};
+
+private function f_PFCPEM_conn_by_seid(OCT8 seid)
+runs on PFCP_Emulation_CT return PFCP_ConnHdlr {
+ for (var integer i := 0; i < lengthof(g_conns); i := i + 1) {
if (isbound(g_conns[i].seid)
and seid == g_conns[i].seid) {
return g_conns[i].vc_conn;
@@ -89,6 +96,23 @@
return null;
};
+private function f_PFCPEM_conn_for_pdu(in PDU_PFCP pdu)
+runs on PFCP_Emulation_CT return PFCP_ConnHdlr {
+ var PFCP_ConnHdlr vc_conn := null;
+
+ vc_conn := f_PFCPEM_conn_by_seqnr(pdu.sequence_number);
+ if (vc_conn != null) {
+ return vc_conn;
+ }
+
+ /* If there is a SEID, we can look it up */
+ if (pdu.s_flag == '1'B) {
+ vc_conn := f_PFCPEM_conn_by_seid(pdu.seid);
+ }
+
+ return vc_conn;
+};
+
private function f_PFCPEM_add_conn(PFCP_ConnHdlr vc_conn) runs on PFCP_Emulation_CT {
for (var integer i := 0; i < lengthof(g_conns); i := i + 1) {
if (g_conns[i].vc_conn == vc_conn) {
@@ -134,11 +158,7 @@
[] PFCP.receive(tr_PFCP_UD(?)) -> value ud {
log("PFCP_Emulation main() PFCP.receive: ", ud);
- vc_conn := null;
- if (ud.pdu.s_flag == '1'B) {
- /* There is a SEID */
- vc_conn := f_PFCPEM_conn_by_seid_or_seqnr(ud.pdu.seid, ud.pdu.sequence_number);
- }
+ vc_conn := f_PFCPEM_conn_for_pdu(ud.pdu);
if (vc_conn != null) {
log("found destination ", vc_conn);
CLIENT.send(ud.pdu) to vc_conn;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38032?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic7912d944e94852a587993708d51439ec90f08cd
Gerrit-Change-Number: 38032
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38031?usp=email )
Change subject: hnbgw: move vc_PFCP from ConnHdlr to test_CT
......................................................................
hnbgw: move vc_PFCP from ConnHdlr to test_CT
A logical relation between the PFCP emulation component (acting as
the UP function) and its ConnHdlr components is one-to-many. It's
unusual for the ConnHdlr components to have their own emulation
component, especially when a testcase spawns many of them. This
renders the dispatch function of the PFCP emulation component useless.
The HNBGW testsuite, which is using the PFCP emulation, does not
spawn more than one ConnHdlr component, so there was no problem
with that so far. Let's move the PFCP emulation to test_CT, in
order to allow spawning more than one ConnHdlr and to make the
component hierarchy less confusing.
Change-Id: Iaf7a54c674f2dc549572d918beb6f355f48ee700
---
M hnbgw/HNBGW_Tests.ttcn
M library/PFCP_Emulation.ttcn
2 files changed, 9 insertions(+), 6 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 3765411..5204f38 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -350,6 +350,7 @@
var MGCP_Emulation_CT vc_MGCP;
port TELNETasp_PT HNBGWVTY;
var StatsD_Checker_CT vc_STATSD;
+ var PFCP_Emulation_CT vc_PFCP;
/* global test case guard timer (actual timeout value is set in f_init()) */
timer T_guard := 30.0;
@@ -397,7 +398,7 @@
vc_MGCP.start(MGCP_Emulation.main(ops, pars, id));
}
-function f_init_pfcp(charstring id) runs on ConnHdlr {
+function f_init_pfcp(charstring id) runs on test_CT {
id := id & "-PFCP";
var PFCP_Emulation_Cfg pfcp_cfg := {
@@ -409,8 +410,6 @@
};
vc_PFCP := PFCP_Emulation_CT.create(id) alive;
- connect(self:PFCP, vc_PFCP:CLIENT);
- connect(self:PFCP_PROC, vc_PFCP:CLIENT_PROC);
vc_PFCP.start(PFCP_Emulation.main(pfcp_cfg));
}
@@ -622,6 +621,11 @@
connect(vc_conn:STATSD_PROC, vc_STATSD:STATSD_PROC);
+ if (isbound(vc_PFCP)) {
+ connect(vc_conn:PFCP, vc_PFCP:CLIENT);
+ connect(vc_conn:PFCP_PROC, vc_PFCP:CLIENT_PROC);
+ }
+
return vc_conn;
}
@@ -651,8 +655,6 @@
/* make parameters available via component variable */
g_pars := pars;
- f_init_pfcp(testcasename());
-
/* start guard timer and activate it as default */
g_Tguard.start(t_guard);
activate(as_Tguard_ConnHdlr());
@@ -2030,6 +2032,7 @@
var ConnHdlr vc_conn;
g_num_hnbs := 1;
f_init();
+ f_init_pfcp(testcasename());
f_sleep(1.0);
vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment_with_pfcp), t_pars(7, ps_domain := true));
@@ -2093,6 +2096,7 @@
testcase TC_ps_rab_assignment_without_pfcp() runs on test_CT {
var ConnHdlr vc_conn;
f_init();
+ f_init_pfcp(testcasename());
f_sleep(1.0);
vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment_without_pfcp), t_pars(7, ps_domain := true));
diff --git a/library/PFCP_Emulation.ttcn b/library/PFCP_Emulation.ttcn
index 2fb3a8a..9cd9a86 100644
--- a/library/PFCP_Emulation.ttcn
+++ b/library/PFCP_Emulation.ttcn
@@ -199,7 +199,6 @@
type component PFCP_ConnHdlr {
port PFCPEM_PT PFCP;
port PFCPEM_PROC_PT PFCP_PROC;
- var PFCP_Emulation_CT vc_PFCP;
};
function f_pfcp_register() runs on PFCP_ConnHdlr {
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38031?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iaf7a54c674f2dc549572d918beb6f355f48ee700
Gerrit-Change-Number: 38031
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>