|
|
@ -383,7 +383,6 @@ int mac_unpack_test()
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x13, 0x89, 0x00, 0x00};
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x13, 0x89, 0x00, 0x00};
|
|
|
|
|
|
|
|
|
|
|
|
srslte::log_filter rlc_log("RLC");
|
|
|
|
srslte::log_filter rlc_log("RLC");
|
|
|
|
srslte::timer_handler timers(64);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rlc_log.set_level(srslte::LOG_LEVEL_DEBUG);
|
|
|
|
rlc_log.set_level(srslte::LOG_LEVEL_DEBUG);
|
|
|
|
rlc_log.set_hex_limit(100000);
|
|
|
|
rlc_log.set_hex_limit(100000);
|
|
|
@ -397,7 +396,7 @@ int mac_unpack_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
|
|
|
|
|
|
|
|
// create dummy DL action and grant and push MAC PDU
|
|
|
|
// create dummy DL action and grant and push MAC PDU
|
|
|
|
mac_interface_phy_lte::tb_action_dl_t dl_action;
|
|
|
|
mac_interface_phy_lte::tb_action_dl_t dl_action;
|
|
|
@ -420,7 +419,7 @@ int mac_unpack_test()
|
|
|
|
// make sure MAC PDU thread picks up before stopping
|
|
|
|
// make sure MAC PDU thread picks up before stopping
|
|
|
|
sleep(1);
|
|
|
|
sleep(1);
|
|
|
|
mac.run_tti(0);
|
|
|
|
mac.run_tti(0);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
mac.stop();
|
|
|
|
mac.stop();
|
|
|
|
|
|
|
|
|
|
|
|
// check length of both received RLC PDUs
|
|
|
|
// check length of both received RLC PDUs
|
|
|
@ -452,7 +451,7 @@ int mac_ul_sch_pdu_test1()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -518,7 +517,7 @@ int mac_ul_logical_channel_prioritization_test1()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -629,7 +628,7 @@ int mac_ul_logical_channel_prioritization_test2()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -727,7 +726,7 @@ int mac_ul_logical_channel_prioritization_test3()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -813,7 +812,7 @@ int mac_ul_sch_pdu_with_short_bsr_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -897,7 +896,7 @@ int mac_ul_sch_pdu_with_padding_bsr_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -990,7 +989,7 @@ int mac_ul_sch_pdu_one_byte_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -1048,7 +1047,7 @@ int mac_ul_sch_pdu_two_byte_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -1106,7 +1105,7 @@ int mac_ul_sch_pdu_three_byte_test()
|
|
|
|
// the actual MAC
|
|
|
|
// the actual MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
const uint16_t crnti = 0x1001;
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
mac.set_ho_rnti(crnti, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -1357,7 +1356,7 @@ int mac_random_access_test()
|
|
|
|
// Configure MAC
|
|
|
|
// Configure MAC
|
|
|
|
mac mac("MAC");
|
|
|
|
mac mac("MAC");
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
stack.init(&mac, &phy);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &timers, &stack);
|
|
|
|
mac.init(&phy, &rlc, &rrc, &stack);
|
|
|
|
srslte::mac_cfg_t mac_cfg;
|
|
|
|
srslte::mac_cfg_t mac_cfg;
|
|
|
|
set_mac_cfg_t_rach_cfg_common(&mac_cfg, rach_cfg);
|
|
|
|
set_mac_cfg_t_rach_cfg_common(&mac_cfg, rach_cfg);
|
|
|
|
mac.set_config(mac_cfg);
|
|
|
|
mac.set_config(mac_cfg);
|
|
|
@ -1396,12 +1395,12 @@ int mac_random_access_test()
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
my_test.rach_cfg = rach_cfg;
|
|
|
|
my_test.rach_cfg = rach_cfg;
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure it triggers RRC signal
|
|
|
|
// Make sure it triggers RRC signal
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
TESTASSERT(rrc.rach_problem == 1);
|
|
|
|
TESTASSERT(rrc.rach_problem == 1);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
|
|
|
|
|
|
|
|
// Reset MAC
|
|
|
|
// Reset MAC
|
|
|
|
mac.reset();
|
|
|
|
mac.reset();
|
|
|
@ -1415,7 +1414,7 @@ int mac_random_access_test()
|
|
|
|
my_test.rar_nof_rapid = 1;
|
|
|
|
my_test.rar_nof_rapid = 1;
|
|
|
|
my_test.nof_prachs = 1;
|
|
|
|
my_test.nof_prachs = 1;
|
|
|
|
my_test.rar_nof_invalid_rapid = rach_cfg.ra_supervision_info.ra_resp_win_size.to_number();
|
|
|
|
my_test.rar_nof_invalid_rapid = rach_cfg.ra_supervision_info.ra_resp_win_size.to_number();
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Test 3: RAR received but no matching RAPID. Test Msg3 retransmissions
|
|
|
|
// Test 3: RAR received but no matching RAPID. Test Msg3 retransmissions
|
|
|
|
// On each HARQ retx, contention resolution timer must be restarted (5.1.5)
|
|
|
|
// On each HARQ retx, contention resolution timer must be restarted (5.1.5)
|
|
|
@ -1423,7 +1422,7 @@ int mac_random_access_test()
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
my_test.rar_nof_invalid_rapid = 0;
|
|
|
|
my_test.rar_nof_invalid_rapid = 0;
|
|
|
|
my_test.nof_msg3_retx = rach_cfg.max_harq_msg3_tx;
|
|
|
|
my_test.nof_msg3_retx = rach_cfg.max_harq_msg3_tx;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Test 4: RAR with valid RAPID. Msg3 transmitted, Msg4 received but invalid ConRes
|
|
|
|
// Test 4: RAR with valid RAPID. Msg3 transmitted, Msg4 received but invalid ConRes
|
|
|
|
// Contention resolution is defined in 5.1.5. If ConResID does not match, the ConRes is considered
|
|
|
|
// Contention resolution is defined in 5.1.5. If ConResID does not match, the ConRes is considered
|
|
|
@ -1432,7 +1431,7 @@ int mac_random_access_test()
|
|
|
|
phy.reset();
|
|
|
|
phy.reset();
|
|
|
|
my_test.nof_msg3_retx = 0;
|
|
|
|
my_test.nof_msg3_retx = 0;
|
|
|
|
my_test.msg4_enable = true;
|
|
|
|
my_test.msg4_enable = true;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Test 5: Msg4 received and valid ConRes. In this case a valid ConResID is received and RA procedure is successful
|
|
|
|
// Test 5: Msg4 received and valid ConRes. In this case a valid ConResID is received and RA procedure is successful
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
@ -1440,7 +1439,7 @@ int mac_random_access_test()
|
|
|
|
my_test.msg4_valid_conres = true;
|
|
|
|
my_test.msg4_valid_conres = true;
|
|
|
|
my_test.check_ra_successful = true;
|
|
|
|
my_test.check_ra_successful = true;
|
|
|
|
my_test.assume_prach_transmitted = 0;
|
|
|
|
my_test.assume_prach_transmitted = 0;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Test 6: RA with existing C-RNTI (Sends C-RNTI MAC CE)
|
|
|
|
// Test 6: RA with existing C-RNTI (Sends C-RNTI MAC CE)
|
|
|
|
// The transmission of C-RNTI MAC CE is only done if no CCCH is present (5.1.4).
|
|
|
|
// The transmission of C-RNTI MAC CE is only done if no CCCH is present (5.1.4).
|
|
|
@ -1452,7 +1451,7 @@ int mac_random_access_test()
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.assume_prach_transmitted = -1;
|
|
|
|
my_test.assume_prach_transmitted = -1;
|
|
|
|
my_test.send_valid_ul_grant = true;
|
|
|
|
my_test.send_valid_ul_grant = true;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
|
|
|
|
|
|
|
|
// Test 7: Test Contention based Random Access. This is used eg in HO where preamble is chosen by UE.
|
|
|
|
// Test 7: Test Contention based Random Access. This is used eg in HO where preamble is chosen by UE.
|
|
|
|
// It is similar to Test 5 because C-RNTI is available to the UE when start the RA but
|
|
|
|
// It is similar to Test 5 because C-RNTI is available to the UE when start the RA but
|
|
|
@ -1463,7 +1462,7 @@ int mac_random_access_test()
|
|
|
|
phy.set_crnti(0);
|
|
|
|
phy.set_crnti(0);
|
|
|
|
mac.start_cont_ho();
|
|
|
|
mac.start_cont_ho();
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
@ -1471,7 +1470,7 @@ int mac_random_access_test()
|
|
|
|
my_test.assume_prach_transmitted = 0;
|
|
|
|
my_test.assume_prach_transmitted = 0;
|
|
|
|
my_test.check_ra_successful = false;
|
|
|
|
my_test.check_ra_successful = false;
|
|
|
|
my_test.send_valid_ul_grant = false;
|
|
|
|
my_test.send_valid_ul_grant = false;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
|
|
|
|
|
|
|
|
// Test 8: Test Contention based Random Access. Same as above but we let the procedure finish successfully.
|
|
|
|
// Test 8: Test Contention based Random Access. Same as above but we let the procedure finish successfully.
|
|
|
@ -1480,12 +1479,12 @@ int mac_random_access_test()
|
|
|
|
phy.set_crnti(0);
|
|
|
|
phy.set_crnti(0);
|
|
|
|
mac.start_cont_ho();
|
|
|
|
mac.start_cont_ho();
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
my_test.nof_prachs = 1;
|
|
|
|
my_test.nof_prachs = 1;
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.send_valid_ul_grant = true;
|
|
|
|
my_test.send_valid_ul_grant = true;
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
|
|
|
|
|
|
|
|
// Test 9: Test non-Contention based HO. Used in HO but preamble is given by the network. In addition to checking
|
|
|
|
// Test 9: Test non-Contention based HO. Used in HO but preamble is given by the network. In addition to checking
|
|
|
@ -1494,7 +1493,7 @@ int mac_random_access_test()
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
phy.set_prach_tti(tti + phy.prach_delay);
|
|
|
|
phy.set_prach_tti(tti + phy.prach_delay);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
phy.set_crnti(0);
|
|
|
|
phy.set_crnti(0);
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
my_test.preamble_idx = 3;
|
|
|
|
my_test.preamble_idx = 3;
|
|
|
@ -1502,9 +1501,9 @@ int mac_random_access_test()
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number();
|
|
|
|
my_test.rar_nof_invalid_rapid = rach_cfg.ra_supervision_info.ra_resp_win_size.to_number();
|
|
|
|
my_test.rar_nof_invalid_rapid = rach_cfg.ra_supervision_info.ra_resp_win_size.to_number();
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
|
|
|
|
|
|
|
|
// Test 10: Test non-Contention based HO. Used in HO but preamble is given by the network. We check that
|
|
|
|
// Test 10: Test non-Contention based HO. Used in HO but preamble is given by the network. We check that
|
|
|
@ -1512,7 +1511,7 @@ int mac_random_access_test()
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
mac_log->info("\n=========== Test %d =============\n", test_id++);
|
|
|
|
phy.set_prach_tti(tti + phy.prach_delay);
|
|
|
|
phy.set_prach_tti(tti + phy.prach_delay);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
phy.set_crnti(0);
|
|
|
|
phy.set_crnti(0);
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
rrc.ho_finish = false;
|
|
|
|
my_test.preamble_idx = 3;
|
|
|
|
my_test.preamble_idx = 3;
|
|
|
@ -1521,9 +1520,9 @@ int mac_random_access_test()
|
|
|
|
my_test.rar_nof_invalid_rapid = 0;
|
|
|
|
my_test.rar_nof_invalid_rapid = 0;
|
|
|
|
my_test.check_ra_successful = true;
|
|
|
|
my_test.check_ra_successful = true;
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &timers));
|
|
|
|
TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack.timers));
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
mac.run_tti(tti++);
|
|
|
|
timers.step_all();
|
|
|
|
stack.timers.step_all();
|
|
|
|
TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish);
|
|
|
|
|
|
|
|
|
|
|
|
mac.stop();
|
|
|
|
mac.stop();
|
|
|
|