nr,gnb,rrc: pass default rrc_nr_cfg_t to rrc_nr_test

master
Francisco 3 years ago committed by Francisco Paisana
parent 2e71dc17a5
commit 9dcfa8fdb1

@ -10,8 +10,8 @@ add_library(test_helpers test_helpers.cc)
target_link_libraries(test_helpers srsenb_rrc srsenb_common rrc_asn1 rrc_nr_asn1 s1ap_asn1 srsran_common enb_cfg_parser ${LIBCONFIGPP_LIBRARIES})
add_executable(rrc_nr_test rrc_nr_test.cc)
target_link_libraries(rrc_nr_test srsgnb_rrc srsran_common rrc_nr_asn1 ${ATOMIC_LIBS})
add_test(rrc_nr_test rrc_nr_test)
target_link_libraries(rrc_nr_test srsgnb_rrc test_helpers rrc_nr_asn1 ${ATOMIC_LIBS})
add_test(rrc_nr_test rrc_nr_test -i ${CMAKE_CURRENT_SOURCE_DIR}/../..)
add_executable(rrc_meascfg_test rrc_meascfg_test.cc)
target_link_libraries(rrc_meascfg_test test_helpers ${ATOMIC_LIBS})

@ -13,6 +13,7 @@
#include "srsenb/hdr/stack/rrc/rrc_nr.h"
#include "srsenb/test/common/dummy_classes_common.h"
#include "srsenb/test/common/dummy_classes_nr.h"
#include "srsenb/test/rrc/test_helpers.h"
#include "srsran/common/test_common.h"
#include "srsran/interfaces/gnb_rrc_nr_interfaces.h"
#include <iostream>
@ -75,11 +76,10 @@ int test_rrc_setup()
rrc_nr rrc_obj(&task_sched);
// set cfg
rrc_nr_cfg_t default_cfg = {};
rrc_cell_cfg_nr_t cell_cfg = {};
rrc_nr_cfg_t rrc_cfg_nr = rrc_obj.update_default_cfg(default_cfg);
rrc_nr_cfg_t rrc_cfg_nr = rrc_obj.update_default_cfg(rrc_nr_cfg_t{});
test_helpers::parse_default_cfg(&rrc_cfg_nr);
rrc_cfg_nr.cell_list.push_back(cell_cfg);
TESTASSERT(rrc_obj.init(rrc_cfg_nr, &phy_obj, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, nullptr, nullptr) ==
SRSRAN_SUCCESS);

@ -46,30 +46,45 @@ int parse_default_cfg_phy(rrc_cfg_t* rrc_cfg, phy_cfg_t* phy_cfg, srsenb::all_ar
int parse_default_cfg(rrc_cfg_t* rrc_cfg, srsenb::all_args_t& args)
{
args = {};
*rrc_cfg = {};
args.enb_files.sib_config = argparse::repository_dir + "/sib.conf.example";
args.enb_files.rr_config = argparse::repository_dir + "/rr.conf.example";
args.enb_files.rb_config = argparse::repository_dir + "/rb.conf.example";
srslog::fetch_basic_logger("TEST").debug("sib file path=%s", args.enb_files.sib_config.c_str());
args.enb.enb_id = 0x19B;
args.enb.dl_earfcn = 3400;
args.enb.n_prb = 50;
TESTASSERT(srsran::string_to_mcc("001", &args.stack.s1ap.mcc));
TESTASSERT(srsran::string_to_mnc("01", &args.stack.s1ap.mnc));
args.enb.transmission_mode = 1;
args.enb.nof_ports = 1;
args.general.eia_pref_list = "EIA2, EIA1, EIA0";
args.general.eea_pref_list = "EEA0, EEA2, EEA1";
args.stack.mac.nof_prealloc_ues = 2;
args.general.rrc_inactivity_timer = 60000;
phy_cfg_t phy_cfg;
rrc_nr_cfg_t rrc_cfg_nr;
return parse_default_cfg(&args, rrc_cfg, &phy_cfg, &rrc_cfg_nr);
}
int parse_default_cfg(rrc_nr_cfg_t* rrc_nr_cfg)
{
srsenb::all_args_t args;
phy_cfg_t phy_cfg;
rrc_cfg_t rrc_cfg;
return parse_default_cfg(&args, &rrc_cfg, &phy_cfg, rrc_nr_cfg);
}
return enb_conf_sections::parse_cfg_files(&args, rrc_cfg, &rrc_cfg_nr, &phy_cfg);
int parse_default_cfg(srsenb::all_args_t* args, rrc_cfg_t* rrc_cfg, phy_cfg_t* phy_cfg, rrc_nr_cfg_t* rrc_nr_cfg)
{
*args = {};
*rrc_cfg = {};
*phy_cfg = {};
*rrc_nr_cfg = {};
args->enb_files.sib_config = argparse::repository_dir + "/sib.conf.example";
args->enb_files.rr_config = argparse::repository_dir + "/rr.conf.example";
args->enb_files.rb_config = argparse::repository_dir + "/rb.conf.example";
srslog::fetch_basic_logger("TEST").debug("sib file path=%s", args->enb_files.sib_config.c_str());
args->enb.enb_id = 0x19B;
args->enb.dl_earfcn = 3400;
args->enb.n_prb = 50;
TESTASSERT(srsran::string_to_mcc("001", &args->stack.s1ap.mcc));
TESTASSERT(srsran::string_to_mnc("01", &args->stack.s1ap.mnc));
args->enb.transmission_mode = 1;
args->enb.nof_ports = 1;
args->general.eia_pref_list = "EIA2, EIA1, EIA0";
args->general.eea_pref_list = "EEA0, EEA2, EEA1";
args->stack.mac.nof_prealloc_ues = 2;
args->general.rrc_inactivity_timer = 60000;
return enb_conf_sections::parse_cfg_files(args, rrc_cfg, rrc_nr_cfg, phy_cfg);
}
int bring_rrc_to_reconf_state(srsenb::rrc& rrc, srsran::timer_handler& timers, uint16_t rnti)

@ -205,7 +205,9 @@ public:
namespace test_helpers {
int parse_default_cfg(srsenb::all_args_t* args, rrc_cfg_t* rrc_cfg, phy_cfg_t* phy_cfg, rrc_nr_cfg_t* rrc_nr_cfg);
int parse_default_cfg(rrc_cfg_t* rrc_cfg, srsenb::all_args_t& args);
int parse_default_cfg(rrc_nr_cfg_t* rrc_nr_cfg);
int parse_default_cfg_phy(rrc_cfg_t* rrc_cfg, phy_cfg_t* phy_cfg, srsenb::all_args_t& args);
template <typename ASN1Type>

Loading…
Cancel
Save