pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28252 )
Change subject: hnodeb: Allow setting hnbllif sapi versions ......................................................................
hnodeb: Allow setting hnbllif sapi versions
Version 1 of audio SAPI will be used in follow-up patch.
Related: SYS#5516 Change-Id: I24d757d3dfa4148537db49d70c525e1a81836426 --- M hnodeb/HNBGW_ConnectionHandler.ttcn M hnodeb/HNB_Tests.ttcn 2 files changed, 19 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/28252/1
diff --git a/hnodeb/HNBGW_ConnectionHandler.ttcn b/hnodeb/HNBGW_ConnectionHandler.ttcn index 6b06437..a92ac9e 100644 --- a/hnodeb/HNBGW_ConnectionHandler.ttcn +++ b/hnodeb/HNBGW_ConnectionHandler.ttcn @@ -106,19 +106,20 @@ f_HNBGW_ConnHdlr_init_vty();
/* Connect to HNB on LLSK and do HELLO ping-pong */ - f_start_hnbllif(LLSK, id & "-LLSK", g_pars.hnbllif_sk_path, g_llsk_conn_id); + f_start_hnbllif(LLSK, id & "-LLSK", g_pars, g_llsk_conn_id); }
-function f_start_hnbllif(HNBLLIF_CODEC_PT pt, charstring id, charstring hnbllif_sk_path, out integer hnbllif_conn_id) { +function f_start_hnbllif(HNBLLIF_CODEC_PT pt, charstring id, TestHdlrParams pars, + out integer hnbllif_conn_id) { timer T := 2.0; var HNBLLIF_send_data sd; var HNBLLIF_Message last_hello_cnf; - if (hnbllif_sk_path == "") { + if (pars.hnbllif_sk_path == "") { hnbllif_conn_id := -1; return; } - hnbllif_conn_id := f_hnbllif_connect(pt, hnbllif_sk_path); + hnbllif_conn_id := f_hnbllif_connect(pt, pars.hnbllif_sk_path);
T.start; pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_CTL, HNBLLIF_Types.mp_hnbllif_version))); @@ -128,23 +129,23 @@ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for HNBLLIF HELLO.REQ SAPI=CTL"); } } - pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_IUH, 0))); + pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_IUH, pars.hnbllif_sapi_iuh_version))); alt { - [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_IUH, 0); + [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_IUH, pars.hnbllif_sapi_iuh_version); [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for HNBLLIF HELLO.REQ SAPI=IUH"); } } - pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_AUDIO, 0))); + pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_AUDIO, pars.hnbllif_sapi_audio_version))); alt { - [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_AUDIO, 0); + [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_AUDIO, pars.hnbllif_sapi_audio_version); [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for HNBLLIF HELLO.REQ SAPI=AUDIO"); } } - pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_GTP, 0))); + pt.send(t_SD_HNBLLIF(hnbllif_conn_id, ts_HNBLLIF_CTL_HELLO_REQ(HNBLL_IF_SAPI_GTP, pars.hnbllif_sapi_gtp_version))); alt { - [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_GTP, 0); + [] as_hnbllif_hello_cnf(pt, hnbllif_conn_id, last_hello_cnf, HNBLL_IF_SAPI_GTP, pars.hnbllif_sapi_gtp_version); [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for HNBLLIF HELLO.REQ SAPI=GTP"); } @@ -153,6 +154,9 @@
type record TestHdlrParams { charstring hnbllif_sk_path, /* "" means don't connect */ + uint16_t hnbllif_sapi_iuh_version, + uint16_t hnbllif_sapi_gtp_version, + uint16_t hnbllif_sapi_audio_version, charstring hnbgw_addr, charstring hnodeb_addr, integer hnbgw_port, @@ -171,6 +175,9 @@ * f_gen_test_hdlr_pars() instead in order to get a configuration. */ template (value) TestHdlrParams t_def_TestHdlrPars := { hnbllif_sk_path := HNBLL_SOCK_DEFAULT, + hnbllif_sapi_iuh_version := 0, + hnbllif_sapi_gtp_version := 0, + hnbllif_sapi_audio_version := 0, hnbgw_addr := "127.0.0.1", hnodeb_addr := "127.0.0.1", hnbgw_port := 29169, diff --git a/hnodeb/HNB_Tests.ttcn b/hnodeb/HNB_Tests.ttcn index a58e203..3925e60 100644 --- a/hnodeb/HNB_Tests.ttcn +++ b/hnodeb/HNB_Tests.ttcn @@ -113,9 +113,9 @@ f_vty_transceive(HNBVTY, "enable"); }
-private function f_init_hnbllif() runs on test_CT { +private function f_init_hnbllif(TestHdlrParams pars) runs on test_CT { map(self:LLSK, system:LLSK); - f_start_hnbllif(LLSK, testcasename(), mp_hnbllif_sk_path, g_llsk_conn_id); + f_start_hnbllif(LLSK, testcasename(), pars, g_llsk_conn_id); }
/* global initialization function */