From f787b0953cf210e31984ffeaa9bf826b10355bd6 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 4 Oct 2019 18:34:05 +0200 Subject: [PATCH] pcu: Allow tests to overwrite pcuif INFO_IND params Change-Id: I75c746b822184fdcc966d77a7c6a0a6918c236e6 --- library/PCUIF_Types.ttcn | 53 +---------------------- pcu/PCU_Tests_RAW.ttcn | 93 +++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 99 deletions(-) diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn index a36e2614f..ae0762a4b 100644 --- a/library/PCUIF_Types.ttcn +++ b/library/PCUIF_Types.ttcn @@ -677,62 +677,13 @@ template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := { ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL }; - template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr, - template (value) uint16_t nsei, - template (value) uint16_t nsvci, - template (value) uint16_t bvci, - template (value) uint16_t local_port, - template (value) uint16_t remote_port, - template (value) OCT4 remote_ip, - template (value) PCUIF_Flags flags := c_PCUIF_Flags_default, - template (value) uint16_t mcc := 262, - template (value) uint16_t mnc := 42, - template (value) uint16_t lac := 13135, - template (value) uint8_t rac := 0, - template (value) uint16_t cell_id := 20960, - template (value) uint8_t bsic := 7, - template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def, - template (value) uint32_t version := PCU_IF_VERSION) := { + template (value) PCUIF_info_ind info_ind) := { msg_type := PCU_IF_MSG_INFO_IND, bts_nr := bts_nr, spare := '0000'O, u := { - info_ind := { - version := version, - flags := flags, - trx := trx, - bsic := bsic, - mcc := mcc, - mnc := mnc, - mnc_3_digits := 0, - lac := lac, - rac := rac, - nsei := nsei, - nse_timer := { 3, 3, 3, 3, 30, 3, 10 }, - cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }, - cell_id := cell_id, - repeat_time := 5 * 50, - repeat_count := 3, - bvci := bvci, - t3142 := 20, - t3169 := 5, - t3191 := 5, - t3193_10ms := 160, - t3195 := 5, - t3101 := 10, - t3103 := 4, - t3105 := 8, - cv_countdown := 15, - dl_tbf_ext := 250 * 10, /* ms */ - ul_tbf_ext := 250 * 10, /* ms */ - initial_cs := 2, - initial_mcs := 6, - nsvci := { nsvci, 0 }, - local_pprt := { local_port, 0 }, - remote_port := { remote_port, 0 }, - remote_ip := { remote_ip , '00000000'O } - } + info_ind := info_ind } } template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn index 4d2002788..d5e53e2f5 100644 --- a/pcu/PCU_Tests_RAW.ttcn +++ b/pcu/PCU_Tests_RAW.ttcn @@ -69,9 +69,50 @@ private altstep as_Tguard() runs on RAW_NS_CT { } } +/* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */ +template (value) PCUIF_info_ind ts_PCUIF_INFO_default := { + version := PCU_IF_VERSION, + flags := c_PCUIF_Flags_default, + trx := valueof(ts_PCUIF_InfoTrxs_def), + bsic := 7, + mcc := 262, + mnc := 42, + mnc_3_digits := 0, + lac := 13135, + rac := 0, + nsei := mp_nsconfig.nsei, + nse_timer := { 3, 3, 3, 3, 30, 3, 10 }, + cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }, + cell_id := 20960, + repeat_time := 5 * 50, + repeat_count := 3, + bvci := mp_gb_cfg.bvci, + t3142 := 20, + t3169 := 5, + t3191 := 5, + t3193_10ms := 160, + t3195 := 5, + t3101 := 10, + t3103 := 4, + t3105 := 8, + cv_countdown := 15, + dl_tbf_ext := 250 * 10, /* ms */ + ul_tbf_ext := 250 * 10, /* ms */ + initial_cs := 2, + initial_mcs := 6, + nsvci := { mp_nsconfig.nsvci, 0 }, + local_pprt := { mp_nsconfig.remote_udp_port, 0 }, + remote_port := { mp_nsconfig.local_udp_port, 0 }, + remote_ip := { f_inet_haddr(mp_nsconfig.local_ip) , '00000000'O } +} + function f_init_pcuif() runs on RAW_PCU_CT { + var PCUIF_info_ind info_ind; map(self:PCU, system:PCU); + + info_ind := valueof(ts_PCUIF_INFO_default); + /* Connect the Unix Domain Socket */ g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path); PCU.receive(UD_connected:?); @@ -79,15 +120,8 @@ function f_init_pcuif() runs on RAW_PCU_CT { /* Wait for PCU_VERSION and return INFO_IND */ PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?))); /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */ - var template PCUIF_Message info_ind := ts_PCUIF_INFO_IND(bts_nr := 0, - nsei := mp_nsconfig.nsei, - nsvci := mp_nsconfig.nsvci, - bvci := mp_gb_cfg.bvci, - local_port := mp_nsconfig.remote_udp_port, - remote_port := mp_nsconfig.local_udp_port, - remote_ip := f_inet_haddr(mp_nsconfig.local_ip) - ); - PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind)); + var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind); + PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg)); } function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT { @@ -439,9 +473,8 @@ private altstep as_Tguard_RAW() runs on RAW_PCU_Test_CT { } } -private function f_init_raw(charstring id) +private function f_init_raw(charstring id, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default) runs on RAW_PCU_Test_CT { - var PCUIF_info_ind info_ind; var RAW_PCUIF_CT vc_PCUIF; var RAW_PCU_BTS_CT vc_BTS; @@ -459,44 +492,8 @@ runs on RAW_PCU_Test_CT { connect(vc_BTS:PCUIF, vc_PCUIF:BTS); connect(vc_BTS:TC, self:BTS); - /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */ - info_ind := { - version := PCU_IF_VERSION, - flags := c_PCUIF_Flags_default, - trx := valueof(ts_PCUIF_InfoTrxs_def), - /* TODO: make this configurable */ - bsic := 7, mcc := 262, mnc := 42, - mnc_3_digits := 0, - /* TODO: make this configurable */ - lac := 13135, rac := 0, - nsei := mp_nsconfig.nsei, - nse_timer := { 3, 3, 3, 3, 30, 3, 10 }, - cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }, - cell_id := 20960, - repeat_time := 5 * 50, - repeat_count := 3, - bvci := mp_gb_cfg.bvci, - t3142 := 20, - t3169 := 5, - t3191 := 5, - t3193_10ms := 160, - t3195 := 5, - t3101 := 10, - t3103 := 4, - t3105 := 8, - cv_countdown := 15, - dl_tbf_ext := 250 * 10, /* ms */ - ul_tbf_ext := 250 * 10, /* ms */ - initial_cs := 2, - initial_mcs := 6, - nsvci := { mp_nsconfig.nsvci, 0 }, - local_pprt := { mp_nsconfig.remote_udp_port, 0 }, - remote_port := { mp_nsconfig.local_udp_port, 0 }, - remote_ip := { f_inet_haddr(mp_nsconfig.local_ip), '00000000'O } - }; - vc_PCUIF.start(f_PCUIF_CT_handler(mp_pcu_sock_path)); - vc_BTS.start(f_BTS_CT_handler(0, info_ind)); + vc_BTS.start(f_BTS_CT_handler(0, valueof(info_ind))); /* Wait until the BTS is ready (SI13 negotiated) */ BTS.receive(tr_RAW_PCU_EV(BTS_EV_SI13_NEGO));