# @name PRU Ethernet ping test 
# @desc Brings net iface up and pings default gw. 
#       Test relies on host side vatf-scripts to set the required environment
#	variable. If a user wishes to run this test as a standalone LTP test
#	then set environment to gateway of interface on dut by:
#	export eth0_SERVER=<IP_Address_Of_Gateway>
# @requires pru/eth0
# @setup_requires prueth0

PRUETH_XS_FUNC_ETH0_PING source 'common.sh'; INTERFACE_NAME=eth0; host=$eth0_SERVER; iface=`get_eth_iface_by_module_name.sh -m pru -i $INTERFACE_NAME` || die "error getting eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; do_cmd "ping ${host} -I $iface -c 3"

PRUETH_S_FUNC_ETH0_PING_300S source 'common.sh'; INTERFACE_NAME=eth0; host=$eth0_SERVER; iface=`get_eth_iface_by_module_name.sh -m pru -i $INTERFACE_NAME` || die "error getting eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; do_cmd "ping ${host} -w 300"

PRUETH_M_STRESS_ETH0_PING_1800S source 'common.sh'; INTERFACE_NAME=eth0; host=$eth0_SERVER; iface=`get_eth_iface_by_module_name.sh -m pru -i $INTERFACE_NAME` || die "error getting eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; do_cmd "ping ${host} -w 1800"

PRUETH_S_STRESS_ETH0_PING_MULTI-PKT-SIZES source 'common.sh';  INTERFACE_NAME=eth0; host=$eth0_SERVER; iface=`get_eth_iface_by_module_name.sh -m pru -i $INTERFACE_NAME` || die "error getting eth interface name"; do_cmd "do_eth_up_down.sh -i $iface -d up"; for size in 128 512 1024 4096 8192 16384; do do_cmd "ping ${host} -c 3 -s ${size}";done
