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

### Ping tests ###
ETH-CPSW2G_XS_FUNC_PING_ALL source 'common.sh'; eth_multi_ping.sh -i 2 -d "cpsw2g" -a 

ETH-CPSW2G_S_FUNC_PING_300S_ALL source 'common.sh'; eth_multi_ping.sh -i 1 -t 300 -d "cpsw2g" -a 

ETH-CPSW2G_M_STRESS_PING_1800S_ALL source 'common.sh'; eth_multi_ping.sh -i 1 -t 1800 -d "cpsw2g" -a 

ETH-CPSW2G_M_STRESS_PING_MULTI_PKT_SIZES_ALL source 'common.sh'; for size in 128 512 1024 4096 8192 16384; do eth_multi_ping.sh -i 2 -p $size -d "cpsw2g" -a; done 

### Duplexity tests ###
ETH-CPSW2G_XS_FUNC_DUPLEX_FULL_ALL source 'common.sh'; eth_multi_duplexity.sh -i 1 -t "full" -d "cpsw2g" -a

ETH-CPSW2G_XS_FUNC_DUPLEX_HALF_ALL source 'common.sh'; eth_multi_duplexity.sh -i 1 -t "half" -d "cpsw2g" -a

### Speed Tests ###
ETH-CPSW2G_XS_FUNC_SPEED_10Mbps_ALL source 'common.sh'; eth_multi_speed.sh -i 1 -s 10 -d "cpsw2g" -a

ETH-CPSW2G_XS_FUNC_SPEED_100Mbps_ALL source 'common.sh'; eth_multi_speed.sh -i 1 -s 100 -d "cpsw2g" -a

ETH-CPSW2G_XS_FUNC_SPEED_1000Mbps_ALL source 'common.sh'; eth_multi_speed.sh -i 1 -s 1000 -d "cpsw2g" -a

### MAC Config test ###
ETH-CPSW2G_XS_FUNC_MAC_CONFIG_ALL source 'common.sh'; eth_multi_mac_config.sh -i 1 -d "cpsw2g" -a

### MTU Test ###
ETH-CPSW2G_XS_FUNC_MTU_CONFIG source 'common.sh'; iface=`get_test_iface_by_driver.sh -d "cpsw2g"` || 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; 