aboutsummaryrefslogtreecommitdiffstats
path: root/tests/osmux
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-07-07 14:13:16 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2016-07-07 14:13:16 +0200
commitf468e720ad7f564ca9e8d4c02848026fa1100e3d (patch)
treec6079029a5505716ecb1afbe47cccaac3b80ad54 /tests/osmux
parent85bc50cbde3beaf295336a8a874720c672629f91 (diff)
osmux-test: remove real-time constraint by default
Introduce a local #define to disable the real-time constraint from osmux-test. It would make sense to remove this completely, but in case anyone may be interested in the timing on a specific platform, I've just #defined it away. The real-time constraint to pass or fail the test is a bad idea in terms of our build server. Whenever the server is loaded, the tests will fail for no reason, like here: https://gerrit.osmocom.org/474 The real time to calculate is highly dependent also on the hardware platform. The arbitrarity of the time constraint is sort of proven by dd24cdd95f3fb8c8f which simply doubles the time to pass the test. Change-Id: Ic1da4bd22411652334f73195b2e37853e0738906
Diffstat (limited to 'tests/osmux')
-rw-r--r--tests/osmux/osmux_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c
index 6fb4dad..2f5a6cd 100644
--- a/tests/osmux/osmux_test.c
+++ b/tests/osmux/osmux_test.c
@@ -8,6 +8,8 @@
* (at your option) any later version.
*/
+#define OSMUX_TEST_USE_TIMING 0
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -15,7 +17,9 @@
#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>
@@ -51,11 +55,14 @@ static uint8_t rtp_pkt[] = {
};
static int rtp_pkts;
+#if OSMUX_TEST_USE_TIMING
static struct timeval last;
+#endif
static void tx_cb(struct msgb *msg, void *data)
{
char buf[4096];
+#if OSMUX_TEST_USE_TIMING
struct timeval now, diff;
gettimeofday(&now, NULL);
@@ -68,6 +75,7 @@ static void tx_cb(struct msgb *msg, void *data)
(unsigned int)diff.tv_usec);
exit(EXIT_FAILURE);
}
+#endif
osmo_rtp_snprintf(buf, sizeof(buf), msg);
fprintf(stderr, "extracted packet: %s\n", buf);
@@ -149,7 +157,9 @@ static void osmux_test_loop(int ccid)
osmux_xfrm_input(&h_input, msg, (i % 2) + ccid);
if (i % 4 == 0) {
+#if OSMUX_TEST_USE_TIMING
gettimeofday(&last, NULL);
+#endif
/* After four RTP messages, squash them into the OSMUX
* batch and call the routine to deliver it.