From 28af638733f67805191890a241b10ffc2126df7d Mon Sep 17 00:00:00 2001 From: Dipti Date: Mon, 23 Nov 2020 20:26:17 -0800 Subject: [PATCH] for loop works, now going to add rest of tests --- py-scripts/test_all_scripts.sh | 61 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/py-scripts/test_all_scripts.sh b/py-scripts/test_all_scripts.sh index 53726bc5..4c225dcb 100755 --- a/py-scripts/test_all_scripts.sh +++ b/py-scripts/test_all_scripts.sh @@ -1,50 +1,51 @@ #!/bin/bash -declare -i NUM_STA="5" +NUM_STA=5 SSID_USED="jedway-open-1" PASSWD_USED=None RADIO_USED="wiphy0" DEF_SECURITY="" -#declare -i CURR_TEST_NUM=0 -CURR_TEST_NAME="" -declare -a testCommands=("./example_wpa_connection.py --num_stations NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio RADIO_USED --security wpa" -"./example_wpa_connection.py --num_stations NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio RADIO_USED --security wpa" -"./example_wpa2_connection.py --num_stations NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio RADIO_USED --security wpa2" -"./example_wep_connection.py --num_stations NUM_STA --ssid jedway-wep-48 --passwd jedway-wep-48 --radio RADIO_USED --security wep" -"./example_wpa3_connection.py --num_stations NUM_STA --ssid jedway-wpa3-1 jedway-wpa3-1 --radio RADIO_USED --security wpa3") +CURR_TEST_NAME="BLANK" +testCommands=("./example_wpa_connection.py --num_stations $NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio $RADIO_USED --security wpa" +"./example_wpa2_connection.py --num_stations $NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio $RADIO_USED --security wpa2" +"./example_wep_connection.py --num_stations $NUM_STA --ssid jedway-wep-48 --passwd jedway-wep-48 --radio $RADIO_USED --security wep" +"./example_wpa3_connection.py --num_stations $NUM_STA --ssid jedway-wpa3-1 --passwd jedway-wpa3-1 --radio $RADIO_USED --security wpa3") function blank_db() { echo "Loading blank scenario..." - ./scenario.py --load BLANK - #check_blank.py + ./scenario.py --load BLANK + #check_blank.py } -function stop_script() { - echo "Stopping bash script here." - exit 1 -} -function start_script{ - echo "Starting bash script at test...insert test name here" +#function stop_script(){ +#echo "Stopping bash script at... $2" +#exit 1 +#} +#function start_script(){ +#echo "Starting bash script at test...$1" +#} +function echoPrint(){ + echo "Beginning $CURR_TEST_NAME ..." } -function echoPrint{ - echo "Beginning $CURR_TEST ..." -} -function runTest{ - #get first test +function runTest(){ + #if [ ! -z "$1"] + #then +# start_script + echo $testCommands[0] for i in "${testCommands[@]}" do - $CURR_TEST= "${i%%.py*}" - echoPrint() - eval "$i" + $CURR_TEST_NAME= ${i%%.py*} + echoPrint + echo "This is the output of the current test...$i" + eval $i sleep 15 - if ! [[ "$CURR_TEST_NAME" =~ ^(example_wpa_connection|example_wpa2_connection|example_wpa3_connection|example_wep_connection)$ ]]; then blank_db() ; fi + if [[ "${CURR_TEST_NAME}" = @(example_wpa_connection|example_wpa2_connection|example_wpa3_connection|example_wep_connection) ]] + then blank_db + fi + done } -#TODO -#check_blank.py -#edit scenario.py -#add stop and start - +runTest