mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
help edits,test edits,bash script edits, just syntax errors left
This commit is contained in:
@@ -1,55 +1,85 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
NUM_STA=5
|
#Variables
|
||||||
SSID_USED="jedway-open-1"
|
NUM_STA=4
|
||||||
PASSWD_USED=None
|
SSID_USED="jedway-wpa2-x2048-4-1"
|
||||||
RADIO_USED="wiphy0"
|
PASSWD_USED="jedway-wpa2-x2048-4-1"
|
||||||
DEF_SECURITY=""
|
RADIO_USED="wiphy1"
|
||||||
|
SECURITY="wpa2"
|
||||||
CURR_TEST_NAME="BLANK"
|
CURR_TEST_NAME="BLANK"
|
||||||
|
CURR_TEST_NUMBER=0
|
||||||
|
STOP_NUM=0
|
||||||
|
START_NUM=0
|
||||||
|
#Test array
|
||||||
testCommands=("./example_wpa_connection.py --num_stations $NUM_STA --ssid jedway-r8000-36 --passwd jedway-r8000-36 --radio $RADIO_USED --security wpa"
|
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_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_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")
|
"./example_wpa3_connection.py --num_stations $NUM_STA --ssid jedway-wpa3-1 --passwd jedway-wpa3-1 --radio $RADIO_USED --security wpa3"
|
||||||
|
"./test_ipv4_connection.py --radio $RADIO_USED --num_stations $NUM_STA --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --upstream_port eth1"
|
||||||
|
"./test_generic.py --mgr localhost --mgr_port 4122 --radio $RADIO_USED --ssid SSID_USED --passwd $PASSWD_USED --num_stations $NUM_STA --type lfping --dest 10.40.0.1 --security $SECURITY"
|
||||||
|
"./test_generic.py --mgr localhost --mgr_port 4122 --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY"
|
||||||
|
"./test_ipv4_l4_urls_per_ten.py --upstream_port eth1 --radio $RADIO_USED --num_stations $NUM_STA --security $SECURITY --ssid $SSID_USED --passwd $PASSWD_USED --num_tests 1 --requests_per_ten 600 --target_per_ten 600"
|
||||||
|
"./test_ipv4_l4_wifi.py --upstream_port eth1 --radio wiphy0 --num_stations $NUM_STA --security $SECURITY --ssid jedway-wpa2-x2048-4-4 --passwd jedway-wpa2-x2048-4-4 --test_duration 3m"
|
||||||
|
"./test_ipv4_l4.py --radio wiphy3 --num_stations 4 --security wpa2 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --url \"dl http://10.40.0.1 /dev/null\" --test_duration 2m --debug"
|
||||||
|
)
|
||||||
|
function ret_case_num(){
|
||||||
|
echo "The script name that was successful passed in is $1"
|
||||||
|
case "$1" in
|
||||||
|
"example_wpa_connection")
|
||||||
|
return 1
|
||||||
|
"example_wpa2_connection")
|
||||||
|
return 2
|
||||||
|
"example_wpa3_connection")
|
||||||
|
return 4
|
||||||
|
"example_wep_connection")
|
||||||
|
return 3
|
||||||
|
"test_generic")
|
||||||
|
return 5
|
||||||
|
"test_ipv4_l4_urls_per_ten")
|
||||||
|
return 6
|
||||||
|
"test_ipv4_l4_wifi")
|
||||||
|
return 7
|
||||||
|
"test_ipv4_l4")
|
||||||
|
return 8
|
||||||
|
esac
|
||||||
|
}
|
||||||
function blank_db() {
|
function blank_db() {
|
||||||
echo "Loading blank scenario..."
|
echo "Loading blank scenario..."
|
||||||
./scenario.py --load BLANK
|
./scenario.py --load BLANK
|
||||||
#check_blank.py
|
#check_blank.py
|
||||||
}
|
}
|
||||||
#function stop_script(){
|
function echo_print(){
|
||||||
#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 ..."
|
echo "Beginning $CURR_TEST_NAME ..."
|
||||||
}
|
}
|
||||||
function runTest(){
|
function run_test(){
|
||||||
#if [ ! -z "$1"]
|
for i in "${testCommands[@]}"; do
|
||||||
#then
|
CURR_TEST_NAME=${i%%.py*}
|
||||||
# start_script
|
CURR_TEST_NAME=${CURR_TEST_NAME#./*}
|
||||||
echo $testCommands[0]
|
#works til here
|
||||||
for i in "${testCommands[@]}"
|
CURR_TEST_NUM= ret_case_num $CURR_TEST_NAME
|
||||||
do
|
if ($STOP_NUM > $CURR_TEST_NUM && ); then
|
||||||
$CURR_TEST_NAME= ${i%%.py*}
|
exit 1
|
||||||
|
fi
|
||||||
echoPrint
|
echoPrint
|
||||||
echo "This is the output of the current test...$i"
|
eval $i &>/home/Documents/txtfile
|
||||||
eval $i
|
if [ $? -ne 0 ]; then
|
||||||
sleep 15
|
echo $CURR_TEST_NAME fail
|
||||||
if [[ "${CURR_TEST_NAME}" = @(example_wpa_connection|example_wpa2_connection|example_wpa3_connection|example_wep_connection) ]]
|
fi
|
||||||
then blank_db
|
#tail -f /tmp/testx
|
||||||
fi
|
if [[ "${CURR_TEST_NAME}" = @(example_wpa_connection|example_wpa2_connection|example_wpa3_connection|example_wep_connection) ]]; then
|
||||||
done
|
blank_db
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
function check_args(){
|
||||||
runTest
|
if [ ! -z $1 ]; then
|
||||||
|
START_NUM=$1
|
||||||
|
fi
|
||||||
|
if [ ! -z $2 ]; then
|
||||||
|
STOP_NUM=$2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
check_args $1 $2
|
||||||
|
run_test
|
||||||
|
#test generic and fileio are for macvlans
|
||||||
|
#all tests should return 0 for success and !0 for fail --almost complete
|
||||||
|
#case switch for tests to be run --almost complete
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ def main():
|
|||||||
--num_stations 3 \\
|
--num_stations 3 \\
|
||||||
--security {open|wep|wpa|wpa2|wpa3} \\
|
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||||
--ssid netgear \\
|
--ssid netgear \\
|
||||||
--url dl http://10.40.0.1 /dev/null \\
|
--url "dl http://10.40.0.1 /dev/null" \\
|
||||||
--password admin123 \\
|
--password admin123 \\
|
||||||
--test_duration 2m \\
|
--test_duration 2m \\
|
||||||
--debug
|
--debug
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ python3 ./test_ipv4_l4_urls_per_ten.py --upstream_port eth1 \\
|
|||||||
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000,
|
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000,
|
||||||
radio=args.radio)
|
radio=args.radio)
|
||||||
|
|
||||||
ip_test = IPV4L4(args.mgr, lfjson_port, ssid=args.ssid, password=args.passwd, upstream_port=args.upstream_port,
|
ip_test = IPV4L4(args.mgr, lfjson_port, ssid=args.ssid, password=args.passwd, radio=args.radio, upstream_port=args.upstream_port,
|
||||||
security=args.security, station_list=station_list, url=args.url, num_tests=args.num_tests,
|
security=args.security, station_list=station_list, url=args.url, num_tests=args.num_tests,
|
||||||
target_requests_per_ten=args.target_per_ten,
|
target_requests_per_ten=args.target_per_ten,
|
||||||
requests_per_ten=args.requests_per_ten)
|
requests_per_ten=args.requests_per_ten)
|
||||||
|
|||||||
@@ -173,12 +173,10 @@ python3 ./test_ipv4_l4_wifi.py --upstream_port eth1 \\
|
|||||||
--security {open|wep|wpa|wpa2|wpa3} \\
|
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||||
--ssid netgear \\
|
--ssid netgear \\
|
||||||
--passwd admin123 \\
|
--passwd admin123 \\
|
||||||
--dest 10.40.0.1 \\
|
|
||||||
--test_duration 2m \\
|
--test_duration 2m \\
|
||||||
--interval 1s \\
|
|
||||||
--requests_per_ten 600 \\
|
--requests_per_ten 600 \\
|
||||||
--direction {ul | dl} \\
|
--direction {ul | dl} \\
|
||||||
--dest /dev/null \\
|
--dest /dev/null (or 10.40.0.1)\\
|
||||||
--debug
|
--debug
|
||||||
''')
|
''')
|
||||||
|
|
||||||
@@ -197,7 +195,7 @@ python3 ./test_ipv4_l4_wifi.py --upstream_port eth1 \\
|
|||||||
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000,
|
station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000,
|
||||||
radio=args.radio)
|
radio=args.radio)
|
||||||
|
|
||||||
ip_test = IPV4L4(args.mgr, lfjson_port, ssid=args.ssid, password=args.passwd,
|
ip_test = IPV4L4(args.mgr, lfjson_port, ssid=args.ssid, password=args.passwd, radio=args.radio,
|
||||||
security=args.security, station_list=station_list, direction=args.direction,dest=args.dest,
|
security=args.security, station_list=station_list, direction=args.direction,dest=args.dest,
|
||||||
test_duration=args.test_duration, upstream_port=args.upstream_port,
|
test_duration=args.test_duration, upstream_port=args.upstream_port,
|
||||||
requests_per_ten=args.requests_per_ten, _debug_on=args.debug)
|
requests_per_ten=args.requests_per_ten, _debug_on=args.debug)
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ class IPV4VariableTime(LFCliBase):
|
|||||||
|
|
||||||
def __get_rx_values(self):
|
def __get_rx_values(self):
|
||||||
cx_list = self.json_get("endp?fields=name,rx+bytes", debug_=self.debug)
|
cx_list = self.json_get("endp?fields=name,rx+bytes", debug_=self.debug)
|
||||||
# print(self.cx_profile.created_cx.values())
|
|
||||||
# print("==============\n", cx_list, "\n==============")
|
|
||||||
cx_rx_map = {}
|
cx_rx_map = {}
|
||||||
for cx_name in cx_list['endpoint']:
|
for cx_name in cx_list['endpoint']:
|
||||||
if cx_name != 'uri' and cx_name != 'handler':
|
if cx_name != 'uri' and cx_name != 'handler':
|
||||||
@@ -85,8 +83,6 @@ class IPV4VariableTime(LFCliBase):
|
|||||||
expected_passes += 1
|
expected_passes += 1
|
||||||
if new_list[item] > old_list[item]:
|
if new_list[item] > old_list[item]:
|
||||||
passes += 1
|
passes += 1
|
||||||
# print(item, new_list[item], old_list[item], passes, expected_passes)
|
|
||||||
|
|
||||||
if passes == expected_passes:
|
if passes == expected_passes:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
@@ -142,10 +138,6 @@ class IPV4VariableTime(LFCliBase):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
new_cx_rx_values = self.__get_rx_values()
|
new_cx_rx_values = self.__get_rx_values()
|
||||||
# print(old_cx_rx_values, new_cx_rx_values)
|
|
||||||
# print("\n-----------------------------------")
|
|
||||||
# print(cur_time, end_time, cur_time + datetime.timedelta(minutes=1))
|
|
||||||
# print("-----------------------------------\n")
|
|
||||||
expected_passes += 1
|
expected_passes += 1
|
||||||
if self.__compare_vals(old_cx_rx_values, new_cx_rx_values):
|
if self.__compare_vals(old_cx_rx_values, new_cx_rx_values):
|
||||||
passes += 1
|
passes += 1
|
||||||
@@ -185,17 +177,20 @@ def main():
|
|||||||
formatter_class=argparse.RawTextHelpFormatter,
|
formatter_class=argparse.RawTextHelpFormatter,
|
||||||
description='''\
|
description='''\
|
||||||
test_ipv4_variable_time.py:
|
test_ipv4_variable_time.py:
|
||||||
--------------------
|
---------------------
|
||||||
TBD
|
|
||||||
|
|
||||||
Generic command layout:
|
Generic command layout:
|
||||||
python ./test_ipv4_variable_time.py --upstream_port <port> --radio <radio 0> <stations> <ssid> <ssid password> <security type: wpa2, open, wpa3> --debug
|
./test_ipv4_variable_time.py
|
||||||
|
--upstream_port eth1
|
||||||
Note: multiple --radio switches may be entered up to the number of radios available:
|
--radio wiphy3
|
||||||
--radio <radio 0> <stations> <ssid> <ssid password> --radio <radio 01> <number of last station> <ssid> <ssid password>
|
--num_stations 4
|
||||||
|
-ssid jedway-wpa2-x2048-4-1
|
||||||
python3 ./test_ipv4_variable_time.py --upstream_port eth1 --radio wiphy0 32 candelaTech-wpa2-x2048-4-1 candelaTech-wpa2-x2048-4-1 wpa2 --radio wiphy1 64 candelaTech-wpa2-x2048-5-3 candelaTech-wpa2-x2048-5-3 wpa2
|
-passwd jedway-wpa2-x2048-4-1
|
||||||
|
--security {wpa2|open|wpa|wpa3}
|
||||||
|
--a_min 250000
|
||||||
|
--b_min 260000
|
||||||
|
--test_duration 2m
|
||||||
|
--debug
|
||||||
''')
|
''')
|
||||||
|
|
||||||
parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
|
parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
|
||||||
|
|||||||
@@ -288,7 +288,6 @@ test_ipv4_ttls.py:
|
|||||||
enable_pkc=args.enable_pkc,
|
enable_pkc=args.enable_pkc,
|
||||||
)
|
)
|
||||||
ttls_test.cleanup(station_list)
|
ttls_test.cleanup(station_list)
|
||||||
#ttls_test.timeout = 60
|
|
||||||
ttls_test.build()
|
ttls_test.build()
|
||||||
if not ttls_test.passes():
|
if not ttls_test.passes():
|
||||||
print(ttls_test.get_fail_message())
|
print(ttls_test.get_fail_message())
|
||||||
|
|||||||
Reference in New Issue
Block a user