From 1899c468d3136571aee01e0fb298393fcfe6f146 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 25 Jun 2020 18:11:38 +0100 Subject: [PATCH] updated rrc mobility test --- srsenb/src/stack/rrc/mac_controller.cc | 13 +++++-------- srsenb/test/upper/rrc_mobility_test.cc | 4 +++- srsenb/test/upper/test_helpers.h | 12 ++++++++++++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index f739b1363..c2a9e7273 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -135,10 +135,10 @@ void rrc::ue::mac_controller::handle_con_reconf(const asn1::rrc::rrc_conn_recfg_ if (conn_recfg.mob_ctrl_info_present) { // Handover Command handle_con_reconf_with_mobility(); - } else { - // First Reconf Message - mac->ue_cfg(rrc_ue->rnti, ¤t_sched_ue_cfg); } + + // Apply changes to MAC scheduler + mac->ue_cfg(rrc_ue->rnti, ¤t_sched_ue_cfg); mac->phy_config_enabled(rrc_ue->rnti, false); } @@ -170,15 +170,12 @@ void rrc::ue::mac_controller::handle_con_reconf_with_mobility() { // Temporarily freeze DL+UL grants for all DRBs. for (const drb_to_add_mod_s& drb : rrc_ue->bearer_list.get_established_drbs()) { - mac->bearer_ue_rem(rrc_ue->rnti, drb.drb_id + 2); + current_sched_ue_cfg.ue_bearers[drb.lc_ch_id].direction = sched_interface::ue_bearer_cfg_t::IDLE; } // Temporarily freeze UL grants for SRBs. DL is required to send HO Cmd - sched_interface::ue_bearer_cfg_t bcfg; for (uint32_t srb_id = 0; srb_id < 3; ++srb_id) { - bcfg = current_sched_ue_cfg.ue_bearers[srb_id]; - bcfg.direction = sched_interface::ue_bearer_cfg_t::DL; - mac->bearer_ue_cfg(rrc_ue->rnti, srb_id, &bcfg); + current_sched_ue_cfg.ue_bearers[srb_id].direction = sched_interface::ue_bearer_cfg_t::DL; } } diff --git a/srsenb/test/upper/rrc_mobility_test.cc b/srsenb/test/upper/rrc_mobility_test.cc index 2a10ed0a8..08c77cf8c 100644 --- a/srsenb/test/upper/rrc_mobility_test.cc +++ b/srsenb/test/upper/rrc_mobility_test.cc @@ -294,7 +294,7 @@ struct mobility_tester { test_dummies::mac_mobility_dummy mac; test_dummies::rlc_mobility_dummy rlc; test_dummies::pdcp_mobility_dummy pdcp; - phy_dummy phy; + test_dummies::phy_mobility_dummy phy; test_dummies::s1ap_mobility_dummy s1ap; gtpu_dummy gtpu; @@ -509,6 +509,8 @@ int test_intraenb_mobility(mobility_test_params test_params) tester.rrc.upd_user(tester.rnti + 1, tester.rnti); TESTASSERT(tester.rlc.ue_db[tester.rnti].reest_sdu_counter == 0); TESTASSERT(tester.pdcp.last_sdu.sdu == nullptr); + TESTASSERT(tester.phy.last_cfg.size() == 1 and tester.mac.ue_db[tester.rnti].supported_cc_list.size() == 1); + TESTASSERT(tester.phy.last_cfg[0].enb_cc_idx == tester.mac.ue_db[tester.rnti].supported_cc_list[0].enb_cc_idx); /* Test Case: The UE receives a duplicate C-RNTI CE. Nothing should happen */ if (test_params.fail_at == mobility_test_params::test_event::duplicate_crnti_ce) { diff --git a/srsenb/test/upper/test_helpers.h b/srsenb/test/upper/test_helpers.h index 8223c76a5..a65cb2608 100644 --- a/srsenb/test/upper/test_helpers.h +++ b/srsenb/test/upper/test_helpers.h @@ -157,9 +157,21 @@ public: ue_db[rnti] = *cfg; return 0; } + int ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, sched_interface::ue_cfg_t* cfg) override + { + ue_db[crnti] = *cfg; + return 0; + } std::map ue_db; }; +class phy_mobility_dummy : public phy_dummy +{ +public: + void set_config(uint16_t rnti, const phy_rrc_cfg_list_t& dedicated_list) override { last_cfg = dedicated_list; } + phy_rrc_cfg_list_t last_cfg; +}; + } // namespace test_dummies namespace test_helpers {