aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-04-19 13:30:10 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-14 19:34:31 +0200
commit032b950b30aa382cc3716d40d3a58c2b5d140c0e (patch)
tree4f3474e24bd3b11313672f7ae212391fe6595aa5
parentf28e85d48ff0048500625e6d67232443a0e1cfae (diff)
tests: jibuf: Improve jibuf_test to read pcaps
Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
-rw-r--r--tests/Makefile.am16
-rw-r--r--tests/jibuf/jibuf_test.c367
-rw-r--r--tests/jibuf/jitter.plt32
-rw-r--r--tests/testsuite.at2
4 files changed, 308 insertions, 109 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bf1db1f..06fece0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,8 +6,20 @@ check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test
osmux_osmux_test_SOURCES = osmux/osmux_test.c
osmux_osmux_test_LDADD = $(LIBOSMOCORE_LIBS) $(top_builddir)/src/libosmonetif.la
-jibuf_jibuf_test_SOURCES = jibuf/jibuf_test.c
-jibuf_jibuf_test_LDADD = $(LIBOSMOCORE_LIBS) $(top_builddir)/src/libosmonetif.la
+jibuf_jibuf_test_SOURCES = \
+ jibuf/jibuf_test.c \
+ osmo-pcap-test/proto.c \
+ osmo-pcap-test/l2_eth.c \
+ osmo-pcap-test/l2_sll.c \
+ osmo-pcap-test/l3_ipv4.c \
+ osmo-pcap-test/l4_tcp.c \
+ osmo-pcap-test/l4_udp.c \
+ osmo-pcap-test/pcap.c
+
+jibuf_jibuf_test_LDADD = \
+ $(LIBOSMOCORE_LIBS) \
+ $(top_builddir)/src/libosmonetif.la \
+ -lpcap
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
diff --git a/tests/jibuf/jibuf_test.c b/tests/jibuf/jibuf_test.c
index 35cca19..4a09267 100644
--- a/tests/jibuf/jibuf_test.c
+++ b/tests/jibuf/jibuf_test.c
@@ -16,6 +16,7 @@
#include <signal.h>
#include <arpa/inet.h>
#include <sys/time.h>
+#include <getopt.h>
#include <osmocom/core/select.h>
#include <osmocom/core/application.h>
@@ -25,8 +26,38 @@
#include <osmocom/netif/jibuf.h>
#include <osmocom/netif/rtp.h>
-#define DJBT 0
+#include "../osmo-pcap-test/osmo_pcap.h"
+
+
+struct checkpoint {
+ struct timeval ts;
+ int transit;
+ double jitter;
+ uint32_t timestamp;
+};
+
+struct rtp_pkt_info {
+ struct osmo_timer_list timer;
+ struct timeval tx_prev_time;
+ struct timeval tx_time;
+ uint32_t tx_delay;
+ struct checkpoint prequeue;
+ struct checkpoint postqueue;
+};
+
+struct rtp_pkt_info_cb {
+ struct rtp_pkt_info *data;
+};
+
+/* Option parameters to the program */
+static bool opt_test_rand;
+static bool opt_debug_human;
+static bool opt_debug_table;
+static char* opt_pcap_file;
+/* ----------------------------- */
+/* Logging related stuff */
+#define DJBT 0
struct log_info_cat jibuf_test_cat[] = {
[DJBT] = {
.name = "DJIBUF_TEST",
@@ -37,15 +68,23 @@ struct log_info_cat jibuf_test_cat[] = {
[DLMIB*-1 -1] = {
.name = "DLMIB",
.description = "A-bis Input Driver for B-Channels (voice)",
- .enabled = 1, .loglevel = LOGL_ERROR,
+ .enabled = 1, .loglevel = LOGL_DEBUG,
},
};
-
const struct log_info jibuf_test_log_info = {
.filter_fn = NULL,
.cat = jibuf_test_cat,
.num_cat = ARRAY_SIZE(jibuf_test_cat),
};
+/* ----------------------------- */
+
+/* Used for test random: */
+#define SAMPLES_PER_PKT 160
+#define RTP_FREQ_MS 20
+#define RTP_PKTS_PER_SEC (1000/RTP_FREQ_MS)
+#define NET_DELAY_MS 300
+#define GENERATED_JITTER_MS 160
+#define NUM_PACKETS_TO_SEND 1000
/* RTP packet with AMR payload */
static uint8_t rtp_pkt[] = {
@@ -55,51 +94,28 @@ static uint8_t rtp_pkt[] = {
0xf2, 0x26, 0x33, 0x65, 0x54,
};
+static struct jibuf *jb;
+static uint16_t rtp_first_seq;
+static uint16_t rtp_next_seq;
+static uint32_t rtp_next_ts;
+static struct timeval tx_prev_time;
+static uint32_t packets_sent;
+static uint32_t packets_received;
+static uint32_t packets_dropped;
+static uint32_t packets_too_much_jitter;
+/* ----------------------------- */
+
+/* Used for test pcap: */
+static struct osmo_pcap osmo_pcap;
+static bool pcap_finished;
+/* ----------------------------- */
+
static void sigalarm_handler(int foo)
{
printf("FAIL: test did not run successfully\n");
exit(EXIT_FAILURE);
}
-#define SAMPLES_PER_PKT 160
-#define RTP_FREQ_MS 20
-#define RTP_PKTS_PER_SEC (1000/RTP_FREQ_MS)
-#define NET_DELAY_MS 300
-#define GENERATED_JITTER_MS 160
-#define NUM_PACKETS_TO_SEND 1000
-
-#define TRACE_PACKE_DEBUG 0
-#define TRACE_PACKET_GNUPLOT 1
-#define TRACE_PACKET_TEST_JITTER 0
-
-struct checkpoint {
- struct timeval ts;
- int transit;
- double jitter;
-};
-
-struct rtp_pkt_info {
- struct osmo_timer_list timer;
- struct timeval tx_prev_time;
- struct timeval tx_time;
- uint32_t tx_delay;
- struct checkpoint prequeue;
- struct checkpoint postqueue;
-};
-
-struct rtp_pkt_info_cb {
- struct rtp_pkt_info *data;
-};
-
-struct jibuf *jb;
-uint16_t rtp_first_seq;
-uint16_t rtp_next_seq;
-uint32_t rtp_next_ts;
-uint32_t packets_sent;
-uint32_t packets_received;
-uint32_t packets_dropped;
-uint32_t packets_too_much_jitter;
-
struct rtp_pkt_info *msgb_get_pinfo(struct msgb* msg)
{
struct rtp_pkt_info_cb *cb = (struct rtp_pkt_info_cb *)&((msg)->cb[0]);
@@ -111,14 +127,16 @@ static uint32_t timeval2ms(const struct timeval *ts)
return ts->tv_sec * 1000 + ts->tv_usec / 1000;
}
-int calc_relative_transmit_time(struct timeval *tx_0, struct timeval *tx_f,
- struct timeval *rx_0, struct timeval *rx_f)
+int32_t calc_rel_transmit_time(uint32_t tx_0, uint32_t tx_f, uint32_t rx_0, uint32_t rx_f, bool tx_is_samples, bool pre)
{
- struct timeval txdiff, rxdiff, diff;
- timersub(rx_f, rx_0, &rxdiff);
- timersub(tx_f, tx_0, &txdiff);
- timersub(&rxdiff, &txdiff, &diff);
- return timeval2ms(&diff);
+ int32_t rxdiff, txdiff, res;
+ rxdiff = (rx_f - rx_0);
+ txdiff = (tx_f - tx_0);
+ if(tx_is_samples)
+ txdiff = txdiff * RTP_FREQ_MS/SAMPLES_PER_PKT;
+ res = rxdiff - txdiff;
+ //fprintf(stderr, "%s: (%u - %u) - (%u - %u) = %d - %d (%d) = %d\n", (pre ? "pre" : "post"), rx_f, rx_0, tx_f, tx_0, rxdiff, txdiff, (tx_f - tx_0), res);
+ return res;
}
void trace_pkt(struct msgb *msg, char* info) {
@@ -129,7 +147,7 @@ void trace_pkt(struct msgb *msg, char* info) {
gettimeofday(&now, NULL);
timersub(&now, &pinfo->tx_time, &total_delay);
-#if TRACE_PACKET_DEBUG
+ if (opt_debug_human) {
uint32_t total_delay_ms = timeval2ms(&total_delay);
LOGP(DJBT, LOGL_DEBUG, "%s: seq=%"PRIu16" ts=%"PRIu32" (%ld.%06ld) tx_delay=%"PRIu32 \
" end_delay=%"PRIu32" pre_trans=%d pre_jitter=%f post_trans=%d post_jitter=%f\n",
@@ -138,9 +156,21 @@ void trace_pkt(struct msgb *msg, char* info) {
pinfo->tx_delay, total_delay_ms,
pinfo->prequeue.transit, pinfo->prequeue.jitter,
pinfo->postqueue.transit, pinfo->postqueue.jitter);
-#endif
-#if TRACE_PACKET_GNUPLOT
+ if (pinfo->prequeue.jitter < pinfo->postqueue.jitter)
+ LOGP(DJBT, LOGL_ERROR, "JITTER HIGHER THAN REF: seq=%"PRIu16" ts=%"PRIu32 \
+ " (%ld.%06ld) tx_delay=%"PRIu32" end_delay=%"PRIu32 \
+ " pre_trans=%d pre_jitter=%f post_trans=%d post_jitter=%f dropped=%"PRIu32 \
+ " buffer=%"PRIu32"\n",
+ ntohs(rtph->sequence), ntohl(rtph->timestamp),
+ pinfo->tx_time.tv_sec, pinfo->tx_time.tv_usec,
+ pinfo->tx_delay, total_delay_ms,
+ pinfo->prequeue.transit, pinfo->prequeue.jitter,
+ pinfo->postqueue.transit, pinfo->postqueue.jitter,
+ packets_dropped, jb->threshold_delay);
+ }
+
+ if (opt_debug_table) {
/* Used as input for gplot: "gnuplot -p jitter.plt -"" */
uint32_t tx_time_ms = timeval2ms(&pinfo->tx_time);
uint32_t prequeue_time_ms = timeval2ms(&pinfo->prequeue.ts);
@@ -151,7 +181,7 @@ void trace_pkt(struct msgb *msg, char* info) {
pinfo->prequeue.transit, pinfo->postqueue.transit,
pinfo->prequeue.jitter, pinfo->postqueue.jitter,
packets_dropped, jb->threshold_delay);
-#endif
+ }
}
void pkt_add_result(struct msgb *msg, bool dropped)
@@ -165,21 +195,8 @@ void pkt_add_result(struct msgb *msg, bool dropped)
packets_received++;
trace_pkt(msg,"received");
- if (pinfo->prequeue.jitter < pinfo->postqueue.jitter) {
+ if (pinfo->prequeue.jitter < pinfo->postqueue.jitter)
packets_too_much_jitter++;
-#if TRACE_PACKET_TEST_JITTER
- LOGP(DJBT, LOGL_ERROR, "JITTER HIGHER THAN REF: %s seq=%"PRIu16" ts=%"PRIu32 \
- " (%ld.%06ld) tx_delay=%"PRIu32" end_delay=%"PRIu32 \
- " pre_trans=%d pre_jitter=%f post_trans=%d post_jitter=%f dropped=%"PRIu32 \
- " buffer=%"PRIu32"\n",
- info, ntohs(rtph->sequence), ntohl(rtph->timestamp),
- pinfo->tx_time.tv_sec, pinfo->tx_time.tv_usec,
- pinfo->tx_delay, total_delay_ms,
- pinfo->prequeue.transit, pinfo->prequeue.jitter,
- pinfo->postqueue.transit, pinfo->postqueue.jitter,
- packets_dropped, jb->threshold_delay);
-#endif
- }
}
}
@@ -188,14 +205,30 @@ void dequeue_cb(struct msgb *msg, void *data)
static struct checkpoint postqueue_prev;
static bool postqueue_started = false;
+ bool tx_is_samples;
+ struct rtp_hdr *rtph = osmo_rtp_get_hdr(msg);
struct rtp_pkt_info *pinfo = msgb_get_pinfo(msg);
+ uint32_t tx1, tx0, rx0, rx1;
+
gettimeofday(&pinfo->postqueue.ts, NULL);
+ pinfo->postqueue.timestamp = htonl(rtph->timestamp);
if (postqueue_started) {
- pinfo->postqueue.transit = calc_relative_transmit_time(
- &pinfo->tx_prev_time, &pinfo->tx_time,
- &postqueue_prev.ts, &pinfo->postqueue.ts);
+ /* In random test mode we now the sender time, so we get real
+ * jitter results using it */
+ if(opt_test_rand) {
+ tx0 = timeval2ms(&pinfo->tx_prev_time);
+ tx1 = timeval2ms(&pinfo->tx_time);
+ tx_is_samples = false;
+ } else {
+ tx0 = postqueue_prev.timestamp;
+ tx1 = pinfo->postqueue.timestamp;
+ tx_is_samples = true;
+ }
+ rx0 = timeval2ms(&postqueue_prev.ts);
+ rx1 = timeval2ms(&pinfo->postqueue.ts);
+ pinfo->postqueue.transit = calc_rel_transmit_time(tx0, tx1, rx0, rx1, tx_is_samples, 0);
uint32_t abs_transit = pinfo->postqueue.transit *
( pinfo->postqueue.transit >= 0 ? 1 : -1 );
@@ -221,15 +254,32 @@ void pkt_arrived_cb(void *data)
static struct checkpoint prequeue_prev;
static bool prequeue_started = false;
+ bool tx_is_samples;
struct msgb *msg = (struct msgb*) data;
+ struct rtp_hdr *rtph = osmo_rtp_get_hdr(msg);
struct rtp_pkt_info *pinfo = msgb_get_pinfo(msg);
+
+ uint32_t tx1, tx0, rx0, rx1;
+
gettimeofday(&pinfo->prequeue.ts, NULL);
+ pinfo->prequeue.timestamp = htonl(rtph->timestamp);
if (prequeue_started) {
- pinfo->prequeue.transit = calc_relative_transmit_time(
- &pinfo->tx_prev_time, &pinfo->tx_time,
- &prequeue_prev.ts, &pinfo->prequeue.ts);
+ /* In random test mode we now the sender time, so we get real
+ * jitter results using it */
+ if(opt_test_rand) {
+ tx0 = timeval2ms(&pinfo->tx_prev_time);
+ tx1 = timeval2ms(&pinfo->tx_time);
+ tx_is_samples = false;
+ } else {
+ tx0 = prequeue_prev.timestamp;
+ tx1 = pinfo->prequeue.timestamp;
+ tx_is_samples = true;
+ }
+ rx0 = timeval2ms(&prequeue_prev.ts);
+ rx1 = timeval2ms(&pinfo->prequeue.ts);
+ pinfo->prequeue.transit = calc_rel_transmit_time(tx0, tx1, rx0, rx1, tx_is_samples, 1);
uint32_t abs_transit = pinfo->prequeue.transit *
( pinfo->prequeue.transit >= 0 ? 1 : -1 );
@@ -253,9 +303,15 @@ void pkt_arrived_cb(void *data)
}
}
+struct rtp_pkt_info * msgb_allocate_pinfo(struct msgb *msg)
+{
+ struct rtp_pkt_info_cb *cb = (struct rtp_pkt_info_cb *)&((msg)->cb[0]);
+ cb->data = (struct rtp_pkt_info *) talloc_zero(msg, struct rtp_pkt_info);
+ return cb->data;
+}
+
void send_rtp_packet()
{
- static struct timeval tx_prev_time;
struct rtp_pkt_info *pinfo;
struct rtp_hdr *rtph;
@@ -285,9 +341,7 @@ void send_rtp_packet()
rtph->timestamp = htonl(rtp_next_ts);
rtp_next_ts += SAMPLES_PER_PKT;
- pinfo = talloc_zero(msg, struct rtp_pkt_info);
- struct rtp_pkt_info_cb *cb = (struct rtp_pkt_info_cb *)&((msg)->cb[0]);
- cb->data = pinfo;
+ pinfo = msgb_allocate_pinfo(msg);
gettimeofday(&pinfo->tx_time, NULL);
pinfo->tx_prev_time = tx_prev_time;
@@ -303,9 +357,9 @@ void send_rtp_packet()
osmo_timer_schedule(&pinfo->timer, 0, pinfo->tx_delay * 1000);
}
-void generate_pkt_cb(void *data)
+void rand_generate_pkt_cb(void *data)
{
- static struct osmo_timer_list enqueue_timer = {.cb = generate_pkt_cb, .data = NULL};
+ static struct osmo_timer_list enqueue_timer = {.cb = rand_generate_pkt_cb, .data = NULL};
static struct timeval last_generated;
struct timeval time_rate = { .tv_sec = 0, .tv_usec = RTP_FREQ_MS * 1000};
@@ -325,37 +379,56 @@ void generate_pkt_cb(void *data)
}
}
-void check_results()
+
+static int pcap_generate_pkt_cb(struct msgb *msg)
+{
+ struct rtp_pkt_info *pinfo;
+ /* Set fake prev_time for 1st packet. Otherwise transit calculations for first
+ * packet can be really weird if they not arrive in order */
+ if (!packets_sent) {
+ struct timeval now, time_rate = { .tv_sec = 0, .tv_usec = RTP_FREQ_MS * 1000};
+ gettimeofday(&now, NULL);
+ timersub(&now, &time_rate, &tx_prev_time);
+ }
+
+ pinfo = msgb_allocate_pinfo(msg);
+ gettimeofday(&pinfo->tx_time, NULL);
+ pinfo->tx_prev_time = tx_prev_time;
+
+ tx_prev_time = pinfo->tx_time;
+ packets_sent++;
+ pkt_arrived_cb(msg);
+ return 0;
+}
+
+void pcap_pkt_timer_cb(void *data)
+{
+ if (osmo_pcap_test_run(&osmo_pcap, IPPROTO_UDP, pcap_generate_pkt_cb) < 0) {
+ osmo_pcap_stats_printf();
+ osmo_pcap_test_close(osmo_pcap.h);
+ pcap_finished=true;
+ }
+}
+
+void rand_test_check()
{
uint32_t drop_threshold = NUM_PACKETS_TO_SEND * 5 / 100;
if (packets_dropped > drop_threshold) {
fprintf(stdout, "Too many dropped packets (%"PRIu32" > %"PRIu32")\n",
packets_dropped, drop_threshold);
- exit(1);
+ exit(EXIT_FAILURE);
}
uint32_t jitter_high_threshold = NUM_PACKETS_TO_SEND * 8 / 100;
if (packets_too_much_jitter > jitter_high_threshold) {
fprintf(stdout, "Too many packets with higher jitter (%"PRIu32" > %"PRIu32")\n",
packets_too_much_jitter, jitter_high_threshold);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
-int main(void)
+void rand_test()
{
-
- if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) {
- perror("signal");
- exit(EXIT_FAILURE);
- }
-
- /* This test doesn't use it, but jibuf requires it internally. */
- osmo_init_logging(&jibuf_test_log_info);
- log_set_category_filter(osmo_stderr_target, DLMIB, 1, LOGL_ERROR);
- log_set_print_filename(osmo_stderr_target, 0);
- log_set_log_level(osmo_stderr_target, LOGL_INFO);
-
srandom(time(NULL));
rtp_first_seq = (uint16_t) random();
rtp_next_seq = rtp_first_seq;
@@ -367,7 +440,8 @@ int main(void)
osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL);
- generate_pkt_cb(NULL);
+ /* first run */
+ rand_generate_pkt_cb(NULL);
/* If the test takes longer than twice the time needed to generate the packets
plus 10 seconds, abort it */
@@ -378,7 +452,106 @@ int main(void)
osmo_jibuf_delete(jb);
- check_results();
+ rand_test_check();
+}
+
+void pcap_test_check() {
+
+}
+
+void pcap_test() {
+ osmo_pcap_init();
+
+ osmo_pcap.h = osmo_pcap_test_open(opt_pcap_file);
+ if (osmo_pcap.h == NULL)
+ exit(EXIT_FAILURE);
+
+ osmo_pcap.timer.cb = pcap_pkt_timer_cb;
+
+ jb = osmo_jibuf_alloc();
+ osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL);
+ osmo_jibuf_set_min_delay(jb, 60);
+ osmo_jibuf_set_max_delay(jb, 500);
+
+ /* first run */
+ pcap_pkt_timer_cb(NULL);
+
+ while(!pcap_finished || !osmo_jibuf_empty(jb))
+ osmo_select_main(0);
+
+ osmo_jibuf_delete(jb);
+
+ pcap_test_check();
+}
+
+static void print_help(void)
+{
+ printf("jibuf_test [-r] [-p pcap] [-d] [-g]\n");
+ printf(" -h Print this help message\n");
+ printf(" -r Run test with randomly generated jitter\n");
+ printf(" -p Run test with specified pcap file\n");
+ printf(" -d Enable packet trace debug suitable for humans\n");
+ printf(" -t Enable packet trace debug suitable for gnuplot\n");
+}
+
+static int parse_options(int argc, char **argv)
+{
+ int opt;
+
+ while ((opt = getopt(argc, argv, "hdtrp:")) != -1) {
+ switch (opt) {
+ case 'h':
+ print_help();
+ return -1;
+ case 'd':
+ opt_debug_human = true;
+ break;
+ case 't':
+ opt_debug_table = true;
+ break;
+ case 'r':
+ opt_test_rand = true;
+ break;
+ case 'p':
+ opt_pcap_file = strdup(optarg);
+ break;
+ default:
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+
+ if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) {
+ perror("signal");
+ exit(EXIT_FAILURE);
+ }
+
+ if(parse_options(argc, argv) < 0)
+ exit(EXIT_FAILURE);
+
+ osmo_init_logging(&jibuf_test_log_info);
+ log_set_print_filename(osmo_stderr_target, 0);
+ log_set_log_level(osmo_stderr_target, LOGL_DEBUG);
+
+ if(opt_debug_human && !opt_debug_table)
+ log_set_category_filter(osmo_stderr_target, DLMIB, 1, LOGL_DEBUG);
+
+ if(opt_pcap_file && opt_test_rand) {
+ print_help();
+ exit(EXIT_FAILURE);
+ }
+
+
+ if(opt_pcap_file)
+ pcap_test();
+
+ if(opt_test_rand)
+ rand_test();
fprintf(stdout, "OK: Test passed\n");
return EXIT_SUCCESS;
diff --git a/tests/jibuf/jitter.plt b/tests/jibuf/jitter.plt
index f53b4a5..52259fc 100644
--- a/tests/jibuf/jitter.plt
+++ b/tests/jibuf/jitter.plt
@@ -23,12 +23,26 @@ set ytics nomirror
#set y2label 'delay [ms]'
#set y2tics nomirror
-plot \
- '/tmp/bla' using 3:5 with linespoints title 'pre.trans' axes x1y1, \
- '/tmp/bla' using 4:6 with linespoints title 'post.trans' axes x1y1, \
- '/tmp/bla' using 3:7 with linespoints title 'pre.jitter' axes x1y1, \
- '/tmp/bla' using 4:8 with linespoints title 'post.jitter' axes x1y1, \
- '/tmp/bla' using 3:9 with linespoints title 'pre.dropped' axes x1y1, \
- '/tmp/bla' using 3:10 with linespoints title 'pre.buffer' axes x1y1, \
- '/tmp/bla' using 3:((column(3)-column(2))) with linespoints title 'pre.delay' axes x1y1, \
- '/tmp/bla' using 4:((column(4)-column(2))) with linespoints title 'post.delay' axes x1y1
+# For pcap based input, 'pre.delay' makes no sense (it's 0) as we can't know tx_delay
+pcap = 1
+if (pcap) {
+ plot \
+ '/tmp/bla' using 3:5 with linespoints title 'pre.trans' axes x1y1, \
+ '/tmp/bla' using 4:6 with linespoints title 'post.trans' axes x1y1, \
+ '/tmp/bla' using 3:7 with linespoints title 'pre.jitter' axes x1y1, \
+ '/tmp/bla' using 4:8 with linespoints title 'post.jitter' axes x1y1, \
+ '/tmp/bla' using 3:9 with linespoints title 'pre.dropped' axes x1y1, \
+ '/tmp/bla' using 3:10 with linespoints title 'pre.buffer' axes x1y1, \
+ '/tmp/bla' using 4:((column(4)-column(2))) with linespoints title 'post.delay' axes x1y1
+
+} else {
+ plot \
+ '/tmp/bla' using 3:5 with linespoints title 'pre.trans' axes x1y1, \
+ '/tmp/bla' using 4:6 with linespoints title 'post.trans' axes x1y1, \
+ '/tmp/bla' using 3:7 with linespoints title 'pre.jitter' axes x1y1, \
+ '/tmp/bla' using 4:8 with linespoints title 'post.jitter' axes x1y1, \
+ '/tmp/bla' using 3:9 with linespoints title 'pre.dropped' axes x1y1, \
+ '/tmp/bla' using 3:10 with linespoints title 'pre.buffer' axes x1y1, \
+ '/tmp/bla' using 3:((column(3)-column(2))) with linespoints title 'pre.delay' axes x1y1, \
+ '/tmp/bla' using 4:((column(4)-column(2))) with linespoints title 'post.delay' axes x1y1
+}
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 81d40ba..7dc8075 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -10,5 +10,5 @@ AT_CLEANUP
AT_SETUP([jibuf_test])
AT_KEYWORDS([jibuf_test])
cat $abs_srcdir/jibuf/jibuf_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/jibuf/jibuf_test], [0], [expout], [ignore])
+AT_CHECK([$abs_top_builddir/tests/jibuf/jibuf_test -r -t], [0], [expout], [ignore])
AT_CLEANUP