fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37243?usp=email )
Change subject: s1gw: pass Global_ENB_ID to ConnHdlr
......................................................................
s1gw: pass Global_ENB_ID to ConnHdlr
Change-Id: I9660ca96f13c4e4c890f3957a25d01a27e2e0cac
Related: SYS#6772
---
M s1gw/S1GW_Tests.ttcn
1 file changed, 28 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/37243/1
diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn
index ffc5c9b..df988d5 100644
--- a/s1gw/S1GW_Tests.ttcn
+++ b/s1gw/S1GW_Tests.ttcn
@@ -79,10 +79,15 @@
vc_S1APSRV.start(S1AP_Server.main(cpars));
}
-type union ConnHdlrPars {
- integer seed
+type record ConnHdlrPars {
+ Global_ENB_ID genb_id
};
+template (value) ConnHdlrPars
+t_ConnHdlrPars(integer enb_id := 0) := {
+ genb_id := ts_Global_ENB_ID(enb_id)
+}
+
type function void_fn(ConnHdlrPars pars) runs on ConnHdlr;
function f_ConnHdlr_spawn(void_fn fn, ConnHdlrPars pars)
@@ -184,19 +189,17 @@
function f_TC_setup(ConnHdlrPars pars) runs on ConnHdlr {
- var Global_ENB_ID genb_id := valueof(ts_Global_ENB_ID(pars.seed));
-
- f_ConnHdlr_register(genb_id);
+ f_ConnHdlr_register(pars.genb_id);
f_ConnHdlr_connect();
- f_ConnHdlr_setup(genb_id);
+ f_ConnHdlr_setup(pars.genb_id);
f_sleep(0.5); /* keep the connection idle for some time */
f_ConnHdlr_disconnect();
- f_ConnHdlr_unregister(genb_id);
+ f_ConnHdlr_unregister(pars.genb_id);
}
testcase TC_setup() runs on test_CT {
- var ConnHdlrPars pars := { seed := 0 };
+ var ConnHdlrPars pars := valueof(t_ConnHdlrPars);
var ConnHdlr vc_conn;
f_init();
@@ -212,7 +215,7 @@
f_init_s1ap_srv();
for (var integer i := 0; i < 42; i := i + 1) {
- var ConnHdlrPars pars := { seed := i };
+ var ConnHdlrPars pars := valueof(t_ConnHdlrPars(i));
var ConnHdlr vc_conn := f_ConnHdlr_spawn(refers(f_TC_setup), pars);
vc_conns := vc_conns & { vc_conn };
}
@@ -225,23 +228,21 @@
/* MME terminates connection, expect S1GW to terminate the eNB connection */
function f_TC_conn_term_by_mme(ConnHdlrPars pars) runs on ConnHdlr {
- var Global_ENB_ID genb_id := valueof(ts_Global_ENB_ID(pars.seed));
-
- f_ConnHdlr_register(genb_id);
+ f_ConnHdlr_register(pars.genb_id);
f_ConnHdlr_connect();
- f_ConnHdlr_setup(genb_id);
+ f_ConnHdlr_setup(pars.genb_id);
f_sleep(0.5); /* keep the connection idle for some time */
/* MME (S1AP_Server_CT) terminates connection */
- f_ConnHdlr_close_conn(genb_id);
+ f_ConnHdlr_close_conn(pars.genb_id);
/* expect our eNB connection to be released gracefully */
f_ConnHdlr_expect_shutdown();
- f_ConnHdlr_unregister(genb_id);
+ f_ConnHdlr_unregister(pars.genb_id);
}
testcase TC_conn_term_by_mme() runs on test_CT {
- var ConnHdlrPars pars := { seed := 0 };
+ var ConnHdlrPars pars := valueof(t_ConnHdlrPars);
var ConnHdlr vc_conn;
f_init();
@@ -261,7 +262,7 @@
setverdict(pass);
}
testcase TC_conn_term_mme_unavail() runs on test_CT {
- var ConnHdlrPars pars := { seed := 0 };
+ var ConnHdlrPars pars := valueof(t_ConnHdlrPars);
var ConnHdlr vc_conn;
f_init();
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37243?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9660ca96f13c4e4c890f3957a25d01a27e2e0cac
Gerrit-Change-Number: 37243
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange