9
9
import time
10
10
11
11
from mfd_connect import SSHConnection
12
- from mtl_engine .RxTxApp import prepare_tcpdump
12
+ from mtl_engine .RxTxApp import prepare_tcpdump , prepare_netsniff
13
13
14
14
from . import rxtxapp_config
15
15
from .execute import log_fail , run
@@ -164,6 +164,7 @@ def execute_test(
164
164
rx_proc = None
165
165
tx_proc = None
166
166
tcpdump = prepare_tcpdump (capture_cfg , host )
167
+ netsniff = prepare_netsniff (capture_cfg , host )
167
168
168
169
try :
169
170
# Start RX pipeline first
@@ -190,10 +191,13 @@ def execute_test(
190
191
background = True ,
191
192
enable_sudo = True ,
192
193
)
193
- # Start tcpdump after pipelines are running
194
+ # Start packet capture when pipelines are running
194
195
if tcpdump :
195
196
logger .info ("Starting tcpdump capture..." )
196
197
tcpdump .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
198
+ if netsniff :
199
+ logger .info ("Starting netsniff-ng capture..." )
200
+ netsniff .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
197
201
198
202
# Let the test run for the specified duration
199
203
logger .info (f"Running test for { test_time } seconds..." )
@@ -263,6 +267,8 @@ def execute_test(
263
267
pass
264
268
if tcpdump :
265
269
tcpdump .stop ()
270
+ if netsniff :
271
+ netsniff .stop ()
266
272
passed = False
267
273
match output_format :
268
274
case "yuv" :
@@ -331,6 +337,7 @@ def execute_test_rgb24(
331
337
rx_proc = None
332
338
tx_proc = None
333
339
tcpdump = prepare_tcpdump (capture_cfg , host )
340
+ netsniff = prepare_netsniff (capture_cfg , host )
334
341
335
342
try :
336
343
# Start RX pipeline first
@@ -356,10 +363,13 @@ def execute_test_rgb24(
356
363
background = True ,
357
364
enable_sudo = True ,
358
365
)
359
- # Start tcpdump after pipelines are running
366
+ # Start packet capture when pipelines are running
360
367
if tcpdump :
361
368
logger .info ("Starting tcpdump capture..." )
362
369
tcpdump .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
370
+ if netsniff :
371
+ logger .info ("Starting netsniff-ng capture..." )
372
+ netsniff .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
363
373
364
374
logger .info (
365
375
f"Waiting for RX process to complete (test_time: { test_time } seconds)..."
@@ -437,6 +447,8 @@ def execute_test_rgb24(
437
447
pass
438
448
if tcpdump :
439
449
tcpdump .stop ()
450
+ if netsniff :
451
+ netsniff .stop ()
440
452
if not check_output_rgb24 (rx_output , 1 ):
441
453
log_fail ("rx video sessions failed" )
442
454
return False
@@ -506,6 +518,7 @@ def execute_test_rgb24_multiple(
506
518
tx_1_proc = None
507
519
tx_2_proc = None
508
520
tcpdump = prepare_tcpdump (capture_cfg , host )
521
+ netsniff = prepare_netsniff (capture_cfg , host )
509
522
510
523
try :
511
524
rx_proc = run (
@@ -538,10 +551,13 @@ def execute_test_rgb24_multiple(
538
551
background = True ,
539
552
enable_sudo = True ,
540
553
)
541
- # Start tcpdump after pipelines are running
554
+ # Start packet capture when pipelines are running
542
555
if tcpdump :
543
556
logger .info ("Starting tcpdump capture..." )
544
557
tcpdump .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
558
+ if netsniff :
559
+ logger .info ("Starting netsniff-ng capture..." )
560
+ netsniff .capture (capture_time = capture_cfg .get ("capture_time" , test_time ))
545
561
546
562
logger .info (f"Waiting for RX process (test_time: { test_time } seconds)..." )
547
563
rx_proc .wait ()
@@ -611,6 +627,8 @@ def execute_test_rgb24_multiple(
611
627
pass
612
628
if tcpdump :
613
629
tcpdump .stop ()
630
+ if netsniff :
631
+ netsniff .stop ()
614
632
if not check_output_rgb24 (rx_output , 2 ):
615
633
log_fail ("rx video session failed" )
616
634
return False
0 commit comments