pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30184 )
Change subject: tests/osmux: Test incoming RTP stream with seqnum jumps during wraparound ......................................................................
tests/osmux: Test incoming RTP stream with seqnum jumps during wraparound
Related: SYS#6161 Change-Id: Idd3a609452767f9c480c7c5ba9fc2a3e0a499968 --- M tests/osmux/osmux_input_test.c M tests/osmux/osmux_input_test.ok 2 files changed, 51 insertions(+), 5 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve
diff --git a/tests/osmux/osmux_input_test.c b/tests/osmux/osmux_input_test.c index 66335cd..aaab557 100644 --- a/tests/osmux/osmux_input_test.c +++ b/tests/osmux/osmux_input_test.c @@ -515,7 +515,7 @@
*osmux_transmitted = true; } -static void test_rtp_pkt_gap(void) +static void test_rtp_pkt_gap(uint16_t rtp_start_seqnum) { struct msgb *msg; int rc; @@ -523,11 +523,11 @@ bool osmux_transmitted = false; struct osmux_in_handle *h_input;
- printf("===%s===\n", __func__); + printf("===%s(%" PRIu16 ")===\n", __func__, rtp_start_seqnum);
clock_override_enable(true); clock_override_set(0, 0); - rtp_init(60, 18000); + rtp_init(rtp_start_seqnum, 18000);
h_input = osmux_xfrm_input_alloc(tall_ctx); osmux_xfrm_input_set_initial_seqnum(h_input, 123); @@ -595,7 +595,11 @@ test_last_amr_cmr_f_q_used(); test_initial_osmux_seqnum(); test_rtp_dup(); - test_rtp_pkt_gap(); + test_rtp_pkt_gap(60); + /* Test several wraparound scenarios: */ + test_rtp_pkt_gap(65533); + test_rtp_pkt_gap(65534); + test_rtp_pkt_gap(65535);
fprintf(stdout, "OK: Test passed\n"); return EXIT_SUCCESS; diff --git a/tests/osmux/osmux_input_test.ok b/tests/osmux/osmux_input_test.ok index d119b62..652a6c8 100644 --- a/tests/osmux/osmux_input_test.ok +++ b/tests/osmux/osmux_input_test.ok @@ -37,7 +37,49 @@ sys={0.040000}, mono={0.040000}: OSMUX message (len=19): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=0 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
sys={0.040000}, mono={0.040000}: Closing circuit -===test_rtp_pkt_gap=== +===test_rtp_pkt_gap(60)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 2nd RTP packet is lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.020000}, mono={0.020000}: 3rd RTP packet is received +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.040000}, mono={0.040000}: 4th RTP packet is received +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.060000}, mono={0.060000}: osmux batch transmitted +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.080000}, mono={0.080000}: OSMUX message (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.080000}, mono={0.080000}: Closing circuit +===test_rtp_pkt_gap(65533)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 2nd RTP packet is lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.020000}, mono={0.020000}: 3rd RTP packet is received +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.040000}, mono={0.040000}: 4th RTP packet is received +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.060000}, mono={0.060000}: osmux batch transmitted +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.080000}, mono={0.080000}: OSMUX message (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.080000}, mono={0.080000}: Closing circuit +===test_rtp_pkt_gap(65534)=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 2nd RTP packet is lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.020000}, mono={0.020000}: 3rd RTP packet is received +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.040000}, mono={0.040000}: 4th RTP packet is received +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.060000}, mono={0.060000}: osmux batch transmitted +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.080000}, mono={0.080000}: OSMUX message (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.080000}, mono={0.080000}: Closing circuit +===test_rtp_pkt_gap(65535)=== sys={0.000000}, mono={0.000000}: clock_override_set sys={0.000000}, mono={0.000000}: 1st RTP packet is received sys={0.000000}, mono={0.000000}: 2nd RTP packet is lost