From 3c24f2c2edc0b114cfabffdb3ff3c10ccfa0aa83 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 3 Apr 2023 14:36:30 +0200 Subject: [PATCH] test: add option to dump traffic to pcaps This will be useful for debugging. --- test/simulation/test.common | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/simulation/test.common b/test/simulation/test.common index 70bbde1..3f6e80b 100644 --- a/test/simulation/test.common +++ b/test/simulation/test.common @@ -78,6 +78,7 @@ default_client_min_mean_out_interval=0.0 default_client_max_min_out_interval=inf default_cmdmon_unix=1 +default_pcap_dumps=0 default_dns=0 # Initialize test settings from their defaults @@ -469,6 +470,9 @@ run_test() { for i in $(seq 1 $n); do test_message 2 0 "starting node $node:" + + [ $pcap_dumps -ne 0 ] && export CLKNETSIM_PCAP_DUMP=tmp/pcap.$node + if [ $stratum -eq 1 ]; then step=$server_step start=$server_start @@ -509,6 +513,8 @@ run_test() { for i in $(seq 1 $[$nodes - $node + 1]); do test_message 2 0 "starting node $node:" + [ $pcap_dumps -ne 0 ] && export CLKNETSIM_PCAP_DUMP=tmp/pcap.$node + options=$([ $dns -eq 0 ] && printf "%s" "-n") if [ $cmdmon_unix -ne 0 ]; then options+=" -h /clknetsim/unix/$[$node - $clients]:1"