From 4c7c82fbd067f4f54a5cf180fdb9db6a42e88741 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Fri, 26 Oct 2018 13:34:52 +0300 Subject: add tcpdump recipe for target Signed-off-by: Ilias Apalodimas --- execs/taprio-tcpdump.yaml | 14 ++++++++++++++ multinodes/lng03-lng04-ubuntu-18.04.yaml | 13 ++++++++++++- scripts/get-taprio-pcap.sh | 12 ++++++++++++ scripts/send-udp-tai.sh | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 execs/taprio-tcpdump.yaml create mode 100755 scripts/get-taprio-pcap.sh diff --git a/execs/taprio-tcpdump.yaml b/execs/taprio-tcpdump.yaml new file mode 100644 index 0000000..4d035ea --- /dev/null +++ b/execs/taprio-tcpdump.yaml @@ -0,0 +1,14 @@ +metadata: + name: capture tsn traffic + format: "Lava-Test-Shell Test Definition 1.0" + description: "Use tcpdump to capture packets" + version: 1.0 + +install: + deps: + - tcpdump + +run: + steps: + - echo "Capturing UDP packets" + - ./scripts/get-taprio-pcap.sh diff --git a/multinodes/lng03-lng04-ubuntu-18.04.yaml b/multinodes/lng03-lng04-ubuntu-18.04.yaml index 2ea2a47..1651b37 100644 --- a/multinodes/lng03-lng04-ubuntu-18.04.yaml +++ b/multinodes/lng03-lng04-ubuntu-18.04.yaml @@ -99,7 +99,6 @@ actions: path: execs/sync-clocks.yaml name: ptp-clock-sync - - test: role: - lng03 @@ -122,6 +121,18 @@ actions: path: execs/send-udp-tai.yaml name: send-udp-traffic +- test: + role: + - lng04 + timeout: + minutes: 900 + + definitions: + - repository: https://git.linaro.org/people/ilias.apalodimas/lava-sessions.git/ + from: git + path: execs/taprio-tcpdump.yaml + name: taprio-client-tcpdump + - test: role: - lng03 diff --git a/scripts/get-taprio-pcap.sh b/scripts/get-taprio-pcap.sh new file mode 100755 index 0000000..82d007b --- /dev/null +++ b/scripts/get-taprio-pcap.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +. scripts/lava-common.sh + +iface=$(find_vland_iface) +packets='600000' +port='7788' +lava-wait udp-tai-tx +# TODO make port/packet count configurable +tcpdump -c "$packets" -i "$iface" -w tsn.pcap -j adapter_unsynced -tt \ + --time-stamp-precision=nano port "$port" +echo "talker_strict :: udp port $port" > sched_filter diff --git a/scripts/send-udp-tai.sh b/scripts/send-udp-tai.sh index 8a609eb..7c74083 100755 --- a/scripts/send-udp-tai.sh +++ b/scripts/send-udp-tai.sh @@ -5,6 +5,7 @@ git clone https://github.com/apalos/taprio-tests.git pushd taprio-tests && make popd + now=`date +%s%N` i=$(($now + 37000000000)) base=$(($i - ($i % 1000000000) + 100000)) -- cgit v1.2.3