From 6c4aaa6e107f93c1f511689e057c6d39d5fa8dc4 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 10 Aug 2018 15:50:08 +0200 Subject: [PATCH] adapt AM test to new MAC timer --- lib/test/upper/rlc_am_test.cc | 18 ++++++++++++++---- lib/test/upper/rlc_stress_test.cc | 14 +++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index bd5e7e2c0..38d2e4641 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -867,7 +867,6 @@ bool resegment_test_3() bool resegment_test_4() { - // SDUs: | 10 | 10 | 10 | 10 | 10 | // PDUs: | 5 | 5| 30 | 5 | 5| // Retx PDU segments: | 15 | 15 | @@ -980,7 +979,6 @@ bool resegment_test_4() bool resegment_test_5() { - // SDUs: | 10 | 10 | 10 | 10 | 10 | // PDUs: |2|3| 40 |3|2| // Retx PDU segments: | 20 | 20 | @@ -1373,6 +1371,18 @@ bool resegment_test_7() timers.step_all(); } + // Read status PDU from RLC2 + assert(rlc2.get_buffer_state()); + status_buf.N_bytes = rlc2.read_pdu(status_buf.msg, 10); // 10 bytes is enough to hold the status + + // Write status PDU to RLC1 + rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); +#if HAVE_PCAP + pcap.write_ul_am_ccch(status_buf.msg, status_buf.N_bytes); +#endif + + // check status again + assert(0 == rlc1.get_buffer_state()); assert(0 == rlc2.get_buffer_state()); // Check number of SDUs and their content @@ -1441,11 +1451,11 @@ bool resegment_test_8() cnfg.ul_am_rlc.t_poll_retx = LIBLTE_RRC_T_POLL_RETRANSMIT_MS5; if (not rlc1.configure(&cnfg)) { - exit(-1); + return -1; } if (not rlc2.configure(&cnfg)) { - exit(-1); + return -1; } // Push 2 SDUs into RLC1 diff --git a/lib/test/upper/rlc_stress_test.cc b/lib/test/upper/rlc_stress_test.cc index b1bacd324..7e0407468 100644 --- a/lib/test/upper/rlc_stress_test.cc +++ b/lib/test/upper/rlc_stress_test.cc @@ -122,7 +122,7 @@ public: ,lcid(lcid_) ,log("MAC ") { - log.set_level(srslte::LOG_LEVEL_ERROR); + log.set_level(srslte::LOG_LEVEL_WARNING); log.set_hex_limit(LOG_HEX_LIMIT); } @@ -170,7 +170,7 @@ private: pcap->write_ul_am_ccch(pdu->msg, pdu->N_bytes); } } else { - log.info_hex(pdu->msg, pdu->N_bytes, "Dropping RLC PDU (%d B)\n", pdu->N_bytes); + log.warning_hex(pdu->msg, pdu->N_bytes, "Dropping RLC PDU (%d B)\n", pdu->N_bytes); } } byte_buffer_pool::get_instance()->deallocate(pdu); @@ -355,12 +355,20 @@ void stress_test(stress_test_args_t args) usleep(1e6); } + printf("Test finished, tearing down ..\n"); + // Stop RLC instances first to release blocking writers rlc1.stop(); rlc2.stop(); + printf("RLC entities stopped.\n"); + + // Stop upper layer writers tester1.stop(); tester2.stop(); + + printf("Writers stopped.\n"); + mac.stop(); if (args.write_pcap) { pcap.close(); @@ -387,7 +395,7 @@ void stress_test(stress_test_args_t args) int main(int argc, char **argv) { - stress_test_args_t args; + stress_test_args_t args = {}; parse_args(&args, argc, argv); if (args.zero_seed) {