# @name USBHOST Ethernet ping test 
# @desc Brings net iface up and pings gw
# @requires usb/host
# @setup_requires usbhosteth

USBHOST_S_FUNC_ETH_PING source 'common.sh'; iface_list=`get_active_eth_interfaces.sh`; echo "${iface_list[@]}"; iface=`usb_eth_search_device.sh 'usb'` || die "error getting usb eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; host=`get_eth_gateway.sh "-i ${iface}"` || die "error getting eth gateway address"; do_cmd "ping ${host} -c 50 -I $iface";

USBHOST_S_FUNC_ETH_PING_MULTI-PKT-SIZES source 'common.sh'; iface_list=`get_active_eth_interfaces.sh`; iface=`usb_eth_search_device.sh 'usb'` || die "error getting usb eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; host=`get_eth_gateway.sh "-i ${iface}"` || die "error getting eth gateway address"; for size in 64 128 512 1024 4096 8192 16384; do do_cmd "ping ${host} -c 25 -s ${size} -I $iface";done;

USBHOST_L_STRESS_ETH_PING_MULTI-PKT-SIZES source 'common.sh'; iface_list=`get_active_eth_interfaces.sh`; iface=`usb_eth_search_device.sh 'usb'` || die "error getting usb eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; host=`get_eth_gateway.sh "-i ${iface}"` || die "error getting eth gateway address"; for size in 64 128 512 1024 4096 8192 16384; do do_cmd "ping ${host} -c 1000 -s ${size} -I $iface";done;

USBHOST_L_STRESS_ETH_PING_ALL-PKT-SIZES source 'common.sh'; iface_list=`get_active_eth_interfaces.sh`; iface=`usb_eth_search_device.sh 'usb'` || die "error getting usb eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; host=`get_eth_gateway.sh "-i ${iface}"` || die "error getting eth gateway address"; for size in {10..1000}; do do_cmd "ping ${host} -c 10 -s $size -I $iface";done;

