# @name Worstcase Latency with net and USB load by using cyclictest
# @desc Measure latency under USB and Ethernet IO load using cyclictest
# @requires armv* && net && (usb/host || usbxhci/host)
# @setup_requires
# @notes iperf server need to be started in host pc before run net_load test

REALTIME_S_PERF_USB_NET source 'functions.sh'; source 'board_requirements.sh'; latency=`get_acceptable_latency usb`; multi_run_processes.sh -s "timeout 120 -s 9 sh -c 'while true; do ${LTPROOT}/runltp -P $PLATFORM -f ddt/usbhost_perf_vfat -s USBHOST_L_PERF_VFAT_0001; done'  || true" -l "-n 1" -s "timeout 115 -s 9 sh -c 'while true; do run_iperf.sh -v 3 -- -M 1500 -f M --bidir -t 110 -w 8K; done'  || true" -l "-n 1" -s "run_cyclictest $latency -a0 -t1 -i200 -p98 -m -n -q -D 2m" -l "-n 1"

REALTIME_L_PERF_USB_NET source 'functions.sh'; source 'board_requirements.sh'; latency=`get_acceptable_latency usb`; multi_run_processes.sh -s "timeout 14440 -s 9 sh -c 'while true; do ${LTPROOT}/runltp -P $PLATFORM -f ddt/usbhost_perf_vfat -s USBHOST_L_PERF_VFAT_0001; done'  || true" -l "-n 1" -s "timeout 14400 -s 9 sh -c 'while true; do run_iperf.sh -v 3 -- -M 1500 -f M --bidir -t 14380 -w 128K; done'  || true" -l "-n 1" -s "run_cyclictest $latency -a0 -t1 -i200 -p98 -m -n -q -D 4h" -l "-n 1"
