diff options
author | Alex Fradkin <alexf@codeaurora.org> | 2017-02-06 19:43:35 +0200 |
---|---|---|
committer | Alex Fradkin <alexf@codeaurora.org> | 2017-02-06 19:43:35 +0200 |
commit | 994a1d1e85240374d258a2637c75839e6a61f8b9 (patch) | |
tree | 9c4d6d324181c955d4a6275d0946cde45ef3cf72 | |
parent | 85ddbea6ebf4aa3943070e18ca39bfa15074d733 (diff) |
Small global changes:contrib/alexf
- rely on PATH variable to run external utils
- use . (period) instead of "source" command for better compatibility
- script handler definition (#!/bin/sh) moved to first line
Fixes in test
- storage
- multimedia
- WIFI
New WIFI tests, new USB webcam test
Signed-off-by: Alex Fradkin <alexf@codeaurora.org>
85 files changed, 3235 insertions, 715 deletions
@@ -55,7 +55,7 @@ IMPORTANT GENERAL NOTE: all tests are written for and validated with busybox she 5. lmbench.sh requires lat_ctx - https://github.com/foss-for-synopsys-dwc-arc-processors/lmbench/blob/master/src/lat_ctx.c -6. lscpu.sh requires lscpu - https://layers.openembedded.org/layerindex/recipe/21404/ +6. lscpu.sh requires lscpu - https://packages.debian.org/cgi-bin/search_contents.pl?searchmode=filelist&word=util-linux&version=stable&arch=i386 7. rtc.sh requirs rtc01 - https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/device-drivers/rtc/rtc01.c diff --git a/environmentVars.txt b/environmentVars.txt index 230b5ed..c8a9b91 100755 --- a/environmentVars.txt +++ b/environmentVars.txt @@ -60,7 +60,7 @@ SOUND_FILE_WAV=<fileName.wav> #=====> make sure the MP3 file Sampling rate is 44.1 KHz! SOUND_FILE_MP3=<fileName.mp3> -SOUND_FILE_OGG=ACDC_-_<fileName.ogg> +SOUND_FILE_OGG=<fileName.ogg e.g ACDC_-_Back_In_Black-sample.ogg> # Video files needs to be at least 9 MIN long for video stability test to succeed VIDEO_FILE_1080P_24FPS_MOV=<1080p 24FPS mov file e.g big_buck_bunny_1080p_h264.mov> @@ -93,7 +93,3 @@ STATION_TEST_DIR=station-test-scripts - - - - diff --git a/file-transferor.sh b/file-transferor.sh index 1e824a9..a0b8e4f 100755 --- a/file-transferor.sh +++ b/file-transferor.sh @@ -1,3 +1,4 @@ +#!/bin/bash #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/bash #file transferor #transfers test-job script files to target-device via scp #operated by tiny-apts @@ -46,7 +46,11 @@ copyToTargetDevice () # $1 - src dir. $2 - dest dir # copies all files from ################################## script execution ################################################# # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/util/generally-used-variables.txt" +#source "$(dirname $(readlink -f $0))/util/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/util/generally-used-variables.txt" + +##TODO exiting########################################################################### +#exit 1 THIS_FILE_NAME=${0##*/} FAIL=1 @@ -1,3 +1,4 @@ +#!/bin/bash #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without diff --git a/selectTestsWithARGS.txt b/selectTestsWithARGS.txt index 704939e..1437ebe 100755 --- a/selectTestsWithARGS.txt +++ b/selectTestsWithARGS.txt @@ -47,8 +47,10 @@ #testing general purpose IO #gpio/gpio-test.sh:NONE + #test-script arguments -time to turn on the leds- #gpio/leds-test.sh:2 + #gpio/uart_test.sh:NONE ########################## CPU tests ###################################################### @@ -57,6 +59,7 @@ #cpu/psci-hotplug-test.sh:NONE #cpu/lscpu.sh:NONE #cpu/cpu_freq.sh:NONE +#cpu/cpu_idle_state-test.sh:NONE ########################## display tests ###################################################### @@ -75,17 +78,74 @@ #test-script arguments -wifi AP-, -wifi password- #wifi/wifi-connect-WPA2-PSK-security-test.sh:<enter your wifi AP> <enter your wifi password> + + +# requirs one argument: min/max/special +#wifi/wifi-softap-connect-ssid-test.sh:min +#wifi/wifi-softap-connect-ssid-test.sh:max +#wifi/wifi-softap-connect-ssid-test.sh:special + + +#wifi/wifi-softap-only-defined-hw-mode-connect-test.sh:b +#wifi/wifi-softap-only-defined-hw-mode-connect-test.sh:g +#wifi/wifi-softap-only-defined-hw-mode-connect-test.sh:n + + +#wifi/wifi-softap-specific-STA-test.sh:accept +#wifi/wifi-softap-specific-STA-test.sh:deny + #wifi/wifi-softap-WPA2-PSK-secure-connect-test.sh:NONE #wifi/wifi-softap-non-secure-connect-test.sh:NONE #wifi/wifi-softap-get-station-info-test.sh:NONE #wifi/wifi-softap-disassoc-sta-test.sh:NONE + #testing wifi performance. -#station-test-scripts/wifi/STA-all-channels-performance-WPA2-TKIP-secure-test.sh:NONE +#arg1 - security type "WPA2-TKIP-security" or "open-security" +#arg2 - performance KPI +#station-test-scripts/wifi/STA-all-channels-performance-test.sh:WPA2-TKIP-security 1 +#station-test-scripts/wifi/STA-all-channels-performance-test.sh:open-security 1 + + #wifi/wifi-softap-all-channels-connect-test.sh:NONE +#expects one argument for country code, e.g "JP", "US" + +#1-13 +#wifi/wifi-softap-country-code-regulation-test.sh:JP + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:US + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:LV + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:IT + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:GB + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:CY + +#1-11 +#wifi/wifi-softap-country-code-regulation-test.sh:NZ + +# arg1 - iperf KPI +#wifi/wifi-softap-KPI-performance-test.sh 1 +#wifi/wifi-softap-link-monitor-test.sh:NONE + +# arg1 - security type - open/wps2_psk +#wifi/wifi-softap-WPS-pin-test.sh:open +#wifi/wifi-softap-WPS-pin-test.sh:wps2_psk + + +# arg1 - AP to connect to, arg2 - AP password, arg3 - large/small +#wifi/wifi-file-download-test.sh:<enter your wifi AP> <enter your wifi password> large +#wifi/wifi-file-download-test.sh:<enter your wifi AP> <enter your wifi password> small ####################### audio tests ################################################## @@ -114,6 +174,7 @@ # arg 1 - file to play - variable name from "environmentVars.txt" file representing the video file # e.g "VIDEO_FILE_720P_24FPS_MOV" # arg 2 - audio output (e.g HDMI, analog, USB) + #video/Video-play-video-File-test.sh:VIDEO_FILE_720P_24FPS_MOV HDMI #video/Video-play-video-File-test.sh:VIDEO_FILE_1080P_24FPS_MOV HDMI #video/Video-play-video-File-test.sh:VIDEO_FILE_1080P_30FPS_MOV HDMI @@ -125,29 +186,51 @@ #video/Video-play-video-File-test.sh:VIDEO_FILE_1080P_30FPS_MOV USB +#video/Video-encoder-test.sh:NONE + +#video/Video-usbcam-test.sh:this-is-test-string-for-web-cam-testing # Plays gst for 14 Hours #video/Video-1080p-24fps-MOV-Audio-HDMI-stability-test.sh:NONE ####################### storage tests ####################################### + #storage/sd-card-discover-test.sh:NONE -#storage/usb-discover-test.sh:NONE -#storage/storage_iozone_test.sh:usb sequential -#storage/storage_iozone_test.sh:sdcard sequential -#storage/storage_iozone_test.sh:onboard_flash random +##### sd card tests ###### +#sd card aruments for different SD card types: +#sdcard-regular/sdcard-HC/sdcard-XC -#storage/storage_dd_test.sh:usb -#storage/storage_dd_test.sh:sdcard -#storage/storage_dd_test.sh:onboard_flash +############### sdcard-regular #################################### +#storage/storage_iozone_test.sh:sdcard-regular sequential +#storage/storage_dd_test.sh:sdcard-regular +#storage/storage_copyfile_test.sh:onboard_flash sdcard-regular + +############### sdcard-HC #################################### +#storage/storage_iozone_test.sh:sdcard-HC sequential +#storage/storage_dd_test.sh:sdcard-HC +#storage/storage_copyfile_test.sh:onboard_flash sdcard-HC + +############### sdcard-XC #################################### +#storage/storage_iozone_test.sh:sdcard-XC sequential +#storage/storage_dd_test.sh:sdcard-XC +#storage/storage_copyfile_test.sh:onboard_flash sdcard-XC + +######## usb mass storage tests ############## +#storage/usb-discover-test.sh:NONE +#storage/storage_iozone_test.sh:usb sequential +#storage/storage_dd_test.sh:usb #storage/storage_copyfile_test.sh:onboard_flash usb -#storage/storage_copyfile_test.sh:onboard_flash sdcard + +######## onboard-flash memory tests ################## +#storage/storage_iozone_test.sh:onboard_flash random +#storage/storage_dd_test.sh:onboard_flash #storage/storage_copyfile_test.sh:onboard_flash onboard_flash #-script arguments -USB device- -storage/fio-test.sh:/dev/sda1 +#storage/fio-test.sh:/dev/sda1 diff --git a/station-test-scripts/wifi/STA-all-channels-performance-WPA2-TKIP-secure-test.sh b/station-test-scripts/wifi/STA-all-channels-performance-WPA2-TKIP-secure-test.sh deleted file mode 100755 index 49d2ef9..0000000 --- a/station-test-scripts/wifi/STA-all-channels-performance-WPA2-TKIP-secure-test.sh +++ /dev/null @@ -1,214 +0,0 @@ -#Copyright (c) 2016, The Linux Foundation. All rights reserved. -# -#Redistribution and use in source and binary forms, with or without -#modification, are permitted provided that the following conditions are -#met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#!/bin/bash -# connects DUT Wifi STA to working stations wifi dongle in every channel and runs iperf - - -#=====================> function declaration <=========================== -configureHostapd () #$1 - channel number -{ - HOSTAPD_CONF=" -interface=$CURR_WLAN -ctrl_interface=/var/run/hostapd -driver=nl80211 -hw_mode=g -channel=$1 -ssid=$SOFTAP_SSID - -#for high throughput 20Mhz -country_code=JP -#advertises the country_code and the set of allowed channels and transmit power levels based on the regulatory limits -ieee80211d=1 - -ieee80211n=1 -wmm_enabled=1 - -auth_algs=1 -wpa=2 -wpa_key_mgmt=WPA-PSK -wpa_pairwise=TKIP CCMP -wpa_passphrase=$SOFTAP_PASS -rsn_pairwise=CCMP -macaddr_acl=0 -" - - -} - -configureDhcpd () -{ - DHCPD_CONF=" -ddns-update-style none; -ignore client-updates; -authoritative; -option local-wpad code 252 = text; - -subnet -192.168.8.0 netmask 255.255.255.0 { -# --- default gateway -option routers -$SOFTAP_GATEWAY; -# --- Netmask -option subnet-mask -255.255.255.0; -# --- Broadcast Address -option broadcast-address -192.168.8.255; -# --- Domain name servers, tells the clients which DNS servers to use. -option domain-name-servers -$SOFTAP_GATEWAY, 8.8.8.8, 8.8.4.4; -option time-offset -0; -range 192.168.8.3 192.168.8.128; -default-lease-time 1209600; -max-lease-time 1814400; -} -" -} - -cleanup () -{ - echo "===> cleanup - killing wpa_supplicant, hostapd, dhcpd and removing log files <======" - ssh $TARGET_ADDR $DEVICE_UTIL_PATH/kill-process-ids.sh wpa_supplicant - $UTIL_PATH/kill-process-ids.sh hostapd - $UTIL_PATH/kill-process-ids.sh dhcpd - rm $WS_IPERF_LOG &>/dev/null - rm $DUT_IPERF_LOG &>/dev/null - sleep 5 -} - -#=====================> script execution <=========================== -echo "===================> starting STA-all-channels-performance-WPA2-TKIP-secure-test.sh <====================" - -# defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt - -SOFTAP_SSID="STA-all-channel" -SOFTAP_PASS="12345678" -SOFTAP_GATEWAY="192.168.8.1" - -WS_IPERF_LOG="$CURR_PATH/ws-iperf.log" -DUT_IPERF_LOG="$CURR_PATH/dut-iperf.log" -IPERF_RUNNING_TIME=35 - -cleanup -configureDhcpd - -for CHANNEL in $(seq 1 13) -do -# run in loop for channel 1-13 - - # bring up softap in channel num N - configureHostapd $CHANNEL - - echo "=========== testing hostapd conf file =================" - echo $HOSTAPD_CONF - echo "=========== testing dhcpd conf file =================" - echo $DHCPD_CONF - $UTIL_PATH/bringUp-softap.sh "$HOSTAPD_CONF" "$DHCPD_CONF" \ - || (echo "==> bring-up softap utility failed <== in channel $CHANNEL. so far iperf logs:$ALL_CHANNEL_RES" && exit 1) \ - || exit 1 - - echo "====> connect DUT to sofap <=======" - ssh $TARGET_ADDR $WIFI_TEST_PATH/wifi-connect-WPA2-PSK-security-test.sh $SOFTAP_SSID $SOFTAP_PASS \ - || (echo "DUT failed to connect to wifi in channel $CHANNEL. so far iperf logs:$ALL_CHANNEL_RES" && exit 1) \ - || exit 1 - sleep 5 - - echo "=======> run iperf for $IPERF_RUNNING_TIME seconds DUT-client WS-server <=============" - iperf -s 1> $WS_IPERF_LOG & - sleep 5 - - echo "$( (ssh $TARGET_ADDR iperf -c $SOFTAP_GATEWAY -i 1 -t $IPERF_RUNNING_TIME) 2>&1)" > $DUT_IPERF_LOG - cat $DUT_IPERF_LOG | grep "connect failed" \ - && echo "iperf -c from DUT failed in channel $CHANNEL. so far iperf logs:$ALL_CHANNEL_RES" \ - && exit 1 - - echo "=====> pars iperf results <======" - DUT_IPERF_RES=$(awk 'NR==1; END{print}' $DUT_IPERF_LOG | rev | cut -d" " -f2 | rev | grep -e "---" -v) - - echo "====> DUT_IPERF_RES=$DUT_IPERF_RES in CHANNEL=$CHANNEL <============" - sleep 3 - echo "===> kill iperf server on WS <=====" - $UTIL_PATH/kill-process-ids.sh iperf - sleep 1 - $UTIL_PATH/kill-process-ids.sh iperf - sleep 2 - - echo "=====> run iperf for $IPERF_RUNNING_TIME seconds WS-client DUT-server <================" - echo "$( (ssh $TARGET_ADDR iperf -s) 2>&1)" > $DUT_IPERF_LOG & - sleep 1 - - echo "====> get DUT ip address <======" - DUT_WLAN="$(ssh $TARGET_ADDR ifconfig -a | grep wlan | cut -d" " -f1)" - DUT_IP_ADDR="$(ssh $TARGET_ADDR ifconfig | grep -A 1 $DUT_WLAN | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1)" - iperf -c "$DUT_IP_ADDR" -i 1 -t "$IPERF_RUNNING_TIME" &>"$WS_IPERF_LOG" - cat $WS_IPERF_LOG | grep "connect failed" \ - && echo "iperf -c from WS failed in channel $CHANNEL. so far iperf logs:$ALL_CHANNEL_RES" \ - && exit 1 - - echo "====> parse iperf results <======" - WS_IPERF_RES=$(awk 'NR==1; END{print}' $WS_IPERF_LOG | rev | cut -d" " -f2 | rev | grep -e "---" -v) - - echo "====> WS_IPERF_RES=$WS_IPERF_RES in CHANNEL=$CHANNEL <============" - sleep 3 - echo "=====> kill iperf server on DUT <=======" - ssh $TARGET_ADDR $DEVICE_UTIL_PATH/kill-process-ids.sh iperf - sleep 1 - ssh $TARGET_ADDR $DEVICE_UTIL_PATH/kill-process-ids.sh iperf - - - echo "====> concatenate results for current channel $CHANNEL<=====" - CURR_CHANNEL_RES="channel number $CHANNEL\nDUT client - $DUT_IPERF_RES\nWS client - $WS_IPERF_RES\n" - ALL_CHANNEL_RES="$ALL_CHANNEL_RES$CURR_CHANNEL_RES" - - # cleanup - cleanup - sleep 5 -done - -echo "==========> final result: <==============" -echo -e "$ALL_CHANNEL_RES" -echo "==============> successfully ended STA-all-channels-performance-WPA2-TKIP-secure-test.sh <============================" - - - - - - - - - - - - - - - - diff --git a/station-test-scripts/wifi/STA-all-channels-performance-test.sh b/station-test-scripts/wifi/STA-all-channels-performance-test.sh new file mode 100644 index 0000000..0e1b09a --- /dev/null +++ b/station-test-scripts/wifi/STA-all-channels-performance-test.sh @@ -0,0 +1,231 @@ +#!/bin/bash +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# connects DUT Wifi STA to working stations wifi dongle in every channel and runs iperf +# receives one argument defining connection type: "WPA2-TKIP-security"/"open-security" + + +########################### function declaration ############################################# +configureHostapd () #$1 - channel number +{ + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +channel=$1 +ssid=$SOFTAP_SSID + +hw_mode=g +#for high throughput 20Mhz +country_code=JP +ieee80211n=1 +ht_capab=[SHORT-GI-20] +wmm_enabled=1 + +ap_max_inactivity=7200 + +$HOSTAPD_SECURITY +" +} + +configureDhcpd () +{ + DHCPD_CONF=" +ddns-update-style none; +ignore client-updates; +authoritative; +option local-wpad code 252 = text; + +subnet +192.168.8.0 netmask 255.255.255.0 { +# --- default gateway +option routers +$SOFTAP_GATEWAY; +# --- Netmask +option subnet-mask +255.255.255.0; +# --- Broadcast Address +option broadcast-address +192.168.8.255; +# --- Domain name servers, tells the clients which DNS servers to use. +option domain-name-servers +$SOFTAP_GATEWAY, 8.8.8.8, 8.8.4.4; +option time-offset +0; +range 192.168.8.3 192.168.8.128; +default-lease-time 1209600; +max-lease-time 1814400; +} +" +} + +cleanup () +{ + echo "===> cleanup - killing wpa_supplicant, hostapd, dhcpd and removing log files <======" + #echo "=========> TARGET_ADDR=$TARGET_ADDR <=============" + #echo "=========> DEVICE_UTIL_PATH=$DEVICE_UTIL_PATH <=============" + #echo "=========> UTIL_PATH=$UTIL_PATH <=============" + #echo "================> ls -al util path <=========================" + #ls -al $UTIL_PATH + + #echo "================> ls -al $TARGET_ADDR util path <=========================" + #ssh $TARGET_ADDR "ls -al $DEVICE_UTIL_PATH" + +# echo "================> kill wpa without flags on DUT <=========================" +# ssh $TARGET_ADDR $DEVICE_UTIL_PATH/kill-process-ids.sh wpa_supplicant + +# echo "============================================================" + + echo "========================= NetworkManager wifi off ===================================" + nmcli nm wifi off + echo "========================= kill wpa with flags ===================================" + $UTIL_PATH/kill-process-ids.sh wpa_supplicant -x + $UTIL_PATH/kill-process-ids.sh hostapd -x + $UTIL_PATH/kill-process-ids.sh dhcpd -x + sleep 5 +} + +pars_arg () +{ + if [ "$SECURITY_TYPE" = "WPA2-TKIP-security" ]; then + HOSTAPD_SECURITY="auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +macaddr_acl=0" + + TARGET_CONNECT_SCRIPT="connect-STA.sh $SECURITY_TYPE $SOFTAP_SSID $SOFTAP_PASS" + + elif [ "$SECURITY_TYPE" = "open-security" ]; then + TARGET_CONNECT_SCRIPT="connect-STA.sh $SECURITY_TYPE $SOFTAP_SSID" + + else + echo "====> ERROR:bad argument - supply \"WPA2-TKIP-security\" or \"open-security\" <====" + exit 1 + fi +} + +parse_performance_result () +{ + echo "$PERFORMANCE_RES" | grep -o "===> IPERF_RES=..........." | cut -d">" -f2 | cut -d"=" -f2 | cut -d" " -f1 +} + +exit_procedure () # arg1 - failed script +{ + disconnect-Wifi-client-from-Wifi-softap.sh $TARGET_ADDR + echo "==> $1 failed <== in channel $CHANNEL. so far iperf logs:$ALL_CHANNEL_RES" + exit 1 +} + +check_performance_result () # arg1 - result value +{ + echo "====== checking performance result=$1 =======" + if [ $1 -gt 0 ]; then + echo "====PERFORMANCE_RES=$PERFORMANCE_RES =====" + exit_procedure 'performance_test.sh' + fi +} +############################### script execution ########################################### + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +SECURITY_TYPE=$1 +IPERF_KPI=$2 +echo "===================> starting STA-all-channels-performance-test.sh $SECURITY_TYPE KPI=$IPERF_KPI <====================" +echo "===============> SECURITY_TYPE=$SECURITY_TYPE <===============" +echo "===============> IPERF_KPI=$IPERF_KPI <===============" +check-args-num.sh $# 2 || (echo "===> ERROR:wrong argument number <===" && exit 1 ) || exit 1 + +SOFTAP_SSID="STA-all-channel" +SOFTAP_PASS="12345678" +SOFTAP_GATEWAY="192.168.8.1" +TIME_IPERF_RUN=35 +pars_arg + +cleanup +configureDhcpd + +for CHANNEL in $(seq 11) +do + # bring up softap in channel num N + configureHostapd $CHANNEL + $UTIL_PATH/bringUp-softap.sh "$HOSTAPD_CONF" "$DHCPD_CONF" || exit_procedure 'bringUp-softap.sh' + + echo "====> connect DUT to sofap <=======" + ssh $TARGET_ADDR "$DEVICE_UTIL_PATH/$TARGET_CONNECT_SCRIPT" || exit_procedure 'DUT connection to working station softap' + sleep 2 + + echo "=======> run performance_test.sh DUT-client WS-server in channel=$CHANNEL <=============" + PERFORMANCE_RES="$( (performance_test.sh $TARGET_ADDR client $IPERF_KPI $TIME_IPERF_RUN) 2>&1)" + RESULT=$? + check_performance_result $RESULT + + DUT_CLIENT_IPERF_RES=$(parse_performance_result) + echo "===========> DUT_CLIENT_IPERF_RES=$DUT_CLIENT_IPERF_RES <================" + + echo "=====> run performance_test.sh WS-client DUT-server <================" + PERFORMANCE_RES="$( (performance_test.sh $TARGET_ADDR server $IPERF_KPI $TIME_IPERF_RUN) 2>&1)" + RESULT=$? + check_performance_result $RESULT + + + WS_CLIENT_IPERF_RES=$(parse_performance_result) + echo "===========> WS_CLIENT_IPERF_RES=$WS_CLIENT_IPERF_RES <===========" + + CURR_CHANNEL_RES="channel number $CHANNEL\nDUT client - $DUT_CLIENT_IPERF_RES\nWS client - $WS_CLIENT_IPERF_RES\n" + ALL_CHANNEL_RES="$ALL_CHANNEL_RES$CURR_CHANNEL_RES" + + disconnect-Wifi-client-from-Wifi-softap.sh $TARGET_ADDR + cleanup + echo "=============> finished with channel $CHANNEL <=================" + sleep 5 +done + +echo "==========> final result: <==============" +echo -e "$ALL_CHANNEL_RES" + +echo "==============> successfully ended STA-all-channels-performance-test.sh $SECURITY_TYPE KPI=$IPERF_KPI <============================" + + + + + + + + + + + + + + + + diff --git a/test-executor.sh b/test-executor.sh index 75e35f0..46ba6e5 100755 --- a/test-executor.sh +++ b/test-executor.sh @@ -1,3 +1,4 @@ +#!/bin/bash #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/bash #executes test-jobs located on the target device ############################### function definition ####################################################################3 @@ -130,7 +130,7 @@ function logLargeTestContent #################### script execution ##################################### # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/util/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/util/generally-used-variables.txt" THIS_FILE_NAME=${0##*/} FAIL=1 diff --git a/test-scripts/audio/Analog-RAW-Audio-ALSA-Record-encoded-to-AAC-test.sh b/test-scripts/audio/Analog-RAW-Audio-ALSA-Record-encoded-to-AAC-test.sh index 7a3ea0f..18550cd 100755 --- a/test-scripts/audio/Analog-RAW-Audio-ALSA-Record-encoded-to-AAC-test.sh +++ b/test-scripts/audio/Analog-RAW-Audio-ALSA-Record-encoded-to-AAC-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # this test: # 1. Records RAW audio via Analog microphone # 2. Encodes to AAC @@ -45,7 +45,7 @@ echo "=============> Running Test: Analog-RAW-Audio-ALSA-Record-encoded-to-AAC-t echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt ALSA_LOG_FILE="alsa.log" RECORD_FILE=Analog_audio_record_AAC_test.AAC @@ -134,11 +134,12 @@ echo "Running Command: $COMMAND" eval $COMMAND &>> $ALSA_LOG_FILE sleep 1 -echo "====> ALSA_LOG_FILE=$(cat $ALSA_LOG_FILE)" +echo "====> ALSA_LOG_FILE=============================================================" +cat $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -148,8 +149,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/Analog-WAV-Audio-ALSA-Playback-test.sh b/test-scripts/audio/Analog-WAV-Audio-ALSA-Playback-test.sh index d180efd..1288954 100755 --- a/test-scripts/audio/Analog-WAV-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/Analog-WAV-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # play WAV audio on analog speakers by using ALSA aplay utility checks for errors or warnings # needs to be connected to the DUT: @@ -38,7 +39,7 @@ echo "=============> Running Test: Analog-WAV-Audio-ALSA-Playback-test <======== echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt ALSA_LOG_FILE="alsa.log" FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_WAV)" @@ -98,8 +99,8 @@ eval $COMMAND &> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -109,8 +110,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/Analog-WAV-Audio-ALSA-Record-test.sh b/test-scripts/audio/Analog-WAV-Audio-ALSA-Record-test.sh index 596b5c6..ecfdfc5 100755 --- a/test-scripts/audio/Analog-WAV-Audio-ALSA-Record-test.sh +++ b/test-scripts/audio/Analog-WAV-Audio-ALSA-Record-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # this test records via analog microphone and plays it using ALSA aplay utility on USB headset # needs to be connected to the DUT: @@ -39,7 +40,7 @@ echo "=============> Running Test: Analog-WAV-Audio-ALSA-Record-test.sh <======= echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt ALSA_LOG_FILE="alsa.log" RECORD_FILE=Analog_audio_record_test.wav @@ -118,8 +119,8 @@ eval $COMMAND &>> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -129,8 +130,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/HDMI-MP3-Audio-ALSA-Playback-test.sh b/test-scripts/audio/HDMI-MP3-Audio-ALSA-Playback-test.sh index 180b685..12c60c5 100755 --- a/test-scripts/audio/HDMI-MP3-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/HDMI-MP3-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test play MP3 audio on HDMI by using ALSA gst-launch utility. # connect HDMI screen to DUT @@ -36,7 +37,7 @@ echo "=============> Running Test: HDMI-MP3-Audio-ALSA-Playback-test.sh <======= echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_MP3)" ALSA_LOG_FILE="alsa.log" @@ -101,8 +102,8 @@ eval $COMMAND &> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -112,8 +113,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/HDMI-WAV-Audio-ALSA-Playback-test.sh b/test-scripts/audio/HDMI-WAV-Audio-ALSA-Playback-test.sh index 4093136..26334d5 100755 --- a/test-scripts/audio/HDMI-WAV-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/HDMI-WAV-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test plays WAV audio by using ALSA aplay utility, output - HDMI audio # connect HDMI screen to DUT @@ -36,7 +37,7 @@ echo "=============> Running Test: HDMI-WAV-Audio-ALSA-Playback-test.sh <======= echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_WAV)" ALSA_LOG_FILE="alsa.log" @@ -100,8 +101,8 @@ echo "ALSA_LOG_FILE=$(cat $ALSA_LOG_FILE)" # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) @@ -112,8 +113,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/USB-MP3-Audio-ALSA-Playback-test.sh b/test-scripts/audio/USB-MP3-Audio-ALSA-Playback-test.sh index b24706b..922bbb1 100755 --- a/test-scripts/audio/USB-MP3-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/USB-MP3-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test play MP3 audio on USB headphones by using gstreamer. date echo "=============> Running Test: USB-MP3-Audio-ALSA-Playback-test.sh <===============" @@ -34,7 +35,7 @@ echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_MP3)" ALSA_LOG_FILE="alsa.log" @@ -94,10 +95,13 @@ COMMAND="gst-launch-1.0 -v filesrc location="$FILE_TO_PLAY" ! mad ! audioresampl echo "Running Command: $COMMAND" eval $COMMAND &> $ALSA_LOG_FILE +echo "=========gst log file:==============" +cat $ALSA_LOG_FILE + # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -107,8 +111,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/USB-OGG-Audio-ALSA-Playback-test.sh b/test-scripts/audio/USB-OGG-Audio-ALSA-Playback-test.sh index 4c53a75..2f03e36 100755 --- a/test-scripts/audio/USB-OGG-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/USB-OGG-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test play OGG audio on USB headphones by using gstreamer. # connect USB headphones to DUT @@ -36,7 +37,7 @@ date echo "=============> Running Test: USB-OGG-Audio-ALSA-Playback-test.sh <===============" # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_OGG)" ALSA_LOG_FILE="alsa.log" @@ -97,8 +98,8 @@ eval $COMMAND &> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -108,8 +109,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/USB-RAW-Audio-ALSA-Record-encoded-to-MP3-test.sh b/test-scripts/audio/USB-RAW-Audio-ALSA-Record-encoded-to-MP3-test.sh index 1693123..5c5052b 100755 --- a/test-scripts/audio/USB-RAW-Audio-ALSA-Record-encoded-to-MP3-test.sh +++ b/test-scripts/audio/USB-RAW-Audio-ALSA-Record-encoded-to-MP3-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # this test: # 1. plays audio msg to user on USB headphones # 2. Records RAW audio via USB microphone @@ -42,7 +43,7 @@ echo "=============> Running Test: USB-RAW-Audio-ALSA-Record-encoded-to-MP3-test echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt ALSA_LOG_FILE="alsa.log" RECORD_FILE=USB_audio_record_MP3_test.wav @@ -113,10 +114,14 @@ COMMAND="gst-launch-1.0 filesrc location=$RECORD_FILE ! mad ! audioconvert ! au echo "Running Command: $COMMAND" eval $COMMAND &>> $ALSA_LOG_FILE + +echo "===========gst log:===========" +cat $ALSA_LOG_FILE + # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -126,8 +131,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/USB-WAV-Audio-ALSA-Playback-test.sh b/test-scripts/audio/USB-WAV-Audio-ALSA-Playback-test.sh index ccbb4ee..9b1f570 100755 --- a/test-scripts/audio/USB-WAV-Audio-ALSA-Playback-test.sh +++ b/test-scripts/audio/USB-WAV-Audio-ALSA-Playback-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # test play WAV audio on USB headphones by using ALSA aplay utility. # connect USB headset to DUT @@ -37,7 +38,7 @@ echo "=============> Running Test: USB-WAV-Audio-ALSA-Playback-test.sh <======== echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_WAV)" echo file to play - $FILE_TO_PLAY @@ -119,8 +120,8 @@ eval $COMMAND &> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -130,8 +131,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/USB-WAV-Audio-ALSA-Record-test.sh b/test-scripts/audio/USB-WAV-Audio-ALSA-Record-test.sh index a77c67a..993b37c 100755 --- a/test-scripts/audio/USB-WAV-Audio-ALSA-Record-test.sh +++ b/test-scripts/audio/USB-WAV-Audio-ALSA-Record-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # test records via USB microphone and plays it using ALSA aplay utility on USB headset # connect USB headset with headphones and microphone to DUT @@ -37,7 +38,7 @@ echo "=============> Running Test: USB-WAV-Audio-ALSA-Record-test.sh <========== echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt # define audio Hardware configuration - parse USB card and device numbers to play in USB headphones (e.g. plughw:1,0) PLAYBACK_HW_CARD=$(aplay -l | grep "USB Audio" | cut -d":" -f1 | cut -d" " -f2) @@ -123,8 +124,8 @@ eval $COMMAND &>> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) echo @@ -134,8 +135,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/audio/encode-wav-to-MP3-playback-USB-audio-test.sh b/test-scripts/audio/encode-wav-to-MP3-playback-USB-audio-test.sh index 501e14b..edd905a 100755 --- a/test-scripts/audio/encode-wav-to-MP3-playback-USB-audio-test.sh +++ b/test-scripts/audio/encode-wav-to-MP3-playback-USB-audio-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test converts wav file to mp3 file and plays it in USB headphons by using ALSA gstreamer utility. ## connect USB headphones to device to hear result!! ## @@ -36,7 +37,7 @@ echo "=============> Running Test: encode-wav-to-MP3-playback-USB-audio-test.sh echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS SOUND_FILE_WAV)" ALSA_LOG_FILE="alsa.log" @@ -107,10 +108,13 @@ eval $COMMAND &> $ALSA_LOG_FILE # test finished, post processing data # look into the log file and search for any errors -ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -c "error")" -WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -c "arning")" +ERROR_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "error")" +WARNING_COUNT="$(cat $ALSA_LOG_FILE | grep -ci "arning")" ERROR_COUNT=$(( $WARNING_COUNT + $ERROR_COUNT)) +echo "============gst log:===============" +cat $ALSA_LOG_FILE + echo echo Number of Errors or Warnings: $ERROR_COUNT echo @@ -118,8 +122,8 @@ if [ "$ERROR_COUNT" -gt "0" ] then RESULT=1 echo "Errors found!.." - cat $ALSA_LOG_FILE | grep "arning" - cat $ALSA_LOG_FILE | grep "error" + cat $ALSA_LOG_FILE | grep -i "arning" + cat $ALSA_LOG_FILE | grep -i "error" echo echo " - - F A I L - - " else diff --git a/test-scripts/benchmark/ebiz.sh b/test-scripts/benchmark/ebiz.sh index 01d2d33..f9e0ad7 100755 --- a/test-scripts/benchmark/ebiz.sh +++ b/test-scripts/benchmark/ebiz.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,23 +27,21 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # ebizzy is designed to generate a workload resembling common web application server workloads. It is highly threaded, has a large in-memory working set, and allocates and deallocates memory frequently. # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt PASSORFAIL=2 # need to read begin and end echo "=============> Running Test Test: EBIZZY <==============" echo date PASSORFAIL=$((PASSORFAIL-1)) -for i in $(seq 1 50) +for i in $(seq 1 50) do - echo "ebizzy iteration number $i " - # ebizzy it's a binary - that's why not apears in editor - $UTIL_PATH/ebizzy -t 2 -S 20 $@ + echo "ebizzy iteration number $i" + ebizzy -t 2 -S 20 done echo "=============> Finished Test: EBIZZY <==============" echo diff --git a/test-scripts/benchmark/hackbench.sh b/test-scripts/benchmark/hackbench.sh index 0ec36fa..1d2d9e3 100755 --- a/test-scripts/benchmark/hackbench.sh +++ b/test-scripts/benchmark/hackbench.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,12 +27,12 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # scheduler benchmark/stress test # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt PASSORFAIL=2 # need to read begin and end echo "=============> Running Test Test: hackbench <==============" @@ -42,7 +43,7 @@ PASSORFAIL=$((PASSORFAIL-1)) for i in $(seq 1 1000) do echo "hackbench iteration number $i " - $UTIL_PATH/hackbench $@ + hackbench done echo "=============> Finished Test: hackbench <==============" echo diff --git a/test-scripts/benchmark/lmbench.sh b/test-scripts/benchmark/lmbench.sh index 43d1222..da4ac0b 100755 --- a/test-scripts/benchmark/lmbench.sh +++ b/test-scripts/benchmark/lmbench.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,16 +27,16 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # Suite of simple, portable benchmarks # Compares different systems performance # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -PASSORFAIL=2 # need to read begind and end +PASSORFAIL=2 # need to read begin and end echo "=============> Running Test Test: lmbench <==============" echo date @@ -43,10 +44,10 @@ PASSORFAIL=$((PASSORFAIL-1)) for i in $(seq 1 1000) do echo "lat_ctx iteration number $i " - $UTIL_PATH/lat_ctx -s 64 2 - $UTIL_PATH/lat_ctx -s 64 8 - $UTIL_PATH/lat_ctx -s 64 16 - $UTIL_PATH/lat_ctx -s 64 20 + lat_ctx -s 64 2 + lat_ctx -s 64 8 + lat_ctx -s 64 16 + lat_ctx -s 64 20 done echo "=============> successfully completed Test: lmbench <==============" echo diff --git a/test-scripts/benchmark/strng.sh b/test-scripts/benchmark/strng.sh index 2a3890a..5ccfc9f 100755 --- a/test-scripts/benchmark/strng.sh +++ b/test-scripts/benchmark/strng.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,13 +27,13 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces. # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt PASSORFAIL=0 # default- is success echo "=============> Running Test Test: strng <==============" @@ -70,11 +71,11 @@ do echo "[$count/$workload_number] Running $i workload..." if [ $i = "vm" ]; then # mmap 64M per vm process to avoid OOM, the default is 256M. - $UTIL_PATH/stress-ng --$i $processor_number --vm-bytes 64m --timeout $sub_duration --metrics-brief --verbose + stress-ng --$i $processor_number --vm-bytes 64m --timeout $sub_duration --metrics-brief --verbose else - $UTIL_PATH/stress-ng --$i $processor_number --timeout $sub_duration --metrics-brief --verbose + stress-ng --$i $processor_number --timeout $sub_duration --metrics-brief --verbose fi - print_test_result $UTIL_PATH/stress-ng-$i $? + print_test_result stress-ng-$i $? count=$(( $count + 1 )) done diff --git a/test-scripts/benchmark/sysbench.sh b/test-scripts/benchmark/sysbench.sh index 54ee3db..6fd635d 100755 --- a/test-scripts/benchmark/sysbench.sh +++ b/test-scripts/benchmark/sysbench.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,13 +27,13 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt TIMES=8 PASSORFAIL=0 #default is success @@ -58,7 +59,7 @@ do [ "${TEST}" = "threadsR" ] && opt="${opt} --thread-locks=$((${t}/2))" [ "${TEST}" = "fileio" ] && opt="${opt} --file-test-mode=${FILE_TEST_MODE}" echo "Running sysbench ${opt} run" | tee ${log_file}; - $UTIL_PATH/sysbench ${opt} run | tee -a ${log_file}; + sysbench ${opt} run | tee -a ${log_file}; # parse log file & submit to test result sed -n -e '/Test execution summary\|General statistics/,/^$/p' ${log_file} | while read line; diff --git a/test-scripts/clock/gettime.sh b/test-scripts/clock/gettime.sh index ee6a990..66db495 100755 --- a/test-scripts/clock/gettime.sh +++ b/test-scripts/clock/gettime.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,18 +27,18 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # validate that time is monotonic # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt PASSORFAIL=1 echo "=============> Running Test Test: gettime <==============" echo date -RESULT="$( ($UTIL_PATH/gettimeofday02) 2>&1)" +RESULT="$( (gettimeofday02) 2>&1)" echo "$RESULT" echo "$RESULT" >> result.txt GREPPASS="$( (grep "PASS" result.txt) 2>&1)" @@ -51,7 +52,7 @@ if [ "$WCPASS" == 1 ]; then fi rm greppass.txt rm result.txt -echo "=============> Finished Test: EBIZZY <==============" +echo "=============> Finished Test: gettime <==============" echo date exit $PASSORFAIL diff --git a/test-scripts/clock/rtc.sh b/test-scripts/clock/rtc.sh index ccb2de6..292bee3 100755 --- a/test-scripts/clock/rtc.sh +++ b/test-scripts/clock/rtc.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,18 +27,18 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # validate that rtc device is functional # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt PASSORFAIL=1 echo "=============> Running Test Test: rtc <==============" echo date -RESULT="$( ($UTIL_PATH/rtc01) 2>&1)" +RESULT="$( (rtc01) 2>&1)" echo "$RESULT" echo "$RESULT" >> result.txt GREPPASS="$( (grep "Passed" result.txt) 2>&1)" diff --git a/test-scripts/cpu/cpu_freq.sh b/test-scripts/cpu/cpu_freq.sh index 767227e..8af8d54 100755 --- a/test-scripts/cpu/cpu_freq.sh +++ b/test-scripts/cpu/cpu_freq.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # check cpu clock frequency transition table @@ -42,7 +43,7 @@ if [ ! "$GREPPASS" ]; then exit $PASSORFAIL fi rm result.txt -echo "=============> Running Test Test: cpu_freq <==============" +echo "=============> Finished Test:: cpu_freq <==============" echo date PASSORFAIL=$((PASSORFAIL-1)) diff --git a/test-scripts/cpu/cpu_idle_state-test.sh b/test-scripts/cpu/cpu_idle_state-test.sh new file mode 100644 index 0000000..423c0d1 --- /dev/null +++ b/test-scripts/cpu/cpu_idle_state-test.sh @@ -0,0 +1,50 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +#chacks that cpu is in idle state + + + +echo "=============> Running Test Test: cpu_idle_state-test.sh <==============" + +IDL=$(cat /sys/devices/system/cpu/cpu0/cpuidle/state1/usage) ||\ +(echo "cat failed in script $0" && exit 1) || exit 1 + +RES=1 +if [ $IDL -gt 0 ]; then + echo "========= $IDL bigger than 0 - PASS!!! ============" + RES=0 +fi + +echo "=============> Finished Test:: cpu_idle_state-test.sh <==============" +exit $RES + + + diff --git a/test-scripts/cpu/lscpu.sh b/test-scripts/cpu/lscpu.sh index e794ffe..abcd3fb 100755 --- a/test-scripts/cpu/lscpu.sh +++ b/test-scripts/cpu/lscpu.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # execute lscpu @@ -35,11 +36,12 @@ echo date # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -PASSORFAIL=1 -export PATH=${PATH}:$UTIL_PATH -RESULT="$( ($UTIL_PATH/lscpu) 2>&1)" +PASSORFAIL=1 +#no need for export here, it's done in generally-used-variables.txt +#export PATH=${PATH}:$UTIL_PATH +RESULT="$( (lscpu) 2>&1)" echo "$RESULT" echo "$RESULT" >> result.txt GREPPASS="$( (grep "CPU" result.txt) 2>&1)" diff --git a/test-scripts/cpu/psci-hotplug-test.sh b/test-scripts/cpu/psci-hotplug-test.sh index fe1e952..c3250bd 100755 --- a/test-scripts/cpu/psci-hotplug-test.sh +++ b/test-scripts/cpu/psci-hotplug-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # This test checks CPU hotplug feature by turning CPUs off, and turning them on afterwards # This test requires Trustzone image that supports PSCI features diff --git a/test-scripts/display/glmark.sh b/test-scripts/display/glmark.sh index d21d8e5..0a6ee7a 100755 --- a/test-scripts/display/glmark.sh +++ b/test-scripts/display/glmark.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh + # execute glmark2 graphics benchmark @@ -35,9 +36,11 @@ PASSORFAIL=1 echo "=============> Running Test: glmark FPS <===============" echo date +rm $LOG # start the X server export DISPLAY=:0 -X &> X.log & +LOG="glmark_test_X_server.log" +X &> $LOG & sleep 2 RESULT="$( (timeout 1m glmark2) 2>&1)" echo "$RESULT" >> result.txt @@ -47,6 +50,7 @@ if [ ! "$GREPPASS" ]; then exit $PASSORFAIL fi +rm $LOG echo "=============> Finished Test: glmark FPS <==============" echo date diff --git a/test-scripts/display/opengl_glxgears_test.sh b/test-scripts/display/opengl_glxgears_test.sh index e4ddc60..82284fd 100755 --- a/test-scripts/display/opengl_glxgears_test.sh +++ b/test-scripts/display/opengl_glxgears_test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # This tests runs glxgears tool and measures the FPS perfomance. # The test expects input FPS argument to assess PASS/FAIL decision. @@ -38,7 +38,7 @@ echo MIN_FPS_THRESHOLD=$1 MAX_FPS_THRESHOLD=$2 -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt $UTIL_PATH/check-args-num.sh $# 2 || MIN_FPS_THRESHOLD=1 && MAX_FPS_THRESHOLD=1000000 diff --git a/test-scripts/display/tuxracer.sh b/test-scripts/display/tuxracer.sh index 7ea61ff..617e28d 100755 --- a/test-scripts/display/tuxracer.sh +++ b/test-scripts/display/tuxracer.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # execute tuxracer diff --git a/test-scripts/gpio/gpio-test.sh b/test-scripts/gpio/gpio-test.sh index 3f5f8a9..6b371dd 100755 --- a/test-scripts/gpio/gpio-test.sh +++ b/test-scripts/gpio/gpio-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -27,7 +28,6 @@ -#!/bin/sh #testing GPIO by sending and receiving signals in predefined connection points #IMPORTANT!! before running test connect gpio points as illustrated: #illustration of connected gpio points. @@ -47,14 +47,16 @@ signal_to_apq() #$1=signal value(1/0). $2=out_apq_name. $3=in_apq_name. $4=line echo "$1" > $GPIO_PATH/$2/value READ_RES=$(cat $GPIO_PATH/$3/value) if [ $READ_RES != "$1" ]; then - $UTIL_PATH/logger.sh $THIS_FILE_NAME $FAIL -v "writen $1, got: $READ_RES on: $2 to: $3" $4 + echo "writen $1, got: $READ_RES on: $2 to: $3 line_num=$4" ERR_COUNT=$((ERR_COUNT+1)) fi } ########################## test run ############################################################### +echo "========== starting gpio test ==================" +ERR_COUNT=0 # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt THIS_FILE_NAME=$0 FAIL=1 @@ -110,6 +112,8 @@ for index in $INDEX_NUMS ; do eval echo \$OUT_APQ_NUMS$index > $GPIO_PATH/unexport done +echo "========== finished gpio test with err_num=$ERR_COUNT ==================" + exit $ERR_COUNT diff --git a/test-scripts/gpio/leds-test.sh b/test-scripts/gpio/leds-test.sh index 133da55..263d21d 100755 --- a/test-scripts/gpio/leds-test.sh +++ b/test-scripts/gpio/leds-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,12 +27,11 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # tests turns on and of user leds # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt TIME=$1 diff --git a/test-scripts/gpio/uart_test.sh b/test-scripts/gpio/uart_test.sh index 4380f0d..b9fb228 100755 --- a/test-scripts/gpio/uart_test.sh +++ b/test-scripts/gpio/uart_test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # sending from 5 to 13 # sending from 11 to 7 @@ -51,7 +51,7 @@ echo date # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt export OUTPUT="$( (stty -F /dev/ttyMSM0 -g) 2>&1)" stty -F /dev/ttyMSM1 $OUTPUT diff --git a/test-scripts/storage/fio-test.sh b/test-scripts/storage/fio-test.sh index c36ba7a..7b63c3a 100755 --- a/test-scripts/storage/fio-test.sh +++ b/test-scripts/storage/fio-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #IMPORTANT! RUN TEST ONLY WITH USB mass storage INSIDE!!! # runs fio-test.py from util directory # receives as argument - USB mass storage device name @@ -35,7 +35,7 @@ echo "==================> starting fio-test.sh <=========================" # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt USB_DEVICE=$1 diff --git a/test-scripts/storage/sd-card-discover-test.sh b/test-scripts/storage/sd-card-discover-test.sh index bc31b9c..5354422 100755 --- a/test-scripts/storage/sd-card-discover-test.sh +++ b/test-scripts/storage/sd-card-discover-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,14 +27,13 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #IMPORTANT! RUN TEST ONLY WITH SD CARD INSIDE!!! #searchs "MMC_TYPE=SD" in command: "cat /sys/class/mmc_host/mmc1/mmc1:*/uevent" #fails if not found. logges fail result to verbose-test-log.txt on the device # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt THIS_FILE_NAME=$0 diff --git a/test-scripts/storage/storage_copyfile_test.sh b/test-scripts/storage/storage_copyfile_test.sh index c1b1273..872bf87 100755 --- a/test-scripts/storage/storage_copyfile_test.sh +++ b/test-scripts/storage/storage_copyfile_test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -25,87 +26,33 @@ #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # # this test copies the file from folder1 to folder2 and then from folder2 to folder1 # and checks for file validity and desired copy speeds (KPIs) # +############### function definition ##################### +cleanup() +{ + echo + echo "===cleaning...=====" -echo -echo "=====> Running Test (copy file) <======" -echo -date - -MODE1=$1 -MODE2=$2 -FILE_SIZE_IN_MB=$3 -COPY1_KPI=$4 -COPY2_KPI=$5 -RESULT=0 - -echo mode1 is $MODE1 -echo mode2 is $MODE2 -echo file size is $FILE_SIZE_IN_MB -echo copy rate 1 pass threshold is $COPY1_KPI MBps -echo copy rate 2 pass threshold is $COPY2_KPI MBps - - -if [ -z "$MODE1" ] -then - echo ERROR: folder1 is not specified. It should be one of the following: usb, sdcard or onboard_flash - date - exit 7 -fi - -if [ -z "$MODE2" ] -then - echo ERROR: folder2 is not specified. It should be one of the following: usb, sdcard or onboard_flash - date - exit 7 -fi - -if [ -z "$FILE_SIZE_IN_MB" ] -then - echo File size in MB, not supplied. Defaulting to 1024MB - FILE_SIZE_IN_MB=1024 -fi - -if [ -z "$COPY1_KPI" ] -then - echo Copy1 KPI not given, defaulting to 0 - COPY1_KPI=0 -fi - -if [ -z "$COPY2_KPI" ] -then - echo Copy2 KPI not given, defaulting to 0 - COPY2_KPI=0 -fi - -FOLDER1='/home/linaro/folder1' -FOLDER2='/home/linaro/folder2' -FILENAME_SRC=test.bin -FILENAME_DEST=test.2.bin -FILENAME_ROUNDTRIP=test.3.bin + echo "=====removing dir=$FOLDER1===" + rm -r $FOLDER1 + echo "=====removing dir=$FOLDER2===" + rm -r $FOLDER2 + echo "====unmounting dir=$FOLDER1===" + umount $FOLDER1 + echo "====unmounting dir=$FOLDER2===" + umount $FOLDER2 -# do some ome cleanup of potenitally previously failed run -echo pre-test cleaning... -umount $FOLDER1 &> /dev/null -rm -rf $FOLDER1 &> /dev/null -umount $FOLDER2 &> /dev/null -rm -rf $FOLDER2 &> /dev/null -sleep 1 -mkdir $FOLDER1 -mkdir $FOLDER2 -echo cleaning done... -echo + sleep 1 + echo "=====cleaning done...====" +} -# # gets mode argument and decides if need to mount according to this mode -# mount_if_needed () { MODE=$1 FOLDER_TO_MOUNT=$2 @@ -121,22 +68,41 @@ mount_if_needed () { DEVICE_NAME=$(lsblk | grep -o -E 'sd[a,z][1-9]') echo USB device name is $DEVICE_NAME + BENCHMARK_MODE_2_FLASH="12.054" + BENCHMARK_FLASH_2_MODE="13.486" - elif [ "$MODE" == "sdcard" ] +# elif [ "$MODE" == "sdcard" ] + elif echo $MODE | grep "sdcard.*" then - echo "mode: sdcard" echo DEVICE_NAME=$(lsblk | grep -o -E 'mmcblk1p[0-9]') echo SDCARD device name is $DEVICE_NAME + SDCARD_SUFFIX=$(echo $MODE | cut -d"-" -f2) + if [ $SDCARD_SUFFIX == "HC" ]; then + BENCHMARK_FLASH_2_MODE="52.7264" + BENCHMARK_MODE_2_FLASH="12.2547" + elif [ $SDCARD_SUFFIX == "XC" ]; then + BENCHMARK_FLASH_2_MODE="50.3788" + BENCHMARK_MODE_2_FLASH="12.778" + elif [ $SDCARD_SUFFIX == "regular" ]; then + BENCHMARK_FLASH_2_MODE="8.71823" + BENCHMARK_MODE_2_FLASH="12.0076" + else + echo "ERROR: wrong mode SUFFIX argument given - $MODE. It should be one of the following: \ + sdcard-regular/sdcard-HC/sdcard-xc" + date + exit 4 + fi elif [ "$MODE" == "onboard_flash" ] then echo "mode: onboard_flash" echo - + BENCHMARK_FLASH_2_MODE="11.5755" + BENCHMARK_MODE_2_FLASH="11.6578" else echo echo "ERROR: wrong mode argument given - $MODE. It should be one of the following: usb, sdcard or onboard_flash" @@ -145,6 +111,7 @@ mount_if_needed () { exit 4 fi + if [ ! "$MODE" == "onboard_flash" ] then @@ -167,30 +134,6 @@ mount_if_needed () { fi } -echo "-------------- preparing FOLDER1 -------------------" -mount_if_needed $MODE1 $FOLDER1 -echo "---------------------- done ------------------------" -echo -echo "-------------- preparing FOLDER2 -------------------" -mount_if_needed $MODE2 $FOLDER2 -echo "---------------------- done ------------------------" -echo - -echo FOLDER1 is $FOLDER1 -echo FOLDER2 is $FOLDER2 - -# create the temp file $FOLDER1/$FILENAME_SRC -echo -echo creating the temp $FOLDER1/$FILENAME_SRC -dd if=/dev/urandom of=$FOLDER1/$FILENAME_SRC bs=1M count=$FILE_SIZE_IN_MB conv=fsync -sync - -echo -echo clearning cache... -echo 3 > /proc/sys/vm/drop_caches -echo -sync - copy_file () { SRC=$1 DEST=$2 @@ -228,6 +171,96 @@ copy_file () { } +################## script execution ############################################ +echo +echo "=====> Running Test (copy file) <======" +echo +date + +MODE1=$1 +MODE1=$1 +MODE2=$2 +FILE_SIZE_IN_MB=$3 +COPY1_KPI=$4 +COPY2_KPI=$5 +RESULT=0 + +echo mode1 is $MODE1 +echo mode2 is $MODE2 +echo file size is $FILE_SIZE_IN_MB +echo copy rate 1 pass threshold is $COPY1_KPI MBps +echo copy rate 2 pass threshold is $COPY2_KPI MBps + + +if [ -z "$MODE1" ] +then + echo ERROR: folder1 is not specified. It should be one of the following: usb, sdcard or onboard_flash + date + exit 7 +fi + +if [ -z "$MODE2" ] +then + echo ERROR: folder2 is not specified. It should be one of the following: usb, sdcard or onboard_flash + date + exit 7 +fi + +if [ -z "$FILE_SIZE_IN_MB" ] +then + echo File size in MB, not supplied. Defaulting to 1024MB + FILE_SIZE_IN_MB=1024 +fi + +if [ -z "$COPY1_KPI" ] +then + echo Copy1 KPI not given, defaulting to 0 + COPY1_KPI=0 +fi + +if [ -z "$COPY2_KPI" ] +then + echo Copy2 KPI not given, defaulting to 0 + COPY2_KPI=0 +fi + +FOLDER1='/home/linaro/folder1' +FOLDER2='/home/linaro/folder2' +FILENAME_SRC=test.bin +FILENAME_DEST=test.2.bin +FILENAME_ROUNDTRIP=test.3.bin + +# do some ome cleanup of potenitally previously failed run +cleanup + +mkdir $FOLDER1 +mkdir $FOLDER2 + + +echo "-------------- preparing FOLDER1 -------------------" +mount_if_needed $MODE1 $FOLDER1 +echo "---------------------- done ------------------------" +echo +echo "-------------- preparing FOLDER2 -------------------" +mount_if_needed $MODE2 $FOLDER2 +echo "---------------------- done ------------------------" +echo + +echo FOLDER1 is $FOLDER1 +echo FOLDER2 is $FOLDER2 + +# create the temp file $FOLDER1/$FILENAME_SRC +echo +echo creating the temp $FOLDER1/$FILENAME_SRC +dd if=/dev/urandom of=$FOLDER1/$FILENAME_SRC bs=1M count=$FILE_SIZE_IN_MB conv=fsync +sync + +echo +echo clearning cache... +echo 3 > /proc/sys/vm/drop_caches +echo +sync + copy_file $FOLDER1/$FILENAME_SRC $FOLDER2/$FILENAME_DEST copy1.log FILE_SIZE=$( (ls -l $FOLDER1/$FILENAME_SRC | awk '{ print $5 }' ) ) @@ -258,7 +291,7 @@ COPY_2_SPEED=$( (echo $FILE_SIZE $TIME_COPY2 | awk '{ print $1 / $2 / 1024 / 102 COPY_2_SPEED_INT=$( (awk "BEGIN {printf \"%d\n\",$COPY_2_SPEED}") ) echo Copy from $MODE2 to $MODE1 data rate: $COPY_2_SPEED MBps -echo "Copy from $MODE1 to $MODE2 data rate: $COPY_1_SPEED MBps, Copy from $MODE2 to $MODE1 data rate: $COPY_2_SPEED MBps" > test_string_ret_val.txt +echo "bench=$BENCHMARK_FLASH_2_MODE from=$MODE1 to=$MODE2 rate=$COPY_1_SPEED MBps, bench=$BENCHMARK_MODE_2_FLASH from=$MODE2 to=$MODE1 rate=$COPY_2_SPEED MBps" > test_string_ret_val.txt if [ "$RESULT" -eq "0" ] ; then if [ "$COPY_1_SPEED_INT" -lt "$COPY1_KPI" ]; then @@ -272,17 +305,7 @@ fi # do some cleanup after test -echo -echo cleaning after test... -umount $FOLDER1 &> /dev/null -rm -rf $FOLDER1 &> /dev/null -umount $FOLDER2 &> /dev/null -rm -rf $FOLDER2 &> /dev/null -sleep 1 -mkdir $FOLDER1 -mkdir $FOLDER2 -echo cleaning done... -echo +cleanup echo if [ "$RESULT" -eq "0" ] diff --git a/test-scripts/storage/storage_dd_test.sh b/test-scripts/storage/storage_dd_test.sh index 690a2b9..02544a9 100755 --- a/test-scripts/storage/storage_dd_test.sh +++ b/test-scripts/storage/storage_dd_test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,9 +27,24 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # script tests resd/write data rate capabilities of peripheral devices (USB flash memory, internal flash memeory, SD card) +############### function definition ##################### +cleanup() +{ + echo + echo "===cleaning...=====" + echo "=====removing dir====" + #rm -rf $READ_WRITE_FOLDER + rm -r $READ_WRITE_FOLDER + echo "====unmounting=====" + umount $READ_WRITE_FOLDER + sleep 1 + echo "=====cleaning done...====" +} + +################## script execution ############################################ + echo echo "=====> Running Test (DD read and write test) <======" @@ -41,10 +57,11 @@ READ_KPI=$3 WRITE_KPI=$4 PASSORFAIL=2 -echo mode is $MODE -echo file size in MB is $FILE_SIZE_IN_MB -echo read pass threshold is $READ_KPI MBps -echo write pass threshold is $WRITE_KPI MBps + +echo "=====mode is $MODE=====" +echo "=====file size in MB is $FILE_SIZE_IN_MB=====" +echo "=====read pass threshold is $READ_KPI MBps=====" +echo "=====write pass threshold is $WRITE_KPI MBps=====" if [ -z "$MODE" ] then @@ -75,14 +92,17 @@ READ_WRITE_FOLDER='/home/linaro/read_write_folder' FILENAME=test.bin # do some ome cleanup of potenitally previously failed run -echo pre-test cleaning... -umount $READ_WRITE_FOLDER &> /dev/null -rm -rf $READ_WRITE_FOLDER &> /dev/null -sleep 1 +cleanup +#echo pre-test cleaning... +#umount $READ_WRITE_FOLDER &> /dev/null +#rm -rf $READ_WRITE_FOLDER &> /dev/null +#sleep 1 +#echo cleaning done... +#echo + + mkdir $READ_WRITE_FOLDER -echo cleaning done... -echo -echo running test now... +echo "=====running test now...========" if [ "$MODE" == "usb" ] then @@ -92,21 +112,38 @@ then DEVICE_NAME=$(lsblk | grep -o -E 'sd[a,z][1-9]') echo USB device name is $DEVICE_NAME - -elif [ "$MODE" == "sdcard" ] + BENCHMARK_R="20.5457" + BENCHMARK_W="5.31559" +#elif [ "$MODE" == "sdcard" ] +elif echo $MODE | grep "sdcard.*" then - echo "mode: sdcard" echo - DEVICE_NAME=$(lsblk | grep -o -E 'mmcblk1p[0-9]') echo SDCARD device name is $DEVICE_NAME - + SDCARD_SUFFIX=$(echo $MODE | cut -d"-" -f2) + if [ $SDCARD_SUFFIX == "HC" ]; then + BENCHMARK_R="60.2566" + BENCHMARK_W="5.57637" + elif [ $SDCARD_SUFFIX == "XC" ]; then + BENCHMARK_R="71.4585" + BENCHMARK_W="5.54113" + elif [ $SDCARD_SUFFIX == "regular" ]; then + BENCHMARK_R="14.7264" + BENCHMARK_W="3.81923" + else + echo "ERROR: wrong mode SUFFIX argument given - $MODE. It should be one of the following: \ +sdcard-regular/sdcard-HC/sdcard-xc" + date + exit 4 + fi elif [ "$MODE" == "onboard_flash" ] then echo "mode: onboard_flash" echo + BENCHMARK_R="147.827" + BENCHMARK_W="5.45994" else echo @@ -192,7 +229,7 @@ READ_SPEED=$( (echo $FILE_SIZE $TIME_READ | awk '{ print $1 / $2 / 1024 / 1024 } READ_SPEED_INT=$( (awk "BEGIN {printf \"%d\n\",$READ_SPEED}") ) echo Read data rate: $READ_SPEED MBps -echo "read data rate: $READ_SPEED MBps, write data rate: $WRITE_SPEED MBps" > test_string_ret_val.txt +echo "bench_r=$BENCHMARK_R, read=$READ_SPEED MBps. bench_w=$BENCHMARK_W, write=$WRITE_SPEED MBps" > test_string_ret_val.txt if [ "$WRITE_SPEED_INT" -lt "$WRITE_KPI" ] then @@ -208,13 +245,14 @@ then fi # do some cleanup after test -echo -echo cleaning after test... -umount $READ_WRITE_FOLDER &> /dev/null -rm -rf $READ_WRITE_FOLDER &> /dev/null -sleep 1 -mkdir $READ_WRITE_FOLDER -echo cleaning done... +cleanup +#echo +#echo cleaning after test... +#umount $READ_WRITE_FOLDER &> /dev/null +#rm -rf $READ_WRITE_FOLDER &> /dev/null +#sleep 1 +#mkdir $READ_WRITE_FOLDER +#echo cleaning done... echo if [ "$RESULT" -eq "0" ] diff --git a/test-scripts/storage/storage_iozone_test.sh b/test-scripts/storage/storage_iozone_test.sh index a28360c..9572877 100755 --- a/test-scripts/storage/storage_iozone_test.sh +++ b/test-scripts/storage/storage_iozone_test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,10 +27,23 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # runs iozone - IOzone is a filesystem benchmark tool. The benchmark generates and measures a variety of file operations. - +############### function definition ##################### +cleanup() +{ + echo + echo "===cleaning...=====" + echo "=====removing dir====" + #rm -rf $READ_WRITE_FOLDER + rm -r $READ_WRITE_FOLDER + echo "====unmounting=====" + umount $READ_WRITE_FOLDER + sleep 1 + echo "=====cleaning done...====" +} + +################## script execution ############################################ echo echo "=====> Running Test (iozone) <======" @@ -87,14 +101,17 @@ READ_WRITE_FOLDER='/home/linaro/read_write_folder' FILENAME=test.bin # do some ome cleanup of potenitally previously failed run -echo pre-test cleaning... -umount $READ_WRITE_FOLDER &> /dev/null -rm -rf $READ_WRITE_FOLDER &> /dev/null -sleep 1 +cleanup +#echo pre-test cleaning... +#rm -r $READ_WRITE_FOLDER &> /dev/null +#umount $READ_WRITE_FOLDER &> /dev/null +#sleep 1 +#echo cleaning done... +#echo + + mkdir $READ_WRITE_FOLDER -echo cleaning done... -echo -echo running test now... +echo "======running test now...======" if [ "$MODE" == "usb" ] then @@ -104,25 +121,45 @@ then DEVICE_NAME=$(lsblk | grep -o -E 'sd[a,z][1-9]') echo USB device name is $DEVICE_NAME + BENCHMARK_R="21819" + BENCHMARK_W="10041" -elif [ "$MODE" == "sdcard" ] +#elif [ "$MODE" == "sdcard" ] +elif echo $MODE | grep "sdcard.*" then - echo "mode: sdcard" echo - DEVICE_NAME=$(lsblk | grep -o -E 'mmcblk1p[0-9]') echo SDCARD device name is $DEVICE_NAME + SDCARD_SUFFIX=$(echo $MODE | cut -d"-" -f2) + if [ $SDCARD_SUFFIX == "HC" ]; then + BENCHMARK_R="55155" + BENCHMARK_W="26939" + elif [ $SDCARD_SUFFIX == "XC" ]; then + BENCHMARK_R="67792" + BENCHMARK_W="26283" + elif [ $SDCARD_SUFFIX == "regular" ]; then + BENCHMARK_R="16305" + BENCHMARK_W="1165" + else + echo "ERROR: wrong mode SUFFIX argument given - $MODE. It should be one of the following: \ +sdcard-regular/sdcard-HC/sdcard-xc" + date + exit 4 + fi elif [ "$MODE" == "onboard_flash" ] then echo "mode: onboard_flash" echo + BENCHMARK_R="14003" + BENCHMARK_W="3519" else echo - echo "ERROR: wrong mode argument given - $MODE. It should be one of the following: usb, sdcard or onboard_flash" + echo "ERROR: wrong mode argument given - $MODE. It should be one of the following: \ +usb, sdcard-regular/sdcard-HC/sdcard-xc or onboard_flash" echo date exit 4 @@ -144,7 +181,7 @@ then # mount mount -o rw /dev/$DEVICE_NAME $READ_WRITE_FOLDER - echo USB drive mounted to $READ_WRITE_FOLDER + echo "USB drive mounted to READ_WRITE_FOLDER=$READ_WRITE_FOLDER" mount | grep read_write fi @@ -195,17 +232,16 @@ else RESULT=0 fi -#writing result to file, to be read by test-executor.sh and used in log files -echo "read = $READ_RES. write = $WRITE_RES" > test_string_ret_val.txt # do some cleanup after test -echo -echo cleaning after test... -umount $READ_WRITE_FOLDER &> /dev/null -rm -rf $READ_WRITE_FOLDER &> /dev/null -sleep 1 -mkdir $READ_WRITE_FOLDER -echo cleaning done... +cleanup + + +#writing result to file, to be read by test-executor.sh and used in log files +echo "bench_r=$BENCHMARK_R, read=$READ_RES. bench_w=$BENCHMARK_W, write=$WRITE_RES" > test_string_ret_val.txt + +#mkdir $READ_WRITE_FOLDER + echo if [ "$RESULT" -eq "0" ] diff --git a/test-scripts/storage/usb-discover-test.sh b/test-scripts/storage/usb-discover-test.sh index 6b416ed..0e8d022 100755 --- a/test-scripts/storage/usb-discover-test.sh +++ b/test-scripts/storage/usb-discover-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,14 +27,13 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #testing presence of all usb devices: 1-1.1:1.0, 1-1.2:1.0 in $(ls /sys/bus/usb/devices/) #fails if at least one is missing. logges the missing usbs to verbose-test-log.txt on the device # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt THIS_FILE_NAME=$0 diff --git a/test-scripts/video/Video-1080p-24fps-MOV-Audio-HDMI-stability-test.sh b/test-scripts/video/Video-1080p-24fps-MOV-Audio-HDMI-stability-test.sh index 2fa9f0d..207bc14 100755 --- a/test-scripts/video/Video-1080p-24fps-MOV-Audio-HDMI-stability-test.sh +++ b/test-scripts/video/Video-1080p-24fps-MOV-Audio-HDMI-stability-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # plays gst for 14 hours # Please connect HDMI to DUT @@ -36,11 +36,20 @@ echo "=============> Running Test: Video-1080p-24fps-MOV-Audio-HDMI-stability-te echo # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS VIDEO_FILE_1080P_24FPS_MOV)" -GST_PIPELINE="! qtdemux name=demuxer demuxer. ! queue ! avdec_aac ! audioconvert ! audioresample ! alsasink device='hw:0,0' demuxer. ! queue ! h264parse ! avdec_h264 ! glimagesink" +# software decoder +#GST_PIPELINE="! qtdemux name=demuxer \ +# demuxer. ! queue ! avdec_aac ! audioconvert ! audioresample ! alsasink device='hw:0,0' \ +# demuxer. ! queue ! h264parse ! avdec_h264 ! glimagesink" + +# hardware decoder +GST_PIPELINE="! qtdemux name=demuxer \ + demuxer. ! queue ! avdec_aac ! audioconvert ! audioresample ! alsasink device='hw:0,0' \ + demuxer. ! queue ! h264parse ! v4l2video32videodec capture-io-mode=dmabuf ! glimagesink" + # 94 iterations of 9 MIN is 14.1 Hours NUM_ITER=94 @@ -55,7 +64,9 @@ do echo "NUM_ITER=$NUM_ITER" # it plays for 540 seconds = 9 MIN. approximately the length of the movie file. - $UTIL_PATH/play-gstreamer-and-check.sh $FILE_TO_PLAY "$GST_PIPELINE" 540 || (echo "utility failed! - play-gstreamer-and-check.sh" && exit 1) || exit 1 + $UTIL_PATH/play-gstreamer-and-check.sh $FILE_TO_PLAY "$GST_PIPELINE" 540 || \ + (echo "utility failed! - play-gstreamer-and-check.sh" && \ + echo "COUNTER=$COUNTER" && echo "NUM_ITER=$NUM_ITER" && exit 1) || exit 1 sleep 2 @@ -66,7 +77,7 @@ END_TIME=$(date +%s) RUN_TIME=$(($END_TIME-$START_TIME)) EXIT_VAL=0 -#14 hours in seconds is : 50400. suppose to be more than 14 hours +# 14 hours in seconds is : 50400. suppose to be more than 14 hours if [ $RUN_TIME -lt 50400 ]; then echo "test run less then 14 hours" EXIT_VAL=1 diff --git a/test-scripts/video/Video-encoder-test.sh b/test-scripts/video/Video-encoder-test.sh new file mode 100644 index 0000000..b8d71df --- /dev/null +++ b/test-scripts/video/Video-encoder-test.sh @@ -0,0 +1,67 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script encodes a new video file, plays and tests CPU usage while playing. +############################# functions definition ############################################### +cleanUp() +{ + echo "====> cleanup <====" + rm $FILE_TO_PLAY +} + +################################# test execution ##################################################### +date +echo "=============> Running Test: Video-encoder-test.sh $VIDEO_ENV_VARIABLE <===============" +echo + +cleanUp + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +FILE_TO_PLAY=encoder-video-test.ts + +echo "=====> Encoding new video file. video file duration: 70 seconds <=====" +gst-launch-1.0 -v videotestsrc num-buffers=2000 ! video/x-raw,width=1920,height=1080,framerate=30/1 \ +! v4l2video33h264enc capture-io-mode=dmabuf output-io-mode=dmabuf ! mpegtsmux ! filesink location=$FILE_TO_PLAY + +echo "====testing FILE_TO_PLAY=$FILE_TO_PLAY ========" +ls -alh $FILE_TO_PLAY + +# hardware decoder +GST_PIPELINE="! tsdemux name=demuxer demuxer. ! queue ! h264parse ! v4l2video32videodec capture-io-mode=dmabuf ! glimagesink" + +echo "==============> GST_PIPELINE=$GST_PIPELINE <================" + +$UTIL_PATH/play-gstreamer-and-check.sh $FILE_TO_PLAY "$GST_PIPELINE" || (echo "utility failed! - play-gstreamer-and-check.sh" && cleanUp && exit 1) || exit 1 + +cleanUp + +echo "=============> test finished: Video-play-video-File-test.sh $VIDEO_ENV_VARIABLE <===============" +echo diff --git a/test-scripts/video/Video-play-video-File-test.sh b/test-scripts/video/Video-play-video-File-test.sh index 2f50cc6..e60cb4c 100755 --- a/test-scripts/video/Video-play-video-File-test.sh +++ b/test-scripts/video/Video-play-video-File-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # test args: # arg 1 - file to play - variable name from "environmentVars.txt" file representing the video file # e.g "VIDEO_FILE_720P_24FPS_MOV" @@ -80,16 +80,16 @@ parse_audio_output () fi } ################################# test execution ##################################################### -date -echo "=============> Running Test: Video-720p-24fps-MOV-Audio-HDMI-test.sh <===============" -echo VIDEO_ENV_VARIABLE=$1 - AUDIO_OUTPUT=$2 +date +echo "=============> Running Test: Video-play-video-File-test.sh $VIDEO_ENV_VARIABLE $AUDIO_OUTPUT <===============" +echo + # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt $UTIL_PATH/check-args-num.sh $# 2 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 @@ -101,9 +101,17 @@ FILE_TO_PLAY="$CONTENT_PATH/$($GET_ENV_VARS $VIDEO_ENV_VARIABLE)" echo "====testing FILE_TO_PLAY=$FILE_TO_PLAY ========" +# software decoder +#GST_PIPELINE="! qtdemux name=demuxer \ +# demuxer. ! queue ! avdec_aac ! audioconvert ! audioresample ! alsasink device="hw:$AUDIO_OUTPUT" \ +# demuxer. ! queue ! h264parse ! avdec_h264 ! glimagesink" + +# hardware decoder +# repalcing v4l2video32videodec with v4l2video32dec for morty build GST_PIPELINE="! qtdemux name=demuxer \ demuxer. ! queue ! avdec_aac ! audioconvert ! audioresample ! alsasink device="hw:$AUDIO_OUTPUT" \ - demuxer. ! queue ! h264parse ! avdec_h264 ! glimagesink" + demuxer. ! queue ! h264parse ! v4l2video32dec capture-io-mode=dmabuf ! glimagesink" + echo "==============> GST_PIPELINE=$GST_PIPELINE <================" @@ -111,5 +119,9 @@ echo "==============> GST_PIPELINE=$GST_PIPELINE <================" $UTIL_PATH/play-gstreamer-and-check.sh $FILE_TO_PLAY "$GST_PIPELINE" || (echo "utility failed! - play-gstreamer-and-check.sh" && exit 1) || exit 1 -echo "=============> test finished: Video-720p-24fps-MOV-Audio-HDMI-test.sh <===============" +#echo "============cleanup remove file_to_play" +#echo "============FILE_TO_PLAY=$FILE_TO_PLAY" +#rm $FILE_TO_PLAY + +echo "=============> test finished: Video-play-video-File-test.sh $VIDEO_ENV_VARIABLE $AUDIO_OUTPUT <===============" echo diff --git a/test-scripts/video/Video-usbcam-test.sh b/test-scripts/video/Video-usbcam-test.sh new file mode 100644 index 0000000..fb5cf9a --- /dev/null +++ b/test-scripts/video/Video-usbcam-test.sh @@ -0,0 +1,110 @@ +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#!/bin/sh +# script uses binaries of zbarcam utility to scan a QR bar code. +# for this test to work you must connect a usb camera. in our testing we used Logitech c90 HD 1080p usb web cam +# arg1 = expected test result from QR code scan - the argument must be a non white seperated string e.g : this-is-a-test-string-for-web-cam + +############################# functions definition ############################################### +complete_zbarcam_missing_libraries () +{ + local MISSING_LIBS="$(ldd $UTIL_PATH/$ZBAR_DIR/zbarcam | grep "not found" | cut -d"=" -f1)" + + echo "========> MISSING_LIBS=$MISSING_LIBS <=========" + + for LIB in $MISSING_LIBS; do + cp $UTIL_PATH/$ZBAR_DIR/$LIB /usr/lib/ + done +} + +cleanup () +{ + # do some cleanup (kill and clean any remainders from previous runs) + echo "some cleanup ..." + echo + kill -9 $(pidof zbarcam) &>/dev/null + rm $ZBAR_LOG &>/dev/null + kill -9 $(pidof "X") &>/dev/null + sleep 1 + echo +} + +################################# test execution ##################################################### +date +echo "=============> Running Test: Video-usbcam-test.sh <===============" +echo + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +$UTIL_PATH/check-args-num.sh $# 1 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 + +SCAN_RESULT=$1 + +echo "=========> SCAN_RESULT=$SCAN_RESULT <=============" + +ZBAR_DIR="zbarcam" +ZBAR_LOG="zbarcam.log" + +cleanup + +complete_zbarcam_missing_libraries + +. $(dirname $(readlink -f $0))/../../util/activate_X_win_system_server.txt + +#export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH:$UTIL_PATH +export PATH=$PATH:$UTIL_PATH/$ZBAR_DIR/ + +zbarcam --raw /dev/video1 &>$ZBAR_LOG & + +echo "===> sleeping for 5 sec - letting zbarcam decipher the QR code <===" +sleep 5 + +echo "=======> zbarcam log content: <=======" +cat $ZBAR_LOG + +cat $ZBAR_LOG | grep $SCAN_RESULT || ( echo "===> failed to grep zbarlog <====" && cleanup && exit 1) || exit 1 + +cleanup + +date +echo "=============> successfully finished Test: Video-usbcam-test.sh <===============" +echo + + + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-connect-WPA2-PSK-security-test.sh b/test-scripts/wifi/wifi-connect-WPA2-PSK-security-test.sh index 5bcebb5..81edd2e 100755 --- a/test-scripts/wifi/wifi-connect-WPA2-PSK-security-test.sh +++ b/test-scripts/wifi/wifi-connect-WPA2-PSK-security-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,33 +27,26 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #connecting to WPA2-PSK secure wifi AP # arg 1 - ssid # arg 2 - password echo "============================> starting wifi-connect-WPA2-PSK-security-test.sh <============================" +#export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin":$PATH # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt - -$UTIL_PATH/check-args-num.sh $# 2 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -CONF="ctrl_interface=/run/wpa_supplicant -update_config=1 +SSID=$1 +PASSWORD=$2 -network={ - ssid=\"$1\" - psk=\"$2\" -} -" +check-args-num.sh $# 2 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 -export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin":$PATH +$UTIL_PATH/connect-STA.sh "WPA2-TKIP-security" $SSID $PASSWORD || (echo "connection failed" && exit 1) || exit 1 -export -$UTIL_PATH/get-wifi-config-and-connect.sh "$CONF" || (echo "connection failed" && exit 1) || exit 1 +$UTIL_PATH/disconnect-STA.sh echo "============================> successfully ended wifi-connect-WPA2-PSK-security-test.sh <============================" diff --git a/test-scripts/wifi/wifi-connect-open-security-test.sh b/test-scripts/wifi/wifi-connect-open-security-test.sh index 6be49b2..50e9568 100755 --- a/test-scripts/wifi/wifi-connect-open-security-test.sh +++ b/test-scripts/wifi/wifi-connect-open-security-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #connecting to open security wifi AP. $1 - wifi AP @@ -35,24 +35,16 @@ echo "================> starting wifi-connect-open-security-test.sh <=========== # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -$UTIL_PATH/check-args-num.sh $# 1 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 +SSID=$1 +$UTIL_PATH/check-args-num.sh $# 1 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 -CONF="ctrl_interface=/run/wpa_supplicant -update_config=1 - -network={ - ssid=\"$1\" - key_mgmt=NONE -} -" -export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin":$PATH -export +$UTIL_PATH/connect-STA.sh "open-security" $SSID || (echo "connection failed" && exit 1) || exit 1 -$UTIL_PATH/get-wifi-config-and-connect.sh "$CONF" || (echo "connection failed" && exit 1) || exit 1 +$UTIL_PATH/disconnect-STA.sh echo "================> successfully ended wifi-connect-open-security-test.sh <=======================" diff --git a/test-scripts/wifi/wifi-file-download-test.sh b/test-scripts/wifi/wifi-file-download-test.sh new file mode 100644 index 0000000..a2b5d59 --- /dev/null +++ b/test-scripts/wifi/wifi-file-download-test.sh @@ -0,0 +1,125 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#connecting to wifi AP and downloading large/small file from web +# arg 1 - ssid +# arg 2 - password +# arg 3 - large/small + +########################### function definition ###################################### +cleanup() +{ + rm $FILE_NAME + +} + +parse_arg() +{ + if [ "$FILE_SIZE_TO_DOWNLOAD" == "large" ]; then + FILE_NAME="big_buck_bunny_1080p_h264.mov" + FILE_TO_DOWNLOAD="http://download.blender.org/peach/bigbuckbunny_movies/$FILE_NAME" + elif [ "$FILE_SIZE_TO_DOWNLOAD" == "small" ]; then + FILE_NAME="58832_300x300" + FILE_TO_DOWNLOAD="https://i.vimeocdn.com/portrait/$FILE_NAME" + else + echo "=====ERROR: wrong third argument! must be \"large\" or \"small\"========" + exit 1 + fi +} + +########################## script execution ####################################### + +echo "============================> starting wifi-file-download-test.sh <============================" +#export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin":$PATH + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +SSID=$1 +PASSWORD=$2 +FILE_SIZE_TO_DOWNLOAD=$3 + +parse_arg + +cleanup + +check-args-num.sh $# 3 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 + +$UTIL_PATH/connect-STA.sh "WPA2-TKIP-security" $SSID $PASSWORD || (echo "connection failed" \ +&& $UTIL_PATH/disconnect-STA.sh && exit 1) || exit 1 + +echo "====adding google dns nameserver=====" + +setNameserver() # arg1 - nameserver string +{ + local NAMESERVER=$1 + local RESOLV_CONF="/etc/resolv.conf" + + if cat $RESOLV_CONF | grep -o $NAMESERVER -q; then + echo "====nameserver=$NAMESERVER already present in file=$RESOLV_CONF====" + else + echo "$NAMESERVER" >> $RESOLV_CONF + fi +} + +setNameserver "nameserver 8.8.8.8" +setNameserver "nameserver 8.8.8.4" + +echo "====/etc/resolv.conf======" +cat $RESOLV_CONF +sleep 1 + +RET_VAL="$((wget $FILE_TO_DOWNLOAD) 2>&1)" + +echo $RET_VAL | grep "100%" || \ +(echo "======ERROR:faild to download=RET_VAL=$RET_VAL=====" && \ +$UTIL_PATH/disconnect-STA.sh && cleanup && exit 1) || exit 1 + +if [ -e $FILE_NAME ]; then + echo "====== downloaded file found in file system =PASS=========" + ls -al +else + echo "=== ERROR: downloaded file not found in file system ====" + ls -al + cleanup + $UTIL_PATH/disconnect-STA.sh + exit 1 +fi + +cleanup + +$UTIL_PATH/disconnect-STA.sh + +echo "============================> successfully ended wifi-file-download-test.sh <============================" + + + + + + diff --git a/test-scripts/wifi/wifi-softap-KPI-performance-test.sh b/test-scripts/wifi/wifi-softap-KPI-performance-test.sh new file mode 100644 index 0000000..b5f2292 --- /dev/null +++ b/test-scripts/wifi/wifi-softap-KPI-performance-test.sh @@ -0,0 +1,159 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#secure WPA2-TKIP-PSK connection to Wifi softap +#creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP +#arg1 - performance KPI + + +########################################### function definition ############################################################ +FUNC_createHostapConf () +{ + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +channel=3 +ssid=$SOFTAP_SSID + +########## 11n connection ############### +hw_mode=g +country_code=JP +ieee80211n=1 +ht_capab=[SHORT-GI-20] +wmm_enabled=1 + +#for max inactivity flag to take effect rsn_pairwise must be commented out +ap_max_inactivity=7200 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_passphrase=$SOFTAP_PASS +macaddr_acl=0 +rsn_pairwise=CCMP +" + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +check_perf_result () #arg1 - result to check. arg2 - error msg +{ + if [ $1 -gt 0 ]; then + echo "==== ERROR:$2 ====" + echo "=======disconecting=======" + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + exit 1 + fi +} + +parse_performance_result () +{ + echo "$PERFORMANCE_RES" | grep -o "===> IPERF_RES=..........." | cut -d">" -f2 | cut -d"=" -f2 | cut -d" " -f1 +} +############################################## test execution ############################################################# +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + + +IPERF_KPI=$1 +SOFTAP_SSID="softap_kpi_performance" +SOFTAP_PASS="12345678" + +echo "=================> starting wifi-softap-KPI-performance-test.sh <=========================" + +FUNC_createHostapConf +FUNC_createWpa_suppConf + +connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" \ +|| (echo "utility failed! - connect-helperSTA-to-DUTsoftapV2.sh" && exit 1) || exit 1 + + +TIME_IPERF_RUN=90 +echo "=======> run performance_test.sh DUT-client WS-server <=============" +PERFORMANCE_RES="$( (performance_test.sh $HELPER_ADDR client $IPERF_KPI $TIME_IPERF_RUN) 2>&1)" +check_perf_result $? "performance script failed" +DUT_SERVER_IPERF_RES=$(parse_performance_result) +echo "===========> DUT_SERVER_IPERF_RES=$DUT_SERVER_IPERF_RES <================" + + + +echo "=====> run performance_test.sh WS-client DUT-server <================" +PERFORMANCE_RES="$( (performance_test.sh $HELPER_ADDR server $IPERF_KPI $TIME_IPERF_RUN) 2>&1)" +check_perf_result $? "performance script failed" +DUT_CLIENT_IPERF_RES=$(parse_performance_result) +echo "===========> DUT_CLIENT_IPERF_RES=$DUT_CLIENT_IPERF_RES <===========" + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + + + +echo "DUT-server=$DUT_SERVER_IPERF_RES. DUT-client=$DUT_CLIENT_IPERF_RES" > test_string_ret_val.txt + +echo "===============> successfully finished wifi-softap-KPI-performance-test.sh <====================" +exit 0 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-softap-WPA2-PSK-secure-connect-test.sh b/test-scripts/wifi/wifi-softap-WPA2-PSK-secure-connect-test.sh index 2a9fbfe..335eb39 100755 --- a/test-scripts/wifi/wifi-softap-WPA2-PSK-secure-connect-test.sh +++ b/test-scripts/wifi/wifi-softap-WPA2-PSK-secure-connect-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #secure WPA2-TKIP-PSK connection to Wifi softap #creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP #receives no arguments @@ -81,10 +81,9 @@ network={ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -echo "============ testing UTIL_PATH=$UTIL_PATH ============================" -SOFTAP_SSID="softapTestSecure" +SOFTAP_SSID="softapSecureTest" SOFTAP_PASS="12345678" echo "=================> starting wifi-softap-WPA2-PSK-secure-connect-test.sh <=========================" @@ -92,11 +91,10 @@ echo "=================> starting wifi-softap-WPA2-PSK-secure-connect-test.sh <= FUNC_createHostapConf FUNC_createWpa_suppConf -$UTIL_PATH/connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" \ -|| (echo "utility failed! - connect-helperSTA-to-DUTsoftap.sh" && exit 1) || exit 1 -$UTIL_PATH/disconnect-helperSTA-from-DUTsoftap.sh \ -|| (echo "utility failed! - disconnect-helperSTA-from-DUTsoftap.sh" && exit 1) || exit 1 +softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" \ +|| (echo "utility failed! - softap-connect.sh" && exit 1) || exit 1 + echo "===============> successfully finished wifi-softap-WPA2-PSK-secure-connect-test.sh script <====================" exit 0 diff --git a/test-scripts/wifi/wifi-softap-WPS-pin-test.sh b/test-scripts/wifi/wifi-softap-WPS-pin-test.sh new file mode 100644 index 0000000..8c55b0b --- /dev/null +++ b/test-scripts/wifi/wifi-softap-WPS-pin-test.sh @@ -0,0 +1,265 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#secure WPA2-TKIP-PSK connection to Wifi softap +#creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP +#arg1 - performance KPI + + +########################################### function definition ############################################################ +cleanup() +{ + #remove TCP logs +# rm $WPA_CONF_FILE + echo "======cleanup: removing=$WPA_CONF_FILE from=$HELPER_ADDR========" + ssh $HELPER_ADDR "rm $WPA_CONF_FILE" +# $UTIL_PATH/kill-process-ids.sh tcpdump +} + +FUNC_createHostapConf () +{ + HOSTAPD_CONF=" +driver=nl80211 +interface=$CURR_WLAN +channel=6 +hw_mode=g + +# WPA2-Personal configuration for the AP +ssid=$SOFTAP_SSID +$SECURITY_CONF + +# Enable random per-device PSK generation for WPS clients +# Please note that the file has to exists for hostapd to start (i.e., create an +# empty file as a starting point). +wpa_psk_file=$HOSTAPD_PSK_FILE + +# Enable control interface for PBC/PIN entry +ctrl_interface=/var/run/hostapd + +# Enable internal EAP server for EAP-WSC (part of Wi-Fi Protected Setup) +eap_server=1 + +# WPS configuration (AP configured, do not allow external WPS Registrars) +wps_state=2 +ap_setup_locked=1 +# If UUID is not configured, it will be generated based on local MAC address. +#uuid=87654321-9abc-def0-1234-56789abc0000 +wps_pin_requests=/var/run/hostapd.pin-req +manufacturer=Qualcomm +model_name=QualcommSoftAP +model_number=8994 +serial_number=12345 +device_type=6-0050F204-1 +os_version=01020300 +config_methods=label display push_button keypad +" + + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + WPA_CONF="ctrl_interface=/run/wpa_supplicant" + echo "===========> WPA_CONF=$WPA_CONF" +} + +create_dhcpd_conf () +{ + GATEWAY_IP="192.168.9.1" + DHCPD_CONF=" +ddns-update-style none; +ignore client-updates; +authoritative; +option local-wpad code 252 = text; + +subnet +192.168.9.0 netmask 255.255.255.0 { +# --- default gateway +option routers +$GATEWAY_IP; +# --- Netmask +option subnet-mask +255.255.255.0; +# --- Broadcast Address +option broadcast-address +192.168.8.255; +# --- Domain name servers, tells the clients which DNS servers to use. +Option domain-name-servers +$GATEWAY_IP, 8.8.8.8, 8.8.4.4; +option time-offset +0; +range 192.168.9.3 192.168.9.128; +default-lease-time 1209600; +max-lease-time 1814400; +} +" + echo "======DHCPD_CONF=$DHCPD_CONF" +} + +pars_args() +{ + if [ $SECURITY_TYPE == "open" ]; then + SECURITY_CONF="#open- no need for password" + elif [ $SECURITY_TYPE == "wps2_psk" ]; then + SECURITY_CONF=" +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=CCMP +# Default WPA passphrase for legacy (non-WPS) clients +wpa_passphrase=$SOFTAP_PASS +" + else + echo "========ERRO: wrong argument - must be \"open\" or \"wps2_psk\"=========" + exit 1 + fi + + echo "======SECURITY_CONF=$SECURITY_CONF========" +} + +repeat_command_and_check_result() +{ + #arg1 - command to run, arg2 - iterations num, arg3 - possitive result, arg4 - time(seconds) between iterations + local CMD="$1" + local ITER_NUM=$2 + local EXPECTED_RESULT="$3" + local TIME=$4 + + for I in $(seq $ITER_NUM); do + RES="$($CMD)" + echo "====COMMAND=RES=$RES========" +# echo "====grep in if="$(echo $RES | grep -o "$EXPECTED_RESULT")"=====" +# echo "======expected result=$EXPECTED_RESULT=====" + if [ "$(echo $RES | grep -o "$EXPECTED_RESULT")" == "$EXPECTED_RESULT" ]; then + return 0 + fi + sleep $TIME + done + return 1 +} +############################################## test execution ############################################################# +echo "=================> starting wifi-softap-wps-pin-test.sh <=========================" +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +SECURITY_TYPE=$1 +echo "==============SECURITY_TYPE=$SECURITY_TYPE========================" +SOFTAP_SSID="softap_wps_pin" +SOFTAP_PASS="12345678" +WPA_CONF_FILE=wpa_wps.conf +pars_args +cleanup + +echo "========DUT operations : bring up softap===========" +HOSTAPD_PSK_FILE="/etc/hostapd.psk" +touch $HOSTAPD_PSK_FILE +FUNC_createHostapConf +FUNC_createWpa_suppConf +create_dhcpd_conf + +bringUp-softap.sh "$HOSTAPD_CONF" "$DHCPD_CONF" || \ +( echo "===failed to bring up softap====" && exit 1) || exit 1 + +echo "==========HELPER operations : generate WPS pin number=============" +ssh $HELPER_ADDR "echo $WPA_CONF > $WPA_CONF_FILE" +ssh $HELPER_ADDR "rfkill unblock all" +WPA_PID=$(ssh $HELPER_ADDR "pidof wpa_supplicant") +ssh $HELPER_ADDR "kill -9 $WPA_PID" +sleep 1 +ssh $HELPER_ADDR "wpa_supplicant -B -i wlan0 -c $WPA_CONF_FILE" +sleep 1 +TEMP=$(echo "$(ssh $HELPER_ADDR "wpa_cli wps_pin any")" | cut -d" " -f4) +PIN_NUM=$(echo $TEMP | grep "....") +echo "========PIN_NUM=$PIN_NUM===========" + +echo "==========DUT operations: activate wps pin with number from HELPER===========" +WPS_MODE_TIME=300 +HOSTAPD_WPS_CMD="hostapd_cli wps_pin any $PIN_NUM $WPS_MODE_TIME" +echo "======HOSTAPD_WPS_CMD=$HOSTAPD_WPS_CMD=======" +eval $HOSTAPD_WPS_CMD + +echo "=========HELPER operations : check conectivity===========" +CMD="ssh $HELPER_ADDR wpa_cli status" +repeat_command_and_check_result "$CMD" 20 "wpa_state=COMPLETED" 3 || \ +( echo "=====failed wpa_supplicant - NO wpa_state=COMPLETED ======" && exit 1) || exit 1 + +### remove previouse ip address +ssh $HELPER_ADDR "dhclient wlan0 -r" +sleep 2 +ssh $HELPER_ADDR "dhclient wlan0" +sleep 2 + +repeat_command_and_check_result "ping -c 1 $GATEWAY_IP" 20 "received, 0% packet loss" 3 || \ +( echo "=====failed to ping gateway ip ======" && exit 1) || exit 1 + +echo "=======wpa_conf before save=========" +ssh $HELPER_ADDR "cat $WPA_CONF_FILE" +echo "========saving in HELPER DUT AP credentials =============" +ssh $HELPER_ADDR "wpa_cli set update_config 1" +ssh $HELPER_ADDR "wpa_cli save_config" +sleep 1 +echo "=======wpa_conf after save=========" +ssh $HELPER_ADDR "cat $WPA_CONF_FILE" + +WPA_CONF_AFTER_SAVE=$(ssh $HELPER_ADDR "cat $WPA_CONF_FILE") +echo "======WPA_CONF_AFTER_SAVE=$WPA_CONF_AFTER_SAVE==========" +echo "$WPA_CONF_AFTER_SAVE" | grep "network" || \ +(echo "===wpa_supplicant failed to save DUT AP credentials===" && exit 1) || exit 1 + +cleanup + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + +echo "===============> successfully wifi-softap-wps-pin-test.sh <====================" +exit 0 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-softap-all-channels-connect-test.sh b/test-scripts/wifi/wifi-softap-all-channels-connect-test.sh index e36cd5e..f6f1101 100755 --- a/test-scripts/wifi/wifi-softap-all-channels-connect-test.sh +++ b/test-scripts/wifi/wifi-softap-all-channels-connect-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,23 +27,77 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # test is using wifi-softap-non-secure-connect-test.sh scripts to iterate through all channels # test receives no arguments +########################################### function definition ############################################################ +FUNC_createHostapConf () #arg1 - channel number +{ + local CHANNEL_NUM=$1 + + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +hw_mode=g +channel=$CHANNEL_NUM +ssid=$SOFTAP_SSID + +#for high throughput 20Mhz +country_code=JP +#advertises the country_code and the set of allowed channels and transmit power levels based on the regulatory limits +ieee80211d=1 + +ieee80211n=1 +wmm_enabled=1 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +macaddr_acl=0 +" + + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +############################################## test execution ############################################################# + # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt echo "======> starting test wifi-softap-all-channels-connect-test.sh <===================" +SOFTAP_SSID="softap-all-channels-test" +SOFTAP_PASS="12345678" + +FUNC_createWpa_suppConf for CHANNEL in $(seq 1 11) do echo "=======> starting connection in channel=$CHANNEL <==============" - $CURR_PATH/wifi-softap-non-secure-connect-test.sh -c $CHANNEL || \ -( echo "====> script wifi-softap-non-secure-connect-test.sh failed in channel=$CHANNEL <====" && exit 1 ) || exit 1 - + FUNC_createHostapConf $CHANNEL + + softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" \ + || (echo "====> utility - softap-connect.sh failed in channel=$CHANNEL <====" && exit 1) || exit 1 + echo "=======> successfully finished connecting in channel=$CHANNEL <==============" done diff --git a/test-scripts/wifi/wifi-softap-connect-ssid-test.sh b/test-scripts/wifi/wifi-softap-connect-ssid-test.sh new file mode 100644 index 0000000..318a7d7 --- /dev/null +++ b/test-scripts/wifi/wifi-softap-connect-ssid-test.sh @@ -0,0 +1,121 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# test receives max/min/special string as argument and creates softap connection with +# max size ssid, min size ssid and special character ssid respectively +# creates softap on DUT and connect Helper board as wifi STA to DUT + +########################################### function definition ############################################################ + +parse_args () +{ + if [ $SSID_TYPE = "min" ]; then + SOFTAP_SSID="i" + elif [ $SSID_TYPE = "max" ]; then + SOFTAP_SSID="iiiiiiiiioiiiiiiiiioiiiiiiiiioii" + elif [ $SSID_TYPE = "special" ];then + SOFTAP_SSID="#$&\\" + else + echo "===> EEROR: bad argument please supply min/max/special to define SSID type <===" + exit 1 + fi +} + +FUNC_createHostapConf () +{ + + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +hw_mode=g +channel=6 +ssid=$SOFTAP_SSID + +#for high throughput 20Mhz +country_code=JP +#advertises the country_code and the set of allowed channels and transmit power levels based on the regulatory limits +ieee80211d=1 + +ieee80211n=1 +wmm_enabled=1 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +macaddr_acl=0 +" + + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +################################ test execution ########################################## +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + + +SSID_TYPE=$1 +SOFTAP_PASS="12345678" + +echo "======> starting test wifi-softap-connect-ssid-test.sh with $SSID_TYPE SSID <===================" + +check-args-num.sh $# 1 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 + +parse_args +FUNC_createHostapConf +FUNC_createWpa_suppConf + +softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" || \ + ( echo "====> script softap-connect.sh failed <====" && exit 1 ) \ + || exit 1 + + +echo "======> successfully finished test wifi-softap-connect-ssid-test.sh $SSID_TYPE SSID <===================" + + + + + diff --git a/test-scripts/wifi/wifi-softap-country-code-regulation-test.sh b/test-scripts/wifi/wifi-softap-country-code-regulation-test.sh new file mode 100644 index 0000000..1fb2b36 --- /dev/null +++ b/test-scripts/wifi/wifi-softap-country-code-regulation-test.sh @@ -0,0 +1,206 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +# arg1 - country code +# arg2 - allowed channel list for country code (can be supplied as 1-5 or 1 2 3 4 5) +# arg3 - not allowed channel list for county code (can be supplied as 1-5 or 1 2 3 4 5) + +######################### function definition ######################################### +parse_channels_from_csv () +{ + COUNTRY_CODE_REGULATION_CSV_FILE=$UTIL_PATH/wifi-country-regulations.csv + + grep "$COUNTRY_CODE/" $COUNTRY_CODE_REGULATION_CSV_FILE \ + || (echo "===> ERROR: the country code you have entered \ +is not listed in our file=$COUNTRY_CODE_REGULATION_CSV_FILE <====" && exit 1) || exit 1 + + + CSV_LINE="$(grep "$COUNTRY_CODE/" $COUNTRY_CODE_REGULATION_CSV_FILE | grep ",b/g," \ + || grep "$COUNTRY_CODE/" $COUNTRY_CODE_REGULATION_CSV_FILE | grep ",g,")" + + ALLOWED_CHANNELS=$(echo $CSV_LINE | cut -d"," -f3) + + + # format e.g 1-13, 5-13 + FIRST_CHANNEL=$(echo $ALLOWED_CHANNELS | cut -d"-" -f1) + LAST_CHANNEL=$(echo $ALLOWED_CHANNELS | cut -d"-" -f2) +} + +higher_forbidden_channels_parsing () +{ + if [ $LAST_CHANNEL -lt 14 ]; then + FIRST_CHANNEL_FORBIDDEN_HIGHER=$((LAST_CHANNEL+1)) + LAST_CHANNEL_FORBIDDEN_HIGHER=14 + else + HIGHER_CHANNELS_TESTING_FLAG=$FALSE + fi +} + +lower_forbidden_channels_parsing () +{ + if [ $FIRST_CHANNEL -gt 1 ]; then + FIRST_CHANNEL_FORBIDDEN_LOWER=1 + LAST_CHANNEL_FORBIDDEN_LOWER=$((FIRST_CHANNEL-1)) + else + LOWER_CHANNELS_TESTING_FLAG=$FALSE + fi +} + +FUNC_createHostapConf () #arg1 - channel number +{ + local CHANNEL_NUM=$1 + + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +hw_mode=g +channel=$CHANNEL_NUM +ssid=$SOFTAP_SSID + +#for high throughput 20Mhz +country_code=$COUNTRY_CODE +#advertises the country_code and the set of allowed channels and transmit power levels based on the regulatory limits +ieee80211d=1 + +ieee80211n=1 +wmm_enabled=1 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +macaddr_acl=0 +" + + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +loop_channels () # arg1 - first cahnnel, arg2 - last channel, arg3 - allowed/forbidden channels +{ + local FIRST_CHANNEL=$1 + local LAST_CHANNEL=$2 + local CHANNEL_TYPE="$3" + + FUNC_createWpa_suppConf + for CHANNEL in $(seq $FIRST_CHANNEL $LAST_CHANNEL) +do + FUNC_createHostapConf $CHANNEL + echo "=======> starting connection in $CHANNEL_TYPE channel=$CHANNEL <==============" + #TODO: remove the sleep + sleep 3 + if [ $CHANNEL_TYPE = "allowed" ]; then + softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" || \ + ( echo "====> script softap-connect.sh failed in $CHANNEL_TYPE channel=$CHANNEL <====" && exit 1 ) \ + || exit 1 + + elif [ $CHANNEL_TYPE = "forbidden" ]; then + softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" && \ + echo "====> script softap-connect.sh succeeded in $CHANNEL_TYPE channel=$CHANNEL <====" && exit 1 + else + echo "====> loop_channels got bad argument - should be allowed/forbidden <====" && exit 1 + fi + echo "=======> successfully finished testing connection in $CHANNEL_TYPE channel=$CHANNEL <==============" +done +} + +################################ test execution ########################################## +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + +echo "======> starting test wifi-softap-country-code-regulation-test.sh $COUNTRY_CODE <===================" + +COUNTRY_CODE=$1 +SOFTAP_SSID="country-code-test" +SOFTAP_PASS="12345678" + +check-args-num.sh $# 1 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 + +parse_channels_from_csv + +echo "============> FIRST_CHANNEL=$FIRST_CHANNEL <=================" +echo "============> LAST_CHANNEL=$LAST_CHANNEL <=================" + +TRUE=0 +FALSE=1 +HIGHER_CHANNELS_TESTING_FLAG=$TRUE +LOWER_CHANNELS_TESTING_FLAG=$TRUE + +higher_forbidden_channels_parsing +lower_forbidden_channels_parsing + +echo "============> FIRST_CHANNEL_FORBIDDEN_HIGHER=$FIRST_CHANNEL_FORBIDDEN_HIGHER <=================" +echo "============> LAST_CHANNEL_FORBIDDEN_HIGHER=$LAST_CHANNEL_FORBIDDEN_HIGHER <=================" +echo "============> HIGHER_CHANNELS_TESTING_FLAG=$HIGHER_CHANNELS_TESTING_FLAG <=================" +echo "-----------------------------------------------------" +echo "============> FIRST_CHANNEL_FORBIDDEN_LOWER=$FIRST_CHANNEL_FORBIDDEN_LOWER <=================" +echo "============> LAST_CHANNEL_FORBIDDEN_LOWER=$LAST_CHANNEL_FORBIDDEN_LOWER <=================" +echo "============> LOWER_CHANNELS_TESTING_FLAG=$LOWER_CHANNELS_TESTING_FLAG <=================" +#TODO remove the sleep +sleep 5 + +loop_channels $FIRST_CHANNEL $LAST_CHANNEL "allowed" + +if [ $HIGHER_CHANNELS_TESTING_FLAG -eq $TRUE ]; then + loop_channels $FIRST_CHANNEL_FORBIDDEN_HIGHER $LAST_CHANNEL_FORBIDDEN_HIGHER "forbidden" +fi + +if [ $LOWER_CHANNELS_TESTING_FLAG -eq $TRUE ]; then + loop_channels $FIRST_CHANNEL_FORBIDDEN_LOWER $LAST_CHANNEL_FORBIDDEN_LOWER "forbidden" +fi + + +echo "======> successfully finished test wifi-softap-country-code-regulation-test.sh $COUNTRY_CODE <===================" + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-softap-disassoc-sta-test.sh b/test-scripts/wifi/wifi-softap-disassoc-sta-test.sh index 69e7107..6163452 100755 --- a/test-scripts/wifi/wifi-softap-disassoc-sta-test.sh +++ b/test-scripts/wifi/wifi-softap-disassoc-sta-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #testing softap functionality - removing a connected station #scripts connects HELPER board(DB410) to DUT's softap, then from softap disassociates HELPER board. #receives no arguments @@ -76,7 +76,7 @@ network={ FUNC_getConnect_time () #if fails to get connection time echos 0 { - HELPER_MAC=$(FUNC_getHelperMacFromHelper) + HELPER_MAC=$(FUNC_getCLIENTMacFromCLIENT $HELPER_ADDR ) CONNECTED_TIME=$(hostapd_cli all_sta | grep -io "$HELPER_MAC" -A 11 | grep "connected_time") echo $CONNECTED_TIME | cut -d"=" -f2 } @@ -85,9 +85,9 @@ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ########### environment variables from get-env-var-val-target.sh file ###### # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt # defines common used functions in softap tests scripts -source $UTIL_PATH/softap-HELPER-funcs.sh +. $UTIL_PATH/softap-funcs.sh echo "=================> starting wifi-softap-disassoc-sta-test.sh <=========================" SOFTAP_SSID="softapTestDisassocSTA" @@ -104,7 +104,7 @@ echo "test result before=$TEST_RESULT" #connected time before - all_sta - get mac addres connected time CON_TIME_BEFORE=$(FUNC_getConnect_time) || (echo "FUNC_getConnect_time failed! before hostapd_cli disassociate. CON_TIME_BEFORE=$CON_TIME_BEFORE" && exit 1) || exit 1 -hostapd_cli disassociate $(FUNC_getHelperMacFromDUT) +hostapd_cli disassociate $(FUNC_getCLIENTMacFromSOFTAP_DEVICE) sleep 15 #connected time after all_sta - get mac addres connected time @@ -116,8 +116,11 @@ if [ $CON_TIME_BEFORE -gt $CON_TIME_AFTER ]; then TEST_RESULT=0 fi echo "test result after=$TEST_RESULT" + ################################ disconnecting ######################################## -$UTIL_PATH/disconnect-helperSTA-from-DUTsoftap.sh + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + (exit $TEST_RESULT ) || (echo "==> failed wifi-softap-disassoc-sta-test.sh <===" && exit 1) || exit 1 echo "===============> successfully finished wifi-softap-disassoc-sta-test.sh <====================" diff --git a/test-scripts/wifi/wifi-softap-get-station-info-test.sh b/test-scripts/wifi/wifi-softap-get-station-info-test.sh index 2e29dcf..952b3e1 100755 --- a/test-scripts/wifi/wifi-softap-get-station-info-test.sh +++ b/test-scripts/wifi/wifi-softap-get-station-info-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #testing softap functionality - getting information on connected clients #scripts connects HELPER board(DB410) to DUT's softap, gets info(MAC addres) of HELPER that's connected to him #tests passes if the MAC address gotten from DUT's softap is identical to HELPER MAC address thats connected to softap @@ -83,9 +83,9 @@ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ########### environment variables from get-env-var-val-target.sh file ###### # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt # defines common used functions in softap tests scripts -source $UTIL_PATH/softap-HELPER-funcs.sh +. $UTIL_PATH/softap-funcs.sh echo "=================> starting wifi-softap-get-station-info-test.sh <=========================" SOFTAP_SSID="softapTestGetSTAInfo" @@ -98,11 +98,12 @@ $UTIL_PATH/connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" || (ech echo "=============> comparing MAC addresses <=================" TEST_RESULT=0 -echo "FUNC_getHelperMacFromHelper=$(FUNC_getHelperMacFromHelper)" -echo "FUNC_getHelperMacFromDUT=$(FUNC_getHelperMacFromDUT)" -FUNC_getHelperMacFromHelper | grep -i "$(FUNC_getHelperMacFromDUT)" || TEST_RESULT=1 -$UTIL_PATH/disconnect-helperSTA-from-DUTsoftap.sh +echo "FUNC_getCLIENTMacFromCLIENT(arg1-$HELPER_ADDR)=$(FUNC_getCLIENTMacFromCLIENT $HELPER_ADDR )" +echo "FUNC_getCLIENTMacFromSOFTAP_DEVICE=$(FUNC_getCLIENTMacFromSOFTAP_DEVICE)" +FUNC_getCLIENTMacFromCLIENT $HELPER_ADDR | grep -i "$(FUNC_getCLIENTMacFromSOFTAP_DEVICE)" || TEST_RESULT=1 + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR (exit $TEST_RESULT) || (echo "==> failed wifi-softap-get-station-info-test.sh <===" && exit 1) || exit 1 diff --git a/test-scripts/wifi/wifi-softap-link-monitor-test.sh b/test-scripts/wifi/wifi-softap-link-monitor-test.sh new file mode 100644 index 0000000..dd47df5 --- /dev/null +++ b/test-scripts/wifi/wifi-softap-link-monitor-test.sh @@ -0,0 +1,190 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#secure WPA2-TKIP-PSK connection to Wifi softap +#creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP +#arg1 - performance KPI + + +########################################### function definition ############################################################ +cleanup() +{ + #remove TCP logs + rm $TCPDUMP_LOG + $UTIL_PATH/kill-process-ids.sh tcpdump + +} + +FUNC_createHostapConf () +{ + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +channel=3 +ssid=$SOFTAP_SSID + +########## 11n connection ############### +hw_mode=g +country_code=JP +ieee80211n=1 +ht_capab=[SHORT-GI-20] +wmm_enabled=1 + +#for max inactivity flag to take effect rsn_pairwise must be commented out +ap_max_inactivity=7200 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_passphrase=$SOFTAP_PASS +macaddr_acl=0 +rsn_pairwise=CCMP +" + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +check_perf_result () #arg1 - result to check. arg2 - error msg +{ + if [ $1 -gt 0 ]; then + echo "==== ERROR:$2 ====" + echo "=======disconecting=======" + cleanup + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + exit 1 + fi +} + +parse_performance_result () +{ + echo "$PERFORMANCE_RES" | grep -o "===> IPERF_RES=..........." | cut -d">" -f2 | cut -d"=" -f2 | cut -d" " -f1 +} + +############################################## test execution ############################################################# +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt + + +TCPDUMP_LOG="tcpdump.log" +IPERF_KPI=$1 +SOFTAP_SSID="softap_link_monitor" +SOFTAP_PASS="12345678" +TIME_IPERF_RUN=3 +IPERF_KPI=1 + +echo "=================> starting wifi-softap-link-monitor-test.sh <=========================" + +cleanup + +FUNC_createHostapConf +FUNC_createWpa_suppConf + +connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" \ +|| (echo "utility failed! - connect-helperSTA-to-DUTsoftapV2.sh" && exit 1) || exit 1 + + +# run tcp for 1 minute +#tcp setup - copy missing lib file to /lib/ +cp $UTIL_PATH/libpcap.so.0.8 /lib/ +$UTIL_PATH/tcpdump -n -i wlan0 &>$TCPDUMP_LOG & + +#kill tcpdump after 1 minute +TCPDUMP_PID=$(pidof tcpdump) +echo "======TCPDUMP_PID=$TCPDUMP_PID========" +( sleep $((TIME_IPERF_RUN+15)) && kill -9 $TCPDUMP_PID ) & + + +echo "=======> run performance_test.sh DUT-client WS-server <=============" +PERFORMANCE_RES="$( (performance_test.sh $HELPER_ADDR client $IPERF_KPI $TIME_IPERF_RUN) 2>&1)" +check_perf_result $? "performance script failed" +DUT_SERVER_IPERF_RES=$(parse_performance_result) +echo "===========> DUT_SERVER_IPERF_RES=$DUT_SERVER_IPERF_RES <================" + +# wait for tcpdump to finish +wait + +#grep IP addresses in tcpdump logs +HELPER_WLAN0_IP=$(ssh $HELPER_ADDR ifconfig | grep "wlan0" -A 3 | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1) +echo "=======HELPER_WLAN0_IP=$HELPER_WLAN0_IP=======" +HELPER_IP_COUNT_IN_TCPDUMP_LOG="$(cat $TCPDUMP_LOG | grep $HELPER_WLAN0_IP -c)" +echo "=======HELPER_IP_COUNT_IN_TCPDUMP_LOG=$HELPER_IP_COUNT_IN_TCPDUMP_LOG=======" +echo "===============" +if [ $HELPER_IP_COUNT_IN_TCPDUMP_LOG -eq 0 ]; then + echo "====== failed to fined client IP in tcpdump logs========" + cleanup + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + exit 1 +fi + +cleanup +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + + +echo "===============> successfully wifi-softap-link-monitor-test.sh <====================" +exit 0 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-softap-non-secure-connect-test.sh b/test-scripts/wifi/wifi-softap-non-secure-connect-test.sh index 05c9aab..7d89d6a 100755 --- a/test-scripts/wifi/wifi-softap-non-secure-connect-test.sh +++ b/test-scripts/wifi/wifi-softap-non-secure-connect-test.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,10 +27,9 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #non secure connection to Wifi softap #creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP -# arg1 - channel number to bring up softap with. if no channel is given defaults to 6 + ########################################### function definition ############################################################ @@ -40,7 +40,7 @@ interface=$CURR_WLAN ctrl_interface=/var/run/hostapd driver=nl80211 hw_mode=g -channel=$SOFTAP_CHANNEL +channel=6 ssid=$SOFTAP_SSID #for high throughput 20Mhz @@ -67,35 +67,21 @@ network={ echo "===========> WPA_CONF=$WPA_CONF" } -FUNC_define_channel () -{ - if [ "$CHANNEL_FLAG" != "-c" ]; then - SOFTAP_CHANNEL=6 - else #if we get channel flag then, check we get the channel number - $UTIL_PATH/check-args-num.sh $# 2 - fi -} ############################################## test execution ############################################################# export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ########### environment variables from get-env-var-val-target.sh file ###### # defines general variables used in most tests -source $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt - -# no checking arguments number because suppling arguments is optional -CHANNEL_FLAG=$1 -SOFTAP_CHANNEL=$2 +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt -FUNC_define_channel echo "=================> starting wifi-softap-non-secure-connect-test.sh <=========================" SOFTAP_SSID="softapTestNonSecure" FUNC_createHostapConf FUNC_createWpa_suppConf -$UTIL_PATH/connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" || (echo "utility failed! - connect-helperSTA-to-DUTsoftapV2.sh" && exit 1) || exit 1 - -$UTIL_PATH/disconnect-helperSTA-from-DUTsoftap.sh +softap-connect.sh "$HOSTAPD_CONF" "$WPA_CONF" \ +|| (echo "utility failed! - softap-connect.sh" && exit 1) || exit 1 echo "===============> successfully finished wifi-softap-non-secure-connect-test.sh script <====================" exit 0 diff --git a/test-scripts/wifi/wifi-softap-only-defined-hw-mode-connect-test.sh b/test-scripts/wifi/wifi-softap-only-defined-hw-mode-connect-test.sh new file mode 100644 index 0000000..530027c --- /dev/null +++ b/test-scripts/wifi/wifi-softap-only-defined-hw-mode-connect-test.sh @@ -0,0 +1,172 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script creates softap on DUT in a specific hw_mode (b/g/n) received as argument +# making sure it is the hw_mode we chose +# connecting HELPER board as STA to the softap + + + +########################################### function definition ############################################################ + +parse_args () +{ + if [ $HW_MODE = "b" ]; then + HW_MODE_CONF="hw_mode=b" + IPERF_KPI=2 + EXPECTED_HELPER_BIT_RATE=11 + elif [ $HW_MODE = "g" ]; then + HW_MODE_CONF="hw_mode=g" + IPERF_KPI=11 + EXPECTED_HELPER_BIT_RATE=54 + elif [ $HW_MODE = "n" ];then + HW_MODE_CONF="hw_mode=g +country_code=JP +ieee80211n=1 +ht_capab=[SHORT-GI-20] +wmm_enabled=1 +" + IPERF_KPI=40 + EXPECTED_HELPER_BIT_RATE=72.2 + else + echo "===> EEROR: bad argument please supply b/g/n to define softap hw_mode <===" + exit 1 + fi +} + +FUNC_createHostapConf () +{ + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +channel=6 +ssid=$SOFTAP_SSID + +######################### +$HW_MODE_CONF + +ap_max_inactivity=7200 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +macaddr_acl=0 +" + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +test_helper_bit_rate () +{ + HELPER_BIT_RATE=$(ssh $HELPER_ADDR iwconfig wlan0 | grep "Bit Rate" | cut -d"=" -f2 | cut -d" " -f 1) + echo "=====> HELPER_BIT_RATE=$HELPER_BIT_RATE <=========" + + if [ $HELPER_BIT_RATE -ne $EXPECTED_HELPER_BIT_RATE ]; then + echo "======> ERROR: bitrate in HELPER device is:$HELPER_BIT_RATE Mb/s <=======" + echo "=======> HELPER device bitrate should be $EXPECTED_HELPER_BIT_RATE Mb/s <===========" + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + exit 1 + fi +} +############################### test execution ######################################################## +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH +########### environment variables from get-env-var-val-target.sh file ###### + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +# defines common used functions in softap tests scripts +#. $UTIL_PATH/softap-funcs.sh + +echo "=================> starting wifi-softap-only-defined-hw-mode-connect-test.sh HW_MODE=$HW_MODE <======================" +HW_MODE=$1 +SOFTAP_SSID="hw_mode_test" +SOFTAP_PASS="12345678" + +check-args-num.sh $# 1 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 +parse_args + +FUNC_createHostapConf +FUNC_createWpa_suppConf + +connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" \ +|| (echo "utility failed! - connect-helperSTA-to-DUTsoftapV2.sh" && exit 1) || exit 1 + + +echo "===================> HELPER STA connected to DUT softap HW_MODE=$HW_MODE <============================" +echo "===================> mesuring performance <============================" +TIME_IPERF_RUN=35 +performance_test.sh $HELPER_ADDR server $IPERF_KPI $TIME_IPERF_RUN ||\ +(disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR && echo "===> performance_test.sh failed <===" && exit 1) || exit 1 + +###### parse bit rate from HELPER board ########### +#TODO use function test_helper_bit_rate when the bug in iwconfig will be fixed +#test_helper_bit_rate + + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + +echo "============> successfully finished wifi-softap-only-defined-hw-mode-connect-test.sh HW_MODE=$HW_MODE <===============" +exit 0 + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-scripts/wifi/wifi-softap-specific-STA-test.sh b/test-scripts/wifi/wifi-softap-specific-STA-test.sh new file mode 100644 index 0000000..f7c63bd --- /dev/null +++ b/test-scripts/wifi/wifi-softap-specific-STA-test.sh @@ -0,0 +1,167 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script configurs hostapd to accept/deny specifi STA connection. +# arg1 - accept/deny + +########################################### function definition ############################################################ +FUNC_createHostapConf () +{ + HOSTAPD_CONF=" +interface=$CURR_WLAN +ctrl_interface=/var/run/hostapd +driver=nl80211 +hw_mode=g +channel=6 +ssid=$SOFTAP_SSID + +$SPECIFIC_STA_CONF + +ieee80211n=1 +wmm_enabled=1 + +auth_algs=1 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_passphrase=$SOFTAP_PASS +rsn_pairwise=CCMP +" + echo "=================> HOSTAPD_CONF=$HOSTAPD_CONF" +} + +FUNC_createWpa_suppConf () +{ + WPA_CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SOFTAP_SSID\" + psk=\"$SOFTAP_PASS\" +} +" + echo "===========> WPA_CONF=$WPA_CONF" +} + +parse_args () +{ + if [ $SPECIFIC_STA_ACTION = "accept" ]; then + EXPECTED_CONNECTION_RESULT=$SUCCESS_RES + EXPECTED_CONNECTION_RESULT_AFTER_MAC_CHANGE=$FAIL_RES + MAC_FILE="/etc/hostapd.accept" + SPECIFIC_STA_CONF="macaddr_acl=1 +accept_mac_file=$MAC_FILE" + + elif [ $SPECIFIC_STA_ACTION = "deny" ]; then + EXPECTED_CONNECTION_RESULT=$FAIL_RES + EXPECTED_CONNECTION_RESULT_AFTER_MAC_CHANGE=$SUCCESS_RES + MAC_FILE="/etc/hostapd.deny" + SPECIFIC_STA_CONF="macaddr_acl=0 +deny_mac_file=$MAC_FILE" + + else + echo "===> EEROR: bad argument please supply accept/deny <====" + exit 1 + + fi +} + +cleanup () +{ + rm $MAC_FILE &>/dev/null + +} + +connect_and_check_result () # arg1 = expected connection result success=0 failure=1. arg2=success print string +{ + local EXPECTED_RESULT=$1 + local SUCCESS_MSG="$2" + + $UTIL_PATH/connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" + CONNECTION_RESULT=$? + echo "========> CONNECTION_RESULT=$CONNECTION_RESULT <============" + echo "========> EXPECTED_CONNECTION_RESULT=$EXPECTED_RESULT <============" + + if [ $CONNECTION_RESULT -eq $EXPECTED_RESULT ];then + echo "=======> success!! hostapd managed to $SPECIFIC_STA_ACTION specific STA $SUCCESS_MSG <========" + else + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + echo "=======> faileure!! hostapd failed to $SPECIFIC_STA_ACTION specific STA $SUCCESS_MSG <========" + exit 1 + fi + + disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR +} +############################### test execution ######################################################## +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/../../util/generally-used-variables.txt +# defines common used functions in softap tests scripts +. $UTIL_PATH/softap-funcs.sh + +echo "=================> starting wifi-softap-specific-STA-test.sh $SPECIFIC_STA_ACTION <=========================" +SOFTAP_SSID="softap_specific_STA" +SOFTAP_PASS="44445555" +SUCCESS_RES=0 +FAIL_RES=1 + +SPECIFIC_STA_ACTION=$1 + +check-args-num.sh $# 1 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 +cleanup +parse_args + +HELPER_MAC=$(FUNC_getCLIENTMacFromCLIENT $HELPER_ADDR) +echo $HELPER_MAC > $MAC_FILE + +echo "========> HELPER_MAC=$HELPER_MAC <============" +echo "========> cat mac file <============" +cat $MAC_FILE + +FUNC_createHostapConf +FUNC_createWpa_suppConf + + +connect_and_check_result $EXPECTED_CONNECTION_RESULT "with HELPER device mac address in mac file" + +echo "=========================> changing mac file <===================================" +echo "00:00:00:00:00:00" > $MAC_FILE +echo "========> cat mac file <============" +cat $MAC_FILE + +connect_and_check_result $EXPECTED_CONNECTION_RESULT_AFTER_MAC_CHANGE "after HELPER device mac address removed from mac file" + + +cleanup +echo "===============> successfully finished wifi-softap-specific-STA-test.sh $SPECIFIC_STA_ACTION <====================" +exit 0 + + + + + + diff --git a/tiny-apts.sh b/tiny-apts.sh index 8b5e63c..6ad0eb3 100755 --- a/tiny-apts.sh +++ b/tiny-apts.sh @@ -1,3 +1,4 @@ +#!/bin/bash #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -25,8 +26,7 @@ #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/bash -#author c_aziski (Alfred Ziskind) + #tiny-apts #=========> must be run as super user <========== @@ -40,6 +40,8 @@ chmod a+xw * -R find . -type f -name "*~" -delete EXIT_ERR=1 +cp environmentVars.txt util/ || ( echo "failed to copy environmentVars.txt to util directory" && exit 1 ) || exit 1 + PRINT_BEGIN="test-job scripts transfer to target device in progress..." PRINT_END="tiny-apts finished. test results see test-log.txt, verbose err log file see: verbose-test-log.txt \nATTENTION- verbose-test-log.txt will be deleted when reached 10 Megabyte" diff --git a/util/bringUp-softap.sh b/util/bringUp-softap.sh index 773dd4f..d45bd69 100755 --- a/util/bringUp-softap.sh +++ b/util/bringUp-softap.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #brings up softap and dhcp server #receives as args: $1 - softap(hostapd) configuration $2 - dhcp server (dhcpd) configuration @@ -35,12 +35,7 @@ ########################################### function definition ############################################################ FUNC_createConf () # $1 - configuration file path $2 - configuration content { - echo "FUNC_createConf arg1 conf path = $1" - echo "FUNC_createConf arg2 conf content = $2" - echo "$2" > $1 - echo "========> for debug. configuration of file :$1 are:" - cat $1 } FUNC_Cleanup () @@ -79,12 +74,12 @@ FUNC_run_command_multipule_attempts () # $1 - command to execute $2 - attempts while [ $COUNT -lt $ATTEMPTS ] do - echo "====> giving time for hostapd enablment - sleeping 30 sec <=====" + echo "====> giving time for hostapd enablment - sleeping $TIME sec <=====" sleep $TIME echo "==========> COMMAND=$COMMAND <===========" eval $COMMAND RESULT=$? - echo "==========> RESULT=$RESULT <===========" + echo "==========> RESULT of COMMAND=$RESULT <===========" if [ $RESULT -eq 0 ]; then break fi @@ -95,13 +90,6 @@ FUNC_run_command_multipule_attempts () # $1 - command to execute $2 - attempts return $RESULT } -exit_cleanup_and_posting () # $1 - string to echo -{ - EXIT_STATMENT="$1" - - echo - -} ############################################## test execution ############################################################# ######### arguments ############## @@ -111,22 +99,19 @@ DHCPD_CONF=$2 #$2 - dhcp server (dhcpd) configuration export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ########### environment variables from get-env-var-val-target.sh file ######################## # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/generally-used-variables.txt" - -#UTIL_PATH="$(dirname $(readlink -f $0))" - - +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" echo "===========> starting bring up softap utility <=========================" echo "====> arguments are: arg1 - hostapd configuration. arg2 - dhcpd configuration" -echo "====> arg1 HOSTAPD_CONF=$HOSTAPD_CONF" -echo "====> arg2 DHCPD_CONF=$DHCPD_CONF" +echo "===============================> arg1 HOSTAPD_CONF=$HOSTAPD_CONF" +echo "===============================> arg2 DHCPD_CONF=$DHCPD_CONF" echo "===========> cleaning up before setup <=========================" + HOSTAPD_CONF_PATH=/etc/hostap.conf DHCPD_CONF_PATH=/etc/dhcp/dhcpd-test.conf -HOSTAPD_RET_VAL_LOG=hostapd_ret_val.log -DHCPD_RET_VAL_LOG=dhcpd_ret_val.log +HOSTAPD_RET_VAL_LOG=$CURR_PATH/hostapd_ret_val.log +DHCPD_RET_VAL_LOG=$CURR_PATH/dhcpd_ret_val.log FUNC_Cleanup echo "===========> give time (5 sec) for killed processes to release resources <============" sleep 5 @@ -141,8 +126,8 @@ FUNC_createConf "$DHCPD_CONF_PATH" "$DHCPD_CONF" sleep 5 echo "===========> starting HOSTAPD <=========================" hostapd -d $HOSTAPD_CONF_PATH >> $HOSTAPD_RET_VAL_LOG & -FUNC_run_command_multipule_attempts 'cat $HOSTAPD_RET_VAL_LOG | grep "$CURR_WLAN: AP-ENABLED"' 5 30 \ -|| (echo "====> hostapd failed! <====" && exit 1) || exit 1 +FUNC_run_command_multipule_attempts 'cat $HOSTAPD_RET_VAL_LOG | grep "$CURR_WLAN: AP-ENABLED"' 30 5 \ +|| (echo "=======> hostapd failed! <========" && cat $HOSTAPD_RET_VAL_LOG && exit 1) || exit 1 echo "===========> starting DHCP server <=========================" FUNC_parseDhcpdConf || (echo "FUNC_parseDhcpdConf failed" && exit 1) || exit 1 @@ -152,13 +137,18 @@ ifconfig $CURR_WLAN up $SOFTAP_STATIC_IP netmask $SOFTAP_NETMASK sleep 4 dhcpd -d -cf $DHCPD_CONF_PATH $CURR_WLAN 2>> $DHCPD_RET_VAL_LOG & sleep 3 -grep "Server starting service" $DHCPD_RET_VAL_LOG || (echo "====> dhcpd failed! <=====" && exit 1) || exit 1 + +#changed to suite ubuntu and DB410 dhcpd outputs. they have different versions +#grep "Server starting service" $DHCPD_RET_VAL_LOG || (echo "====> dhcpd failed! <=====" && exit 1) || exit 1 +grep "Listening on" $DHCPD_RET_VAL_LOG || (echo "====> dhcpd failed! <=====" && exit 1) || exit 1 ############################## end of execution. now cleanup ################################################# +#echo "=====> hostapd log file content <=======" +#cat $HOSTAPD_RET_VAL_LOG rm $HOSTAPD_CONF_PATH 2>/dev/null rm $DHCPD_CONF_PATH 2>/dev/null -#rm $HOSTAPD_RET_VAL_LOG 2>/dev/null +rm $HOSTAPD_RET_VAL_LOG 2>/dev/null rm $DHCPD_RET_VAL_LOG 2>/dev/null sleep 5 diff --git a/util/check-args-num.sh b/util/check-args-num.sh index 24b9730..8998d26 100755 --- a/util/check-args-num.sh +++ b/util/check-args-num.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #util script that checks if number of arguments given are as expected diff --git a/util/check-ret-val-and-log.sh b/util/check-ret-val-and-log.sh index d7b70d9..1954d35 100755 --- a/util/check-ret-val-and-log.sh +++ b/util/check-ret-val-and-log.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #util script that checks the return value of a command, if failed - logs an err msg. #if command succeeded it dose nothing diff --git a/util/connect-STA.sh b/util/connect-STA.sh new file mode 100644 index 0000000..514b021 --- /dev/null +++ b/util/connect-STA.sh @@ -0,0 +1,100 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script connects as STA to wifi AP +# arg 1 - security type - open-security/WPA2-TKIP-security +# arg 2 - ssid of wifi AP to connect to +# arg 3 - password to secure wifi AP. optional - only if WPA2-TKIP-security given as first argument +# +############################################ function definition ####################################################### +parse_args () +{ + if [ $SECURITY_TYPE = "WPA2-TKIP-security" ]; then + + check-args-num.sh $NUM_ARGS 3 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 + + CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SSID\" + psk=\"$PASSWORD\" +} +" + elif [ $SECURITY_TYPE = "open-security" ]; then + + check-args-num.sh $NUM_ARGS 2 || ( echo "wrong number of arguments" && exit 1 ) || exit 1 + + CONF="ctrl_interface=/run/wpa_supplicant +update_config=1 + +network={ + ssid=\"$SSID\" + key_mgmt=NONE +} +" + + else + echo "====> ERROR:bad argument - supply \"WPA2-TKIP-security\" or \"open-security\" <====" + exit 1 + + fi +} + +######################################### script execution ########################################################## + +echo "============================> starting connect-STA.sh <============================" + +# defines general variables used in most tests +. $(dirname $(readlink -f $0))/generally-used-variables.txt + +SECURITY_TYPE=$1 +SSID=$2 +PASSWORD=$3 +NUM_ARGS=$# + +parse_args + +echo "=====> makes sure there are no previous connections <======" +disconnect-STA.sh +sleep 3 + +$UTIL_PATH/get-wifi-config-and-connect.sh "$CONF" || (echo "connection failed" && exit 1) || exit 1 + +echo "============================> successfully connect-STA.sh <============================" + + + + + + + + + + diff --git a/util/connect-helperSTA-to-DUTsoftap.sh b/util/connect-helperSTA-to-DUTsoftap.sh index f266c11..51fc77e 100755 --- a/util/connect-helperSTA-to-DUTsoftap.sh +++ b/util/connect-helperSTA-to-DUTsoftap.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP #terminology: #DUT = board that creates a softap @@ -70,10 +70,9 @@ max-lease-time 1814400; FUNC_Cleanup () { echo "doing cleanup" -$UTIL_PATH/kill-process-ids.sh wpa_supplicant -$UTIL_PATH/kill-process-ids.sh hostapd -$UTIL_PATH/kill-process-ids.sh dhcpd -# /usr/sbin/rfkill unblock all + $UTIL_PATH/kill-process-ids.sh wpa_supplicant + $UTIL_PATH/kill-process-ids.sh hostapd + $UTIL_PATH/kill-process-ids.sh dhcpd rfkill unblock all } @@ -90,13 +89,13 @@ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ########### environment variables from get-env-var-val-target.sh file ## # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" THIS_FILE_NAME=$0 FAIL=1 LOG=3 ######### arguments ############## -echo "===============> starting utility: connect-helperSTA-to-DUTsoftapV2.sh <============================" +echo "===============> starting utility: connect-helperSTA-to-DUTsoftap.sh <============================" WPA_SUPP_CONF="$1" echo "==========================> argument 1 WPA_SUPP_CONF=$WPA_SUPP_CONF" HOSTAPD_CONF="$2" @@ -110,12 +109,14 @@ $UTIL_PATH/bringUp-softap.sh "$HOSTAPD_CONF" "$DHCPD_CONF" || (echo "==> bringup echo "===============> transferring wifi connection scripts to CLIENT device <============================" FUNC_movingFilesToClient -echo "=================> connecting from CLIENT <=================================" +echo "=================> connecting from CLIENT - $HELPER_ADDR <=================================" STDERR="$( (ssh $HELPER_ADDR "$DEVICE_UTIL_PATH/get-wifi-config-and-connect.sh '$WPA_SUPP_CONF'") 2>&1)" \ -|| (echo "STDERR=$STDERR. failed to connect to softap" && exit 1) || exit +|| (disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR \ +&& echo "STDERR=$STDERR. failed to connect to softap" && exit 1) || exit 1 + echo "STDERR=$STDERR" sleep 5 -echo "===============> successfully finished connect-helperSTA-to-DUTsoftapV2.sh <============================" +echo "===============> successfully finished connect-helperSTA-to-DUTsoftap.sh <============================" diff --git a/util/disconnect-STA.sh b/util/disconnect-STA.sh new file mode 100644 index 0000000..94c66e3 --- /dev/null +++ b/util/disconnect-STA.sh @@ -0,0 +1,63 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script disconnects STA connection to wifi AP + +########### environment variables from get-env-var-val-target.sh file ## +# defines general variables used in most tests +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" + + + +echo "============> starting disconnect-STA.sh <========================" +echo "rfkill unclock all" +rfkill unblock all + +echo "wpa_cli disconnect" +wpa_cli disconnect + +echo "kill wpa_supplicant" +kill -9 $(pidof wpa_supplicant) + +echo "dhclient wlan0 -r" +dhclient $CURR_WLAN -r + +echo "$CURR_WLAN down" +ifconfig $CURR_WLAN down +sleep 2 + +echo "$CURR_WLAN up" +ifconfig $CURR_WLAN up + + +echo "============> successfully finished disconnect-STA.sh <========================" + + + + diff --git a/util/disconnect-helperSTA-from-DUTsoftap.sh b/util/disconnect-Wifi-client-from-Wifi-softap.sh index b1d4a45..aa3de44 100755..100644 --- a/util/disconnect-helperSTA-from-DUTsoftap.sh +++ b/util/disconnect-Wifi-client-from-Wifi-softap.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,67 +27,65 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #terminates Wifi connection correctly between helper-DB410 from DUT's softap -#receives no arguments -#terminology: -#HELPER = board that connects to the wifi AP created by the DUT +#receives one argument - Wifi client adder (e.g "root@<ip>") +#terminology: CLIENT = connects as Wifi STA to softap device ########### environment variables from get-env-var-val-target.sh file ## export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" # defines common used functions in softap tests scripts -source $UTIL_PATH/softap-HELPER-funcs.sh - +. $UTIL_PATH/softap-funcs.sh -echo "============> starting disconnect-helperSTA-from-DUTsoftap.sh <========================" -echo "ssh command remove client test jobs" -ssh $HELPER_ADDR rm -r $TEST_SCRIPTS_PATH - -echo "ssh command remove client util path" -ssh $HELPER_ADDR rm -r $DEVICE_UTIL_PATH +echo "============> starting disconnect-Wifi-client-from-Wifi-softap.sh <========================" +CLIENT_ADDER=$1 +echo "============> arg1 = $CLIENT_ADDER <==================" +################# client disconnection - clientAdder #################################### echo "ssh command wpa_cli disconnect" -ssh $HELPER_ADDR 'wpa_cli disconnect' +ssh $CLIENT_ADDER 'wpa_cli disconnect' echo "ssh command kill wpa_supplicant" -ssh $HELPER_ADDR 'kill -9 $(pidof wpa_supplicant)' +ssh $CLIENT_ADDER 'kill -9 $(pidof wpa_supplicant)' + +FUNC_checkCLIENTHasOnlyOneWlan $CLIENT_ADDER +CLIENT_WLAN="$(ssh $CLIENT_ADDER ifconfig -a | grep wlan | cut -d" " -f1)" -FUNC_checkHELPERHasOnlyOneWlan -HELPER_WLAN="$(ssh $HELPER_ADDR ifconfig -a | grep wlan | cut -d" " -f1)" -echo "ssh command dhclient $HELPER_WLAN -r" -ssh $HELPER_ADDR dhclient $HELPER_WLAN -r +echo "ssh command dhclient $CLIENT_WLAN -r" +ssh $CLIENT_ADDER dhclient $CLIENT_WLAN -r -echo "ssh command $HELPER_WLAN down" -ssh $HELPER_ADDR ifconfig $HELPER_WLAN down +echo "ssh command $CLIENT_WLAN down" +ssh $CLIENT_ADDER ifconfig $CLIENT_WLAN down sleep 2 -echo "ssh command $HELPER_WLAN up" -ssh $HELPER_ADDR ifconfig $HELPER_WLAN up +echo "ssh command $CLIENT_WLAN up" +ssh $CLIENT_ADDER ifconfig $CLIENT_WLAN up -echo "DUT command kill hostapd" +################################ wifi softap killing finished processes ################################################ +echo "softap device command kill hostapd" kill -9 $(pidof hostapd) sleep 1 -echo "DUT command kill dhcpd" +echo "softap device command kill dhcpd" kill -9 $(pidof dhcpd) sleep 1 -echo "DUT command $CURR_WLAN down" +echo "softap device command $CURR_WLAN down" +echo " =======CURR_WLAN=$CURR_WLAN =========== " ifconfig $CURR_WLAN down sleep 3 -echo "DUT command $CURR_WLAN up" +echo "softap device command $CURR_WLAN up" ifconfig $CURR_WLAN up sleep 3 -echo "============> finished disconnect-helperSTA-from-DUTsoftap.sh <========================" +echo "============> successfully finished disconnect-Wifi-client-from-Wifi-softap.sh <========================" diff --git a/util/get-env-var-val-target.sh b/util/get-env-var-val-target.sh index f242c46..b89dc57 100755 --- a/util/get-env-var-val-target.sh +++ b/util/get-env-var-val-target.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #receives an environment variable #reads from environmentVars.txt #and prints the variable value on stdout diff --git a/util/get-wifi-config-and-connect.sh b/util/get-wifi-config-and-connect.sh index ced4dba..29d790d 100755 --- a/util/get-wifi-config-and-connect.sh +++ b/util/get-wifi-config-and-connect.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #util script for wifi connection test-scripts #receives configuration info to connect to wifi AP # $1 configuration info @@ -111,7 +111,7 @@ echo "==================> starting get-wifi-config-and-connect.sh <=========== export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/sbin/ip":$PATH # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" CONF_INFO="$1" diff --git a/util/install-pkg.sh b/util/install-pkg.sh index 0d48827..bf1a52b 100755 --- a/util/install-pkg.sh +++ b/util/install-pkg.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # script installs desired package with opkg on OE build diff --git a/util/kill-process-ids.sh b/util/kill-process-ids.sh index 3f1f700..9d401ec 100755 --- a/util/kill-process-ids.sh +++ b/util/kill-process-ids.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,26 +27,35 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #util script for killing unwanted process -# $1 = string to serach process IDs +# $1 = string to search process IDs +# $2 = flags for ps command + +PS_FLAGS=$2 + + + +echo "========> starting kill-process-ids.sh <=============" +echo "========> arg1(who to be killed)=$1 <=============" +echo "========> arg2(ps flags)=$PS_FLAGS <=============" -PROCESSES=$(/bin/ps | grep "$1" | grep -v "grep" | grep -v "/bin/sh") +PROCESSES=$(ps $PS_FLAGS | grep "$1" | grep -v "grep" | grep -v "/bin/sh") echo "PROCESSES=$PROCESSES" # the sed is to remove leading blankspace -PROCESS_PIDS="$(echo $(echo "$PROCESSES" | sed -e 's/^[ \t]*//') | cut -d" " -f1)" -echo "PROCESS_PIDS=$PROCESS_PIDS" +#PROCESS_PIDS="$(echo $(echo "$PROCESSES" | sed -e 's/^[ \t]*//') | cut -d" " -f1)" +PROCESSES_PIDS="$(echo "$PROCESSES" | sed -e 's/^[ \t]*//' | awk '{print $1}')" +echo "PROCESS_PIDS=$PROCESSES_PIDS" -for ITEM in $PROCESS_PIDS; do +for ITEM in $PROCESSES_PIDS; do echo "ITEM=$ITEM" STDERR="$( (kill -9 $ITEM) 2>&1)" done -echo "inside kill util. return val=$?" +echo "========> successfully finished kill-process-ids.sh <=============" exit 0 diff --git a/util/led_on-off.sh b/util/led_on-off.sh index 031a93a..e19b9c4 100755 --- a/util/led_on-off.sh +++ b/util/led_on-off.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # turns on user leds diff --git a/util/logger.sh b/util/logger.sh index 2a96689..12aba2e 100755 --- a/util/logger.sh +++ b/util/logger.sh @@ -1,3 +1,4 @@ + #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without diff --git a/util/performance_test.sh b/util/performance_test.sh new file mode 100644 index 0000000..241fabb --- /dev/null +++ b/util/performance_test.sh @@ -0,0 +1,162 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# script runs iperf on current device and iperf on target device (received as argument) +# arg1 - target adder (e.g: root@<ipv4 address>) +# arg2 - target run as iperf client or server (e.g client/server) +# arg3 - iperf kpi - lower than received number and script fails + +########################################### function definition ############################################################ +setup_before_execution () +{ + rsync $UTIL_PATH/kill-process-ids.sh $TARGET_ADDR:$BASE_PATH/ 2>/dev/null + kill-process-ids.sh iperf + ssh $TARGET_ADDR $BASE_PATH/kill-process-ids.sh iperf +} + +cleanup () +{ + ssh $TARGET_ADDR "rm $BASE_PATH/kill-process-ids.sh" 2>/dev/null + rm $SERVER_IPERF_LOG &>/dev/null + rm $CLIENT_IPERF_LOG &>/dev/null +} + +parse_arg2_client_or_server_mode () +{ + PARSE_IP_ADDR_COMMAND='ifconfig | grep -A 2 wlan | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1' + + if [ $TARGET_IPERF_SERVER_OR_CLIENT = "client" ]; then + CLIENT_DEVICE_NAME="target device=$TARGET_ADDR" + IPERF_SERVER_COMMAND='iperf -s 1>$SERVER_IPERF_LOG &' + CLIENT_IP_ADDER="$(eval $PARSE_IP_ADDR_COMMAND)" + + IPERF_CLIENT_COMMAND='echo "$( (ssh $TARGET_ADDR \ + iperf -c $CLIENT_IP_ADDER -i 1 -t $IPERF_RUNNING_TIME) 2>&1)" > $CLIENT_IPERF_LOG' + + IPERF_SERVER_KILL_COMMAND='kill-process-ids.sh iperf' + + elif [ $TARGET_IPERF_SERVER_OR_CLIENT = "server" ]; then + CLIENT_DEVICE_NAME="current device" + IPERF_SERVER_COMMAND='echo "$( (ssh $TARGET_ADDR iperf -s) 2>&1)" > $SERVER_IPERF_LOG &' + CLIENT_IP_ADDER="$(ssh $TARGET_ADDR eval $PARSE_IP_ADDR_COMMAND 2>/dev/null)" + IPERF_CLIENT_COMMAND='iperf -c "$CLIENT_IP_ADDER" -i 1 -t "$IPERF_RUNNING_TIME" &>"$CLIENT_IPERF_LOG"' + IPERF_SERVER_KILL_COMMAND='ssh $TARGET_ADDR $BASE_PATH/kill-process-ids.sh iperf' + else + echo "===> ERROR: second argument=$TARGET_IPERF_SERVER_OR_CLIENT bad argument! second argument should be client/server <====" + exit 1 + fi + + echo "============> CLIENT_DEVICE_NAME=$CLIENT_DEVICE_NAME <=================" + echo "============> IPERF_SERVER_COMMAND=$IPERF_SERVER_COMMAND <=================" + echo "============> CLIENT_IP_ADDER=$CLIENT_IP_ADDER <=================" + echo "============> IPERF_CLIENT_COMMAND=$IPERF_CLIENT_COMMAND <=================" + echo "============> IPERF_SERVER_KILL_COMMAND=$IPERF_SERVER_KILL_COMMAND <=================" + +} + +test_iperf_kpi () +{ + IPERF_RES_NO_DECIMAL=$(echo $IPERF_RES | cut -d"." -f1) + SUBSTRUCT_RES=$((IPERF_KPI-IPERF_RES_NO_DECIMAL)) + #SUBSTRUCT_SIGN=$(echo $SUBSTRUCT_RES | awk '{print substr($0,0,2)}') + echo $SUBSTRUCT_RES | grep -q "-" && SUBSTRUCT_SIGN="-" || SUBSTRUCT_SIGN="+" + echo "=========== IPERF_RES_NO_DECIMAL=$IPERF_RES_NO_DECIMAL ================" + echo "=========== SUBSTRUCT_RES=$SUBSTRUCT_RES ================" + echo "=========== SUBSTRUCT_SIGN=$SUBSTRUCT_SIGN ================" + + if [ "$SUBSTRUCT_SIGN" = "-" ]; then + echo "===> --- PASS --- iperf result=$IPERF_RES bigger then iperf KPI=$IPERF_KPI <===" + else + echo "===> iperf result=$IPERF_RES less then iperf KPI=$IPERF_KPI <===" + echo "======================> test fails on KPI <=============================" + cleanup + exit 1 + fi +} + +############################################## test execution ############################################################# +echo "===============> starting utility: performance_test.sh <============================" + +# defines general variables used in most tests +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" + +TARGET_ADDR=$1 +TARGET_IPERF_SERVER_OR_CLIENT=$2 +IPERF_KPI=$3 +IPERF_RUNNING_TIME=$4 + +check-args-num.sh $# 4 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 + +SERVER_IPERF_LOG="$CURR_PATH/server-iperf.log" +CLIENT_IPERF_LOG="$CURR_PATH/client-iperf.log" + +if [ -z "$IPERF_RUNNING_TIME" ]; then + IPERF_RUNNING_TIME=35 +fi + +setup_before_execution +parse_arg2_client_or_server_mode + +echo "=======> run iperf for $IPERF_RUNNING_TIME seconds <=============" +echo "=======> target is - $TARGET_ADDR run iperf as=$TARGET_IPERF_SERVER_OR_CLIENT <=============" +eval $IPERF_SERVER_COMMAND +sleep 5 + +eval $IPERF_CLIENT_COMMAND + +echo "=====> pars iperf results <======" +cat $CLIENT_IPERF_LOG | grep "connect failed" \ +&& echo "====> iperf client from $CLIENT_DEVICE_NAME failed to connect <=====" \ +&& cleanup && exit 1 + + + +grep -v DISPLAY $CLIENT_IPERF_LOG > temp && cat temp > $CLIENT_IPERF_LOG && rm temp + +echo "====== CLIENT_IPERF_LOG =========" +cat $CLIENT_IPERF_LOG + +IPERF_RES=$(awk 'NR==1; END{print}' $CLIENT_IPERF_LOG | rev | cut -d" " -f2 | rev | grep -e "---" -v) + +echo "====> IPERF_RES=$IPERF_RES <============" +sleep 3 +echo "===> kill iperf server <=====" +eval $IPERF_SERVER_KILL_COMMAND +sleep 1 +eval $IPERF_SERVER_KILL_COMMAND +sleep 2 + +test_iperf_kpi + +cleanup +echo "===============> successfully finished performance_test.sh <============================" +exit 0 + + + diff --git a/util/play-gstreamer-and-check.sh b/util/play-gstreamer-and-check.sh index 41b67cb..bee22e9 100755 --- a/util/play-gstreamer-and-check.sh +++ b/util/play-gstreamer-and-check.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # this tests plays an H264 file using gstreamer pipeline # this test also captures cpu temperature and cpu usage and prints this out. # recievs: @@ -34,7 +34,20 @@ # arg2 = gstreamr pipeline # arg3 = duration in seconds to play file and monitor cpu - +########################################### function definition ############################################################ +cleanup () +{ + # do some cleanup (kill and clean any remainders from previous runs) + echo "some cleanup ..." + echo + eval kill -9 $(pidof "gst-launch-1.0") &>/dev/null + rm $GSTREAMER_LOG_FILE &>/dev/null + kill -9 $(pidof "X") &>/dev/null + sleep 1 + echo +} + +############################################## script execution ############################################################# date echo "=============> Running utility: play-gstreamer-and-check.sh <===============" echo @@ -78,22 +91,19 @@ fi GSTREAMER_LOG_FILE="gstreamer_h264_playback.log" -# do some cleanup (kill and clean any remainders from previous runs) -echo "some cleanup & setup ..." -echo -eval kill -9 $(pidof "gst-launch-1.0") &>/dev/null -rm $GSTREAMER_LOG_FILE &>/dev/null -kill -9 $(pidof "X") &>/dev/null -sleep 1 -echo -echo "done cleanup & setup, running test..." + +cleanup +echo "done cleanup, running test..." # activate X - windows system -export DISPLAY=:0 -sleep 2 -X & -pidof X &>/dev/null || (echo "X server failed to run" && exit 1) || exit 1 -sleep 2 +. "$(dirname $(readlink -f $0))/activate_X_win_system_server.txt" +#export DISPLAY=:0 +#sleep 2 +#X & +#pidof X &>/dev/null || (echo "X server failed to run" && exit 1) || exit 1 +#sleep 2 + + # change screen resolution HDMI_OUTPUT_NAME="$(xrandr -d :0 | grep connected | awk {'print $1'})" # if xrandr fails to change resolution util keeps running @@ -101,7 +111,7 @@ xrandr "-d" ":0" "--output" "$HDMI_OUTPUT_NAME" "--mode" "1920x1080" || ( echo " sleep 1 # executing gstreamer -COMMAND="gst-launch-1.0 -v filesrc location=$FILE_TO_PLAY $GST_PIPELINE" +COMMAND="GST_GL_PLATFORM=egl GST_GL_API=gles2 gst-launch-1.0 -v filesrc location=$FILE_TO_PLAY $GST_PIPELINE" echo "Running Command: $COMMAND" eval $COMMAND &> $GSTREAMER_LOG_FILE & @@ -113,6 +123,8 @@ if [ -z "$GST_PID" ] then echo echo "ERROR: Could not start gstreamer" + echo "GSTREAMER_LOG_FILE:" + echo "$GSTREAMER_LOG_FILE" echo date exit 1 @@ -183,6 +195,8 @@ fi #writing result to file, to be read by test-executor.sh and used in log files echo "max cpu usage:$MAX_GST_CPU_USAGE%" > test_string_ret_val.txt +echo "===> clean after test <===" +cleanup echo echo "=============> Finished utility: play-gstreamer-and-check.sh <===============" diff --git a/util/pre-execution-setup.sh b/util/pre-execution-setup.sh index 16052b0..015ea60 100755 --- a/util/pre-execution-setup.sh +++ b/util/pre-execution-setup.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # ====> the script shutsdown the device. the user need to turn it back on <==== # this script enables pulseaudio access to audio. @@ -43,7 +43,7 @@ gpasswd -a root audio &>/dev/null || eval $EXIT_COMMAND gpasswd -a root lp &>/dev/null || eval $EXIT_COMMAND sleep 2 -reboot +reboot 0 diff --git a/util/pulseaudio-run-daemon.sh b/util/pulseaudio-run-daemon.sh index 389749c..570a688 100755 --- a/util/pulseaudio-run-daemon.sh +++ b/util/pulseaudio-run-daemon.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,7 +27,6 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # IMPORTANT this script must be run as user not root!!!! usage: su <user, e.g:linaro> -lc <this script> diff --git a/util/search-cmd-output.sh b/util/search-cmd-output.sh index 749ee63..31830e7 100755 --- a/util/search-cmd-output.sh +++ b/util/search-cmd-output.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,14 +27,13 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh #testing presence of all search items in a command output #fails if at least one item missing, when fails logges the testing file and the missing item and returns 1 #on success return 0 # defines general variables used in most tests -source "$(dirname $(readlink -f $0))/generally-used-variables.txt" +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" THIS_FILE_NAME=$0 COMMAND="$1" diff --git a/util/softap-connect.sh b/util/softap-connect.sh new file mode 100644 index 0000000..f394057 --- /dev/null +++ b/util/softap-connect.sh @@ -0,0 +1,78 @@ +#!/bin/sh +#Copyright (c) 2016, The Linux Foundation. All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +#WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +#BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +#IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#creates softap on board that transmits the wifi AP. uses another board to connect to the wifi AP +#arg1 - hostapd configuration +#arg2 - wpa_supplicant configuration + +############################################## test execution ############################################################# +export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH + +# defines general variables used in most tests +. "$(dirname $(readlink -f $0))/generally-used-variables.txt" + +HOSTAPD_CONF="$1" +WPA_CONF="$2" + +check-args-num.sh $# 2 || (echo "===> ERROR:wrong number of arguments <===" && exit 1 ) || exit 1 + +echo "=================> starting softap-connect.sh utility script <=========================" + +$UTIL_PATH/connect-helperSTA-to-DUTsoftap.sh "$WPA_CONF" "$HOSTAPD_CONF" \ +|| (echo "utility failed! - connect-helperSTA-to-DUTsoftap.sh" && exit 1) || exit 1 + + +disconnect-Wifi-client-from-Wifi-softap.sh $HELPER_ADDR + +echo "===============> successfully finished softap-connect.sh utility script <====================" +exit 0 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/util/softap-HELPER-funcs.sh b/util/softap-funcs.sh index ce8fdd0..d9e412d 100755..100644 --- a/util/softap-HELPER-funcs.sh +++ b/util/softap-funcs.sh @@ -1,3 +1,4 @@ + #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -26,27 +27,31 @@ #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# this file will be run by the comand "source" in scripts that shares these functions +# this file will be run by the command "source" in scripts that shares these functions -FUNC_checkHELPERHasOnlyOneWlan () +FUNC_checkCLIENTHasOnlyOneWlan () # arg1 - client adder { - if [ $(ssh $HELPER_ADDR "ifconfig | grep -c wlan") -gt 1 ]; then + local CLIENT_ADDER=$1 + + if [ $(ssh $CLIENT_ADDER "ifconfig | grep -c wlan") -gt 1 ]; then echo "====> ERROR:found more then one wlan device in HELPER device <========" exit 1 fi } -FUNC_getHelperMacFromHelper () +FUNC_getCLIENTMacFromCLIENT () # arg1 - client adder { - FUNC_checkHELPERHasOnlyOneWlan + local CLIENT_ADDER=$1 + + FUNC_checkCLIENTHasOnlyOneWlan $CLIENT_ADDER - local IFCONFIG_RESULT=$(ssh $HELPER_ADDR "ifconfig | grep wlan") + local IFCONFIG_RESULT=$(ssh $CLIENT_ADDER "ifconfig | grep wlan") echo $IFCONFIG_RESULT | cut -d" " -f5 } -FUNC_getHelperMacFromDUT () +FUNC_getCLIENTMacFromSOFTAP_DEVICE () { hostapd_cli all_sta | grep "Selected interface" -A1 | grep "Selected" -v } diff --git a/util/uart.sh b/util/uart.sh index 1a7051b..d1b3daf 100755 --- a/util/uart.sh +++ b/util/uart.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -25,7 +26,6 @@ #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh # diff --git a/util/uartsecter.sh b/util/uartsecter.sh index baeadb0..ffdbc16 100755 --- a/util/uartsecter.sh +++ b/util/uartsecter.sh @@ -1,3 +1,4 @@ +#!/bin/sh #Copyright (c) 2016, The Linux Foundation. All rights reserved. # #Redistribution and use in source and binary forms, with or without @@ -25,7 +26,6 @@ #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN #IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/bin/sh echo "hello first terminal I'm second" > /dev/ttyMSM$1 diff --git a/util/wifi-country-regulations.csv b/util/wifi-country-regulations.csv new file mode 100644 index 0000000..b956acf --- /dev/null +++ b/util/wifi-country-regulations.csv @@ -0,0 +1,175 @@ +Country Code/Country,802.11 Bands,Channels Allowed,Maximum Transmit Power (Radio Tx + Antenna Gain = EIRP),Frequency Range (GHz),Regulatory Authority
+AT/Austria,a,36; 40; 44; 48,60 mW EIRP,5.15-5.25,BMV/
+AT/Austria,b/g,1-11,100 mW EIRP,2.4-2.4835,FSB-LD047
+AU/Australia,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,ACA
+AU/Australia,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+AU/Australia,a,149; 153; 157; 161,1 W EIRP,5.725-5.825,
+AU/Australia,b,1-11,200 mW EIRP,2.4-2.4835,
+BE/Belgium,a,36; 40; 44; 48,120 mW EIRP,5.15-5.25,BIPT/
+BE/Belgium,a,52; 56; 60; 64,120 mW EIRP,,Annexe B3 Interface radio HIPERLAN
+BE/Belgium,b/g,1-13,100 mW EIRP,2.4-2.4835,
+BR/Brazil,a,36; 40; 44; 48,200 mW EIRP,5.725-5.85,Anatel/
+BR/Brazil,a,52; 56; 60; 64,1 W EIRP,,Resolution 305
+BR/Brazil,a,149; 153; 157; 161,,,
+BR/Brazil,b/g,1-11,1 W EIRP,2.4-2.4835,
+CA/Canada,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,Industry
+CA/Canada,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,Canada
+CA/Canada,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,RSS-210
+CA/Canada,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+CH/Switzerland and Liechtenstein,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,OFCOM
+CH/Switzerland and Liechtenstein,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+CH/Switzerland and Liechtenstein,b/g,1-11,100 mW EIRP,2.4-2.4835,
+CN/China,a,149; 153; 157; 161,150 mW+6 dBi~600 mW,5.725-5.825,RRL/
+CN/China,b/g,1-13,150 mW+6 dBi~600 mW,2.4-2.4835,MIC Notice 2003-13
+CY/Cyprus,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,(tbd)
+CY/Cyprus,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+CY/Cyprus,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+CY/Cyprus,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+CZ/Czech Republic,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,CTO
+CZ/Czech Republic,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+CZ/Czech Republic,a,149; 153; 157; 161,1 W EIRP,5.725-5.825,
+CZ/Czech Republic,b,1-11,200 mW EIRP,2.4-2.4835,
+DE/Germany,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,RegTP/
+DE/Germany,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,wlan35
+DE/Germany,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+DE/Germany,b/g,1-11,100 mW EIRP,2.4-2.4835,
+DK/Denmark,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,ITST/
+DK/Denmark,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,Radio interface specification 00 007
+DK/Denmark,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+DK/Denmark,b/g,1-11,100 mW EIRP,2.4-2.4835,
+EE/Estonia,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,SIDEAMET
+EE/Estonia,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+EE/Estonia,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+EE/Estonia,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+ES/Spain,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,Ministry of Telecom
+ES/Spain,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+ES/Spain,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+ES/Spain,b/g,1-11,100 mW EIRP,2.412-2.472,
+FI/Finland,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,FICORA/
+FI/Finland,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,RLAN Notice
+FI/Finland,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+FI/Finland,b/g,1-11,100 mW EIRP,2.4-2.4835,
+FR/France,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,A.R.T./
+FR/France,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,Decision 01-441
+FR/France,b/g,1-11,100 mW EIRP,2.4-2.4835,
+GB/United Kingdom,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,UKRA/
+GB/United Kingdom,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,IR2006
+GB/United Kingdom,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+GB/United Kingdom,b/g,1-11,100 mW EIRP,2.4-2.4835,
+GR/Greece,b/g,1-11,100 mW EIRP,2.4-2.4835,Ministry of Transport & Comm.
+HK/Hong Kong,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,OFTA
+HK/Hong Kong,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+HK/Hong Kong,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+HK/Hong Kong,b/g,1-11,100 mW EIRP,2.4-2.4835,
+HU/Hungary,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,HIF
+HU/Hungary,a,52; 56; 60; 64,,5.25-5.35,
+HU/Hungary,b/g,1-11,1 W EIRP,2.4-2.4835,
+ID/Indonesia,a,N/A,N/A,5.725-5.875,PDT
+ID/Indonesia,b/g,1-13,100 mW EIRP,2.4-2.5 ,
+IE/Ireland,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,COMREG/
+IE/Ireland,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,"ODTR 00/61, ODTR 0062"
+IE/Ireland,a,,1 W EIRP,5.47-5.725,
+IE/Ireland,b/g,1-11,100 mW EIRP,2.4-2.4835,
+IL/Israel,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,MOC
+IL/Israel,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+IL/Israel,b/g,1-13,100 mW EIRP,2.4-2.4835,
+ILO/Israel-OUTDOOR,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,MOC
+ILO/Israel-OUTDOOR,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+ILO/Israel-OUTDOOR,b/g,5-13,100 mW EIRP,2.4-2.4835,
+IN/India,a,N/A,N/A,N/A,WPC
+IS/Iceland,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,PTA
+IS/Iceland,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+IS/Iceland,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+IS/Iceland,b/g,1-11,100 mW EIRP,2.4-2.4835,
+IT/Italy,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,Ministry of Comm
+IT/Italy,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+IT/Italy,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+IT/Italy,b/g,1-11,100 mW EIRP,2.4-2.4835,
+J1/Japan,a,36; 40; 44; 48; 52; 56; 60; 64,10 mW/MHz~200 mW,5.15-5.25,Telec/ARIB STD-T71
+J1/Japan,a,,,5.25-5.35,
+J1/Japan,b,1-14,10 mW/MHz~200 mW EIRP,2.4-2.497,Telec/ARIB STD-T66
+J1/Japan,g,1-13,10 mW/MHz~200 mW EIRP,2.4-2.497,
+JP/Japan,a,1-3,10 mW/MHz~200 mW,5.03-5.09,Telec/ARIB STD-T71
+JP/Japan,a,34; 38; 42; 46,10 mW/MHz~200 mW,5.15-5.25,
+JP/Japan,b,1-14,10 mW/MHz~200 mW EIRP,2.4-2.497,Telec/ARIB STD-T66
+JP/Japan,g,1-13,10 mW/MHz~200 mW EIRP,2.4-2.497,
+KE/Republic of Korea,a,36; 40; 44; 48,2.4 mW/MHz+6 dBi,5.725-5.825,RRL/
+KE/Republic of Korea,a,52; 56; 60; 64 100;104;108;112 116; 120; 124 149; 153; 157; 161,10 mW/MHz+7 dBi,,MIC Notice 2003-13
+KE/Republic of Korea,a,,10 mW/MHz+7 dBi,,
+KE/Republic of Korea,a,,,,
+KE/Republic of Korea,a,,150 mW+6 dBi~600 mW,,
+KE/Republic of Korea,b/g,1-13,150 mW+6 dBi~600 mW,2.4-2.4835,
+KR/Republic of Korea,a,149; 153; 157; 161,150 mW+6 dBi~600 mW,5.725-5.825,RRL/
+KR/Republic of Korea,b/g,1-13,150 mW+6 dBi~600 mW,2.4-2.4835,MIC Notice 2003-13
+LT/Lithuania,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,LTR
+LT/Lithuania,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+LT/Lithuania,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+LT/Lithuania,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+LU/Luxembourg,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,ILR
+LU/Luxembourg,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+LU/Luxembourg,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+LU/Luxembourg,b/g,1-11,100 mW EIRP,2.4-2.4835,
+LV/Latvia,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,(tbd)
+LV/Latvia,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+LV/Latvia,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+LV/Latvia,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+MY/Malaysia,b/g,1-13,100 mW EIRP,2.4-2.5 ,CMC
+NL/Netherlands,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,Radiocom Agency
+NL/Netherlands,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+NL/Netherlands,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+NL/Netherlands,b/g,1-11,100 mW EIRP,2.4-2.4835,
+NO/Norway,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,NPT
+NO/Norway,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+NO/Norway,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+NO/Norway,b/g,1-11,100 mW EIRP,2.4-2.4835,
+NZ/New Zealand,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,RSM
+NZ/New Zealand,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+NZ/New Zealand,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+NZ/New Zealand,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+PH/Philippines,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,FCC
+PH/Philippines,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,Part 15
+PH/Philippines,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+PH/Philippines,b/g,1-11,1 W Conducted Output,2.4-2.4835,
+PL/Poland,a,36; 40; 44; 48,200 mW EIRP,2.4-2.4835,Office of Telecom & Post
+PL/Poland,a,52; 56; 60; 64,1 W EIRP,,
+PL/Poland,a,149; 153; 157; 161,,,
+PL/Poland,b/g,1-11,100 mW EIRP,2.4-2.4835,
+PT/Portugal,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,NCA
+PT/Portugal,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+PT/Portugal,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+PT/Portugal,b/g,1-11,100 mW EIRP,2.4-2.4835,
+SE/Sweden,a,36; 40; 44; 48,200 mW EIRP,5.15-5.25,PTS
+SE/Sweden,a,52; 56; 60; 64,200 mW EIRP,5.25-5.35,
+SE/Sweden,a,104; 108; 112; 116; 120; 124; 128; 132; 140,1 W EIRP,5.47-5.725,
+SE/Sweden,b/g,1-11,100 mW EIRP,2.4-2.4835,
+SG/Singapore,a,36; 40; 44; 48; ,200 mW EIRP,5.15-5.25,IDA/
+SG/Singapore,a,52; 56; 60; 64; ,200 mW EIRP,5.25-5.35,TS SSS Issue 1
+SG/Singapore,a,149; 153; 157; 161,1 W EIRP,5.725-5.85,
+SG/Singapore,b/g,1-13,200 mW EIRP,2.4-2.4835,
+SI/Slovenia,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,ATRP
+SI/Slovenia,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+SI/Slovenia,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+SI/Slovenia,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+SK/Slovak Republic,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,Telecom Admin.
+SK/Slovak Republic,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,
+SK/Slovak Republic,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+SK/Slovak Republic,b/g,1-11,1 W+Restricted Antennas,2.4-2.4835,
+TH/Thailand,a,N/A,N/A,5.725-5.875,PDT
+TH/Thailand,b/g,1-13,100 mW EIRP,2.4-2.5 ,
+TW/Taiwan,a,56; 60; 64; ,50 mW+6 dBi=200 mW,5.25-5.35,PDT
+TW/Taiwan,a,100-140,250 mW+6 dBi=1 W,5.47-5.725,
+TW/Taiwan,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.825,
+TW/Taiwan,b/g,1-13,1 W EIRP,2.4-2.4835,
+US/United States of America,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,FCC
+US/United States of America,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,Part 15
+US/United States of America,a,149; 153; 157; 161,1 W+6 dBi=4 W,5.725-5.85,
+US/United States of America,b/g,1-11,1 W Conducted Output,2.4-2.4835,
+USE/United States of America,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,FCC
+USE/United States of America,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,Part 15
+USE/United States of America,b/g,1-11,1 W Conducted Output,2.4-2.4835,
+USL/United States of America LOW,a,36; 40; 44; 48,50 mW+6 dBi=200 mW,5.15-5.25,FCC
+USL/United States of America LOW,a,52; 56; 60; 64,250 mW+6 dBi=1 W,5.25-5.35,Part 15
+USL/United States of America LOW,b/g,1-11,1 W Conducted Output,2.4-2.4835,
+ZA/South Africa,a,N/A,N/A,5.25-5.35,(tbd)
+ZA/South Africa,a,,,5.725-5.825,
+ZA/South Africa,b/g,1-13,1 W EIRP,2.4-2.4835,
|