pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29520 )
Change subject: tests/osmux: Test rx of osmux seqnum wrap around ......................................................................
tests/osmux: Test rx of osmux seqnum wrap around
This test shows that there's a bug where the first RTP packet extracted from the received osmux batch with seqnum=0 has the M bit marked for no good reason.
Related: SYS#5987 Change-Id: Ida658c681e84878f209ab4965d8aa821a570a580 --- M tests/osmux/osmux_output_test.c M tests/osmux/osmux_output_test.ok 2 files changed, 42 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/tests/osmux/osmux_output_test.c b/tests/osmux/osmux_output_test.c index 46065fe..94d6a5b 100644 --- a/tests/osmux/osmux_output_test.c +++ b/tests/osmux/osmux_output_test.c @@ -390,6 +390,36 @@ talloc_free(h_output); }
+/* Test how the osmux_out_handle behaves when seqnum 0xff->0x00 is received */ +static void test_output_seqnum_wraparound(void) +{ + struct osmux_out_handle *h_output; + + printf("===test_output_seqnum_wraparound===\n"); + + clock_override_enable(true); + clock_override_set(0, 0); + osmux_init(0xff); + + h_output = osmux_xfrm_output_alloc(NULL); + osmux_xfrm_output_set_rtp_ssrc(h_output, 0x7000000); + osmux_xfrm_output_set_rtp_pl_type(h_output, 98); + osmux_xfrm_output_set_tx_cb(h_output, tx_cb, h_output); + h_output->rtp_seq = (uint16_t)50; + h_output->rtp_timestamp = (uint32_t)500; + h_output->osmux_seq_ack = 0xff; + + clock_debug("Sending osmux frame with seqnum=0"); + PULL_NEXT(h_output); + clock_override_add(0, 2*TIME_RTP_PKT_MS*1000); + osmo_select_main(0); + + clock_debug("flushing other RTP packets"); + osmux_xfrm_output_flush(h_output); + + talloc_free(h_output); +} + int main(int argc, char **argv) {
@@ -412,6 +442,7 @@ test_output_2together(); test_output_frame_lost(); test_output_flush(); + test_output_seqnum_wraparound();
fprintf(stdout, "OK: Test passed\n"); return EXIT_SUCCESS; diff --git a/tests/osmux/osmux_output_test.ok b/tests/osmux/osmux_output_test.ok index 53ab67d..f69c0a9 100644 --- a/tests/osmux/osmux_output_test.ok +++ b/tests/osmux/osmux_output_test.ok @@ -105,4 +105,15 @@ sys={0.040000}, mono={0.040000}: dequeue: seq=59 ts=1940 enqueued=2 sys={0.040000}, mono={0.040000}: dequeue: seq=60 ts=2100 enqueued=1 sys={0.040000}, mono={0.040000}: dequeue: seq=61 ts=2260 enqueued=0 +===test_output_seqnum_wraparound=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: Sending osmux frame with seqnum=0 +sys={0.000000}, mono={0.000000}: dequeue: seq=50 ts=500 M enqueued=5 +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.040000}, mono={0.040000}: dequeue: seq=51 ts=660 enqueued=4 +sys={0.040000}, mono={0.040000}: dequeue: seq=52 ts=820 enqueued=3 +sys={0.040000}, mono={0.040000}: flushing other RTP packets +sys={0.040000}, mono={0.040000}: dequeue: seq=53 ts=980 enqueued=2 +sys={0.040000}, mono={0.040000}: dequeue: seq=54 ts=1140 enqueued=1 +sys={0.040000}, mono={0.040000}: dequeue: seq=55 ts=1300 enqueued=0 OK: Test passed
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.