laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
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(-)

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 change 38031. To unsubscribe, or for help writing mail filters, visit settings.

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@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>