|
|
@ -49,7 +49,7 @@ int test_rx(std::vector<pdcp_test_event_t> events,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Test if the number of RX packets
|
|
|
|
// Test if the number of RX packets
|
|
|
|
TESTASSERT(gw_rx->rx_count == n_sdus_exp);
|
|
|
|
TESTASSERT_EQ(gw_rx->rx_count, n_sdus_exp);
|
|
|
|
srsran::unique_byte_buffer_t sdu_act = srsran::make_byte_buffer();
|
|
|
|
srsran::unique_byte_buffer_t sdu_act = srsran::make_byte_buffer();
|
|
|
|
gw_rx->get_last_pdu(sdu_act);
|
|
|
|
gw_rx->get_last_pdu(sdu_act);
|
|
|
|
TESTASSERT(compare_two_packets(sdu_exp, sdu_act) == 0);
|
|
|
|
TESTASSERT(compare_two_packets(sdu_exp, sdu_act) == 0);
|
|
|
@ -74,6 +74,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* This tests correct handling of HFN in the case of SN wraparound (SN LEN 12)
|
|
|
|
* This tests correct handling of HFN in the case of SN wraparound (SN LEN 12)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX COUNT [4095,4096], 12 bit SN");
|
|
|
|
std::vector<uint32_t> test1_counts(2); // Test two packets
|
|
|
|
std::vector<uint32_t> test1_counts(2); // Test two packets
|
|
|
|
std::iota(test1_counts.begin(), test1_counts.end(), 4095); // Starting at COUNT 4095
|
|
|
|
std::iota(test1_counts.begin(), test1_counts.end(), 4095); // Starting at COUNT 4095
|
|
|
|
std::vector<pdcp_test_event_t> test1_pdus =
|
|
|
|
std::vector<pdcp_test_event_t> test1_pdus =
|
|
|
@ -88,6 +90,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* Packet that wraparound should be dropped, so only one packet should be received at the GW.
|
|
|
|
* Packet that wraparound should be dropped, so only one packet should be received at the GW.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX COUNT [4294967295,0], 12 bit SN");
|
|
|
|
std::vector<uint32_t> test2_counts(2); // Test two packets
|
|
|
|
std::vector<uint32_t> test2_counts(2); // Test two packets
|
|
|
|
std::iota(test2_counts.begin(), test2_counts.end(), 4294967295); // Starting at COUNT 4294967295
|
|
|
|
std::iota(test2_counts.begin(), test2_counts.end(), 4294967295); // Starting at COUNT 4294967295
|
|
|
|
std::vector<pdcp_test_event_t> test2_pdus =
|
|
|
|
std::vector<pdcp_test_event_t> test2_pdus =
|
|
|
@ -102,6 +106,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* This tests correct handling of HFN in the case of SN wraparound (SN LEN 18)
|
|
|
|
* This tests correct handling of HFN in the case of SN wraparound (SN LEN 18)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX COUNT [262144,262145], 12 bit SN");
|
|
|
|
std::vector<uint32_t> test3_counts(2); // Test two packets
|
|
|
|
std::vector<uint32_t> test3_counts(2); // Test two packets
|
|
|
|
std::iota(test3_counts.begin(), test3_counts.end(), 262144); // Starting at COUNT 262144
|
|
|
|
std::iota(test3_counts.begin(), test3_counts.end(), 262144); // Starting at COUNT 262144
|
|
|
|
std::vector<pdcp_test_event_t> test3_pdus =
|
|
|
|
std::vector<pdcp_test_event_t> test3_pdus =
|
|
|
@ -116,6 +122,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* This tests correct handling of COUNT in the case of [HFN|SN] wraparound
|
|
|
|
* This tests correct handling of COUNT in the case of [HFN|SN] wraparound
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX COUNT [4294967295,4294967296], 18 bit SN");
|
|
|
|
std::vector<uint32_t> test4_counts(2); // Test two packets
|
|
|
|
std::vector<uint32_t> test4_counts(2); // Test two packets
|
|
|
|
std::iota(test4_counts.begin(), test4_counts.end(), 4294967295); // Starting at COUNT 4294967295
|
|
|
|
std::iota(test4_counts.begin(), test4_counts.end(), 4294967295); // Starting at COUNT 4294967295
|
|
|
|
std::vector<pdcp_test_event_t> test4_pdus =
|
|
|
|
std::vector<pdcp_test_event_t> test4_pdus =
|
|
|
@ -130,6 +138,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* Test reception of two out-of-order packets, starting at COUNT 0.
|
|
|
|
* Test reception of two out-of-order packets, starting at COUNT 0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX out-of-order COUNT [1,0], 12 bit SN");
|
|
|
|
std::vector<pdcp_test_event_t> test5_pdus;
|
|
|
|
std::vector<pdcp_test_event_t> test5_pdus;
|
|
|
|
pdcp_initial_state test5_init_state = {};
|
|
|
|
pdcp_initial_state test5_init_state = {};
|
|
|
|
|
|
|
|
|
|
|
@ -154,6 +164,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* Test reception of two out-of-order packets, starting at COUNT 0.
|
|
|
|
* Test reception of two out-of-order packets, starting at COUNT 0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX out-of-order COUNT [1,0], 18 bit SN");
|
|
|
|
std::vector<pdcp_test_event_t> test6_pdus;
|
|
|
|
std::vector<pdcp_test_event_t> test6_pdus;
|
|
|
|
pdcp_initial_state test6_init_state = {};
|
|
|
|
pdcp_initial_state test6_init_state = {};
|
|
|
|
|
|
|
|
|
|
|
@ -178,6 +190,8 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* Test Reception of one out-of-order packet.
|
|
|
|
* Test Reception of one out-of-order packet.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& test_logger = srslog::fetch_basic_logger("TESTER ");
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX out-of-order COUNT [1,0] t_reordering expired, 12 bit SN");
|
|
|
|
std::vector<pdcp_test_event_t> test7_pdus;
|
|
|
|
std::vector<pdcp_test_event_t> test7_pdus;
|
|
|
|
pdcp_initial_state test7_init_state = {};
|
|
|
|
pdcp_initial_state test7_init_state = {};
|
|
|
|
|
|
|
|
|
|
|
@ -197,6 +211,7 @@ int test_rx_all(srslog::basic_logger& logger)
|
|
|
|
* Test reception of two duplicate PDUs, with COUNT 0.
|
|
|
|
* Test reception of two duplicate PDUs, with COUNT 0.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
srsran::test_delimit_logger delimiter("RX duplicate COUNTs [0,0], 12 bit SN");
|
|
|
|
std::vector<pdcp_test_event_t> test8_pdus;
|
|
|
|
std::vector<pdcp_test_event_t> test8_pdus;
|
|
|
|
pdcp_initial_state test8_init_state = {};
|
|
|
|
pdcp_initial_state test8_init_state = {};
|
|
|
|
|
|
|
|
|
|
|
|