fix rrc_nr_test bad config

master
Francisco 3 years ago committed by Francisco Paisana
parent 9dcfa8fdb1
commit 479df12775

@ -10,7 +10,7 @@ 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}) 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) add_executable(rrc_nr_test rrc_nr_test.cc)
target_link_libraries(rrc_nr_test srsgnb_rrc test_helpers rrc_nr_asn1 ${ATOMIC_LIBS}) target_link_libraries(rrc_nr_test srsgnb_rrc test_helpers ${ATOMIC_LIBS})
add_test(rrc_nr_test rrc_nr_test -i ${CMAKE_CURRENT_SOURCE_DIR}/../..) add_test(rrc_nr_test rrc_nr_test -i ${CMAKE_CURRENT_SOURCE_DIR}/../..)
add_executable(rrc_meascfg_test rrc_meascfg_test.cc) add_executable(rrc_meascfg_test rrc_meascfg_test.cc)

@ -10,6 +10,7 @@
* *
*/ */
#include "srsenb/hdr/enb.h"
#include "srsenb/hdr/stack/rrc/rrc_nr.h" #include "srsenb/hdr/stack/rrc/rrc_nr.h"
#include "srsenb/test/common/dummy_classes_common.h" #include "srsenb/test/common/dummy_classes_common.h"
#include "srsenb/test/common/dummy_classes_nr.h" #include "srsenb/test/common/dummy_classes_nr.h"
@ -76,10 +77,15 @@ int test_rrc_setup()
rrc_nr rrc_obj(&task_sched); rrc_nr rrc_obj(&task_sched);
// set cfg // set cfg
rrc_cell_cfg_nr_t cell_cfg = {}; all_args_t args{};
rrc_nr_cfg_t rrc_cfg_nr = rrc_obj.update_default_cfg(rrc_nr_cfg_t{}); phy_cfg_t phy_cfg{};
test_helpers::parse_default_cfg(&rrc_cfg_nr); rrc_nr_cfg_t rrc_cfg_nr = rrc_obj.update_default_cfg(rrc_nr_cfg_t{});
rrc_cfg_nr.cell_list.push_back(cell_cfg); rrc_cfg_nr.cell_list.emplace_back();
rrc_cfg_nr.cell_list[0].phy_cell.carrier.pci = 500;
rrc_cfg_nr.cell_list[0].dl_arfcn = 634240;
rrc_cfg_nr.cell_list[0].band = 78;
args.enb.n_prb = 50;
enb_conf_sections::set_derived_args_nr(&args, &rrc_cfg_nr, &phy_cfg);
TESTASSERT(rrc_obj.init(rrc_cfg_nr, &phy_obj, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, nullptr, nullptr) == TESTASSERT(rrc_obj.init(rrc_cfg_nr, &phy_obj, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, nullptr, nullptr) ==
SRSRAN_SUCCESS); SRSRAN_SUCCESS);
@ -96,8 +102,19 @@ int test_rrc_setup()
} // namespace srsenb } // namespace srsenb
int main() int main(int argc, char** argv)
{ {
auto& logger = srslog::fetch_basic_logger("ASN1");
logger.set_level(srslog::basic_levels::info);
srslog::init();
if (argc < 3) {
argparse::usage(argv[0]);
return -1;
}
argparse::parse_args(argc, argv);
// FIXME: disabled temporarily until SIB generation is fixed // FIXME: disabled temporarily until SIB generation is fixed
// TESTASSERT(srsenb::test_sib_generation() == SRSRAN_SUCCESS); // TESTASSERT(srsenb::test_sib_generation() == SRSRAN_SUCCESS);
TESTASSERT(srsenb::test_rrc_setup() == SRSRAN_SUCCESS); TESTASSERT(srsenb::test_rrc_setup() == SRSRAN_SUCCESS);

@ -61,10 +61,9 @@ int parse_default_cfg(rrc_nr_cfg_t* rrc_nr_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) 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 = {}; *args = {};
*rrc_cfg = {}; *rrc_cfg = {};
*phy_cfg = {}; *phy_cfg = {};
*rrc_nr_cfg = {};
args->enb_files.sib_config = argparse::repository_dir + "/sib.conf.example"; 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.rr_config = argparse::repository_dir + "/rr.conf.example";

Loading…
Cancel
Save