# @name CPSW9G Driver Functional Tests
# @desc This file contains functional tests for CPSW9G ethernet driver 
# @requires net
# @setup_requires cpsw9g

### Ping tests ###
ETH-CPSW9G_XS_FUNC_PING_ALL source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; eth_multi_ping.sh -i 2 -d "cpsw9g" -a 

ETH-CPSW9G_S_FUNC_PING_300S_ALL source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; eth_multi_ping.sh -i 1 -t 300 -d "cpsw9g" -a 

ETH-CPSW9G_M_STRESS_PING_1800S_ALL source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; eth_multi_ping.sh -i 1 -t 1800 -d "cpsw9g" -a 

ETH-CPSW9G_M_STRESS_PING_MULTI_PKT_SIZES_ALL source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; for size in 128 512 1024 4096 8192 16384; do eth_multi_ping.sh -i 2 -p $size -d "cpsw9g" -a; done 

### MAC Config test ###
ETH-CPSW9G_XS_FUNC_MAC_CONFIG_ALL source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; eth_multi_mac_config.sh -i 1 -d "cpsw9g" -a

### MTU Test ###
ETH-CPSW9G_XS_FUNC_MTU_CONFIG source 'common.sh'; modprobe rpmsg_kdrv_switch && sleep 5; iface=`get_test_iface_by_driver.sh -d "cpsw9g"` || die "error getting eth interface name"; do_cmd "ifconfig ${iface} mtu 512"; test_mtu=`ifconfig ${iface} | grep 512`; echo test_mtu: ${test_mtu}; do_cmd "ifconfig ${iface} mtu 1500"; if [ -z "${test_mtu}" ]; then die "MTU was not changed!"; fi; 