diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index d78e358e28..e2f34c7c90 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1194,7 +1194,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 16M -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m -u False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -1214,7 +1214,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16M -i 1 -f m -u False @@ -1266,7 +1266,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 5 lo -s -i 1 -f m -u + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m -u throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -1287,7 +1287,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 75 lo -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33M -i 1 -f m -u False @@ -1361,7 +1361,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -u -c 192.172.0.2 -b 10Mbits/s False @@ -1859,7 +1859,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 @@ -1934,7 +1934,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 @@ -2008,7 +2008,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 @@ -2082,7 +2082,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -f m -B 192.172.0.2 -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -2102,7 +2102,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -2154,7 +2154,7 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 5 ppp0 -c 192.172.0.1 -f m -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec @@ -2175,7 +2175,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -2249,7 +2249,7 @@ /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -c 192.172.0.2 + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 False @@ -3585,7 +3585,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 16M -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -3605,7 +3605,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -u -f m -b 16M False @@ -3656,7 +3656,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -3676,7 +3676,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 75 lo -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u False @@ -3727,7 +3727,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -3747,7 +3747,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -u -c 192.172.0.2 -b 10Mbits/s False @@ -3797,7 +3797,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2 + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -c 192.172.0.1 -B 192.172.0.2 @@ -4013,7 +4013,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -f m -B 192.172.0.2 -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -4033,7 +4033,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -4084,7 +4084,7 @@ c $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue - $OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 5 ppp0 -c 192.172.0.1 -f m -R + $OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m False sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue @@ -4104,7 +4104,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -7293,7 +7293,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 16Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16Mbits/s -i 1 -f m -u False @@ -7367,7 +7367,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u False @@ -7441,7 +7441,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 40Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 40Mbits/s -i 1 -f m -u False @@ -7738,7 +7738,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -7812,7 +7812,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False @@ -7886,7 +7886,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -i 1 -f m + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -f m False diff --git a/cmake_targets/autotests/tools/iperf_script b/cmake_targets/autotests/tools/iperf_script index 9f5990655e..731438d65d 100755 --- a/cmake_targets/autotests/tools/iperf_script +++ b/cmake_targets/autotests/tools/iperf_script @@ -34,6 +34,8 @@ #arg2 interface #arg3 iperf arguments +echo "Start time of script: `date`" + args=($*) timeout=${args[0]} iface=${args[1]} @@ -48,17 +50,57 @@ echo "iface = $iface" echo "iperf_args = ${iperf_args[@]}" echo "ip_client = $ip_client" + + +# Test an IP address for validity: +# Usage: +# valid_ip IP_ADDRESS +# if [[ $? -eq 0 ]]; then echo good; else echo bad; fi +# OR +# if valid_ip IP_ADDRESS; then echo good; else echo bad; fi +# +function valid_ip() +{ + local ip=$1 + local stat=1 + + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} + +if valid_ip $iface; then + echo "$iface is Valid IP Address. Checking for connectivity..." + ping -c 1 $iface >& /dev/null + while [ "$?" != "0" ]; do + ping -c 1 $iface >& /dev/null + done + echo "$iface connectivity achieved at `date`, Seconds = $SECONDS" + +else + + echo "Waiting for Interface $iface to come up..." + while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done + echo "$iface is now available at `date` , Seconds = $SECONDS" +fi + + +#if [ -n "$ip_client" ]; then +#echo "Waiting for route to be setup before iperf makes connection..." +# var=`route -n | grep $ip_client` +# if ["$var" != "" ] ; then break; fi +# +#fi + +echo "Sleeping for additional $timeout seconds" sleep $timeout -echo " Waiting for IP Address..." -while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 - -if [ -n "$ip_client" ]; then -echo "Waiting for route to be setup before iperf makes connection..." - var=`route -n | grep $ip_client` - if ["$var" != "" ] ; then break; fi - -fi -sleep 5 - +echo "Starting iperf at `date` , Seconds = $SECONDS ...." iperf ${iperf_args[@]}