pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29505 )
Change subject: tests/osmux: Always run with fake time
......................................................................
tests/osmux: Always run with fake time
Let's not make the tests more difficult to maintain and extend by
allowing them to run in real clock time, there's no real need for it.
Change-Id: I549a4722d63d700b54b146260131a68e656b843e
---
M tests/osmux/osmux_test.c
1 file changed, 1 insertion(+), 36 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/05/29505/1
diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c
index 54e9368..3284a15 100644
--- a/tests/osmux/osmux_test.c
+++ b/tests/osmux/osmux_test.c
@@ -1,6 +1,7 @@
/*
* (C) 2013 by Pablo Neira Ayuso <pablo(a)gnumonks.org>
* (C) 2013 by On Waves ehf <http://www.on-waves.com>
+ * (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -8,8 +9,6 @@
* (at your option) any later version.
*/
-#define OSMUX_TEST_USE_TIMING 0
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -17,9 +16,6 @@
#include <string.h>
#include <signal.h>
#include <arpa/inet.h>
-#if OSMUX_TEST_USE_TIMING
-#include <sys/time.h>
-#endif
#include <osmocom/core/select.h>
#include <osmocom/core/application.h>
@@ -59,9 +55,6 @@
static int rtp_pkts;
static int mark_pkts;
-#if OSMUX_TEST_USE_TIMING
-static struct timeval last;
-#endif
#define clock_debug(fmt, args...) \
do { \
@@ -92,20 +85,6 @@
{
struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data;
char buf[4096];
-#if OSMUX_TEST_USE_TIMING
- struct timeval now, diff;
-
- osmo_gettimeofday(&now, NULL);
- timersub(&now, &last, &diff);
- last = now;
-
- if (diff.tv_usec > 2*17000) {
- clock_debug("delivery of reconstructed RTP lagged"
- " (diff.tv_usec=%u > 2*17000)\n",
- (unsigned int)diff.tv_usec);
- exit(EXIT_FAILURE);
- }
-#endif
osmo_rtp_snprintf(buf, sizeof(buf), msg);
clock_debug("extracted packet: %s\n", buf);
@@ -185,15 +164,11 @@
osmux_xfrm_input_deliver(&h_input);
}
}
-#if !OSMUX_TEST_USE_TIMING
clock_override_add(0, PKT_TIME_USEC);
-#endif
}
while (rtp_pkts) {
-#if !OSMUX_TEST_USE_TIMING
clock_override_add(1, 0);
-#endif
osmo_select_main(0);
}
@@ -242,10 +217,6 @@
osmux_xfrm_input(&h_input, msg, (i % 2) + ccid);
if (i % 4 == 0) {
-#if OSMUX_TEST_USE_TIMING
- osmo_gettimeofday(&last, NULL);
-#endif
-
/* After four RTP messages, squash them into the OSMUX
* batch and call the routine to deliver it.
*/
@@ -258,9 +229,7 @@
*/
for (j = 0; j < k-2; j++) {
osmo_select_main(0);
-#if !OSMUX_TEST_USE_TIMING
clock_override_add(0, PKT_TIME_USEC);
-#endif
}
k = 0;
@@ -282,11 +251,9 @@
exit(EXIT_FAILURE);
}
-#if !OSMUX_TEST_USE_TIMING
/* This test uses fake time to speedup the run, unless we want to manually
* test time specific stuff */
clock_override_enable(true);
-#endif
/* This test doesn't use it, but osmux requires it internally. */
void *tall_ctx = talloc_named_const(NULL, 1, "Root context");
@@ -309,7 +276,6 @@
/* If the test takes longer than 10 seconds, abort it */
alarm(10);
-#if !OSMUX_TEST_USE_TIMING
/* Check if marker bit features work correctly */
osmux_xfrm_input_init(&h_input);
for (i = 0; i < 4; i++)
@@ -318,7 +284,6 @@
for (i = 0; i < 4; i++)
osmux_xfrm_input_close_circuit(&h_input, i);
osmux_xfrm_input_fini(&h_input);
-#endif
osmux_xfrm_input_init(&h_input);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29505
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I549a4722d63d700b54b146260131a68e656b843e
Gerrit-Change-Number: 29505
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29504 )
Change subject: tests/osmux_test2: Document unit tests
......................................................................
tests/osmux_test2: Document unit tests
Change-Id: I56f27af52b6a8d798879c70d68a9a3b9e512867d
---
M tests/osmux/osmux_test2.c
1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/04/29504/1
diff --git a/tests/osmux/osmux_test2.c b/tests/osmux/osmux_test2.c
index 7a66920..421dac4 100644
--- a/tests/osmux/osmux_test2.c
+++ b/tests/osmux/osmux_test2.c
@@ -155,6 +155,7 @@
OSMO_ASSERT(_rc == _osmuxh->ctr+1); \
}
+/* Test some regular scenario where frames arrive at exactly the time they should. */
static void test_output_consecutive(void)
{
struct osmux_out_handle *h_output;
@@ -222,6 +223,12 @@
talloc_free(h_output);
}
+/* Test that receiving new osmux frame triggers flushing of RTP pakcets
+ * generated from previous one, to avoid steady growing delay in scheduling due to
+ * jitter of osmux packets received. Specifically test case where the 2 Osmux
+ * packets arrive with a small delay of system time in between them, aka the 1st
+ * Osmux frame has had some of its AMR payloads already forwarded as RTP to the
+ * upper layers. */
static void test_output_interleaved(void)
{
struct osmux_out_handle *h_output;
@@ -264,6 +271,11 @@
talloc_free(h_output);
}
+/* Test that receiving new osmux frame triggers flushing of RTP pakcets
+ * generated from previous one, to avoid steady growing delay in scheduling due to
+ * jitter of osmux packets received. Specifically test case where the 2 Osmux
+ * packets arrive (almost) exactly at the same time, so no internal acton is
+ * triggered between receival of those. */
static void test_output_2together(void)
{
struct osmux_out_handle *h_output;
@@ -302,7 +314,8 @@
talloc_free(h_output);
}
-/* FIXME: this test shows generated rtp stream doesn't have osmux lost frames into account! */
+/* Generated rtp stream gets first RTP pkt marked with M bit after osmux frame
+ * lost is detected (hence a gap in sequence) */
static void test_output_frame_lost(void)
{
struct osmux_out_handle *h_output;
@@ -340,6 +353,8 @@
talloc_free(h_output);
}
+/* Test all packets are transmitted immediately when osmux_xfrm_output_flush()
+ * is flushed. */
static void test_output_flush(void)
{
struct osmux_out_handle *h_output;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29504
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I56f27af52b6a8d798879c70d68a9a3b9e512867d
Gerrit-Change-Number: 29504
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-gprs/+/29482
to look at the new patch set (#4).
Change subject: llc: implement Exchange Identification (XID) codec
......................................................................
llc: implement Exchange Identification (XID) codec
Change-Id: I16b3f7ab82c489144098aad0dccc4c67d8382c67
---
M include/osmocom/gprs/llc/llc.h
M src/llc/llc_xid.c
M tests/llc/pdu_codec_test.c
M tests/llc/pdu_codec_test.ok
4 files changed, 403 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/82/29482/4
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/29482
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I16b3f7ab82c489144098aad0dccc4c67d8382c67
Gerrit-Change-Number: 29482
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29502 )
Change subject: osmux: assert no batch factor greater than 8 is used
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29502
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie17a8174bc220d091cb7ff880363d22179b4f621
Gerrit-Change-Number: 29502
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 28 Sep 2022 08:33:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29501 )
Change subject: osmux: Early return on error or batch full during osmux_replay_lost_packets()
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29501
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I62f494d2b2e7903a6683f6dea00781bb721a3d41
Gerrit-Change-Number: 29501
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 28 Sep 2022 08:33:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment