Wifi 9165 (advanced tests) (#609)

* Modified read_csv_individual_station_throughput function to get kpi_csv value

Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>

* Added cleanup and allure definition for testcases

Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>

* Added pass/fail validation

Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>

* commented pytest marker

Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>

* Added channel-width

Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>
This commit is contained in:
karthika
2022-06-15 16:28:18 +05:30
committed by GitHub
parent d95248a2f3
commit 7b94c5dbd4
5 changed files with 1746 additions and 914 deletions

View File

@@ -559,31 +559,45 @@ class ChamberView:
result = df[column_name].values.tolist()
return result
def read_csv_individual_station_throughput(self, dir_name, option):
def read_csv_individual_station_throughput(self, dir_name, option, individual_station_throughput=True, kpi_csv=False,
file_name="/csv-data/data-Combined_bps__60_second_running_average-1.csv",
batch_size="0"):
try:
df = pd.read_csv(
"../reports/" + str(dir_name) + "/csv-data/data-Combined_bps__60_second_running_average-1.csv",
"../reports/" + str(dir_name) + file_name,
sep=r'\t', engine='python')
print("csv file opened")
except FileNotFoundError:
print("csv file does not exist")
return False
dict_data = {}
if option == "download":
csv_sta_names = df.iloc[[0]].values.tolist()
csv_throughput_values = df.iloc[[1]].values.tolist()
elif option == "upload":
csv_sta_names = df.iloc[[0]].values.tolist()
csv_throughput_values = df.iloc[[2]].values.tolist()
else:
print("Provide proper option: download or upload")
return
if kpi_csv:
count = 0
dict_data = {"Down": {}, "Up": {}, "Both": {}}
csv_short_dis = df.loc[:,"short-description"]
csv_num_score = df.loc[:,"numeric-score"]
for i in range(len(batch_size.split(","))):
dict_data["Down"][csv_short_dis[count + 0]] = csv_num_score[count + 0]
dict_data["Up"][csv_short_dis[count + 1]] = csv_num_score[count + 1]
dict_data["Both"][csv_short_dis[count + 2]] = csv_num_score[count + 2]
count += 3
sta_list = csv_sta_names[0][0][:-1].replace('"', '').split(",")
th_list = list(map(float, csv_throughput_values[0][0].split(",")))
for i in range(len(sta_list)):
dict_data[sta_list[i]] = th_list[i]
if individual_station_throughput:
dict_data = {}
if option == "download":
csv_sta_names = df.iloc[[0]].values.tolist()
csv_throughput_values = df.iloc[[1]].values.tolist()
elif option == "upload":
csv_sta_names = df.iloc[[0]].values.tolist()
csv_throughput_values = df.iloc[[2]].values.tolist()
else:
print("Provide proper option: download or upload")
return
sta_list = csv_sta_names[0][0][:-1].replace('"', '').split(",")
th_list = list(map(float, csv_throughput_values[0][0].split(",")))
for i in range(len(sta_list)):
dict_data[sta_list[i]] = th_list[i]
return dict_data

View File

@@ -84,6 +84,7 @@ class TestMultiAssoDisassoBridge(object):
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 4 Mbps so traffic for each station should be 3.96 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -94,13 +95,12 @@ class TestMultiAssoDisassoBridge(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -161,6 +161,7 @@ class TestMultiAssoDisassoBridge(object):
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 4 Mbps so traffic for each station should be 3.96 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -171,13 +172,12 @@ class TestMultiAssoDisassoBridge(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -238,6 +238,7 @@ class TestMultiAssoDisassoBridge(object):
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 8 Mbps so traffic for each station should be 7.92 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -248,13 +249,12 @@ class TestMultiAssoDisassoBridge(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -315,6 +315,7 @@ class TestMultiAssoDisassoBridge(object):
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 8 Mbps so traffic for each station should be 7.92 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -325,13 +326,12 @@ class TestMultiAssoDisassoBridge(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")

View File

@@ -32,6 +32,15 @@ class TestMultiAssoDisassoNat(object):
@pytest.mark.twog
@pytest.mark.udp_upload_2g
def test_multi_station_NAT_udp_upload_2g(self, lf_test, lf_tools, create_lanforge_chamberview_dut):
allure.attach(name="Definition",
body="Multiple association/disassociation stability test intends to measure stability of Wi-Fi device " \
"under a dynamic environment with frequent change of connection status.")
allure.attach(name="Procedure",
body="This test case definition states that we Create 16 stations on 2.4Ghz radio and all of these 16 stations should be on same radio." \
" Run Wifi-capacity test for first 8 stations. " \
"8 stations are picked for sending/receiving packets while the other 8 STAs are picked to do a dis-association/re-association process during the test" \
" Enable uplink 4 Mbps UDP flow from DUT to each of the 8 traffic stations" \
"Disassociate the other 8 stations. Wait for 30 seconds, after that Re-associate the 8 stations.")
# run wifi capacity test here
def thread_fun(station_list):
print(station_list)
@@ -71,6 +80,10 @@ class TestMultiAssoDisassoNat(object):
pass_value = 4 * 0.99
print("pass value ", pass_value)
pass_fail = []
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 4 Mbps so traffic for each station should be 3.96 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -81,13 +94,12 @@ class TestMultiAssoDisassoNat(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -96,6 +108,15 @@ class TestMultiAssoDisassoNat(object):
@pytest.mark.twog
@pytest.mark.udp_download_2g
def test_multi_station_NAT_udp_download_2g(self, lf_test, lf_tools, create_lanforge_chamberview_dut):
allure.attach(name="Definition",
body="Multiple association/disassociation stability test intends to measure stability of Wi-Fi device " \
"under a dynamic environment with frequent change of connection status.")
allure.attach(name="Procedure",
body="This test case definition states that we Create 16 stations on 2.4Ghz radio and all of these 16 stations should be on same radio." \
" Run Wifi-capacity test for first 8 stations. " \
"8 stations are picked for sending/receiving packets while the other 8 STAs are picked to do a dis-association/re-association process during the test" \
" Enable downlink 4 Mbps UDP flow from DUT to each of the 8 traffic stations" \
"Disassociate the other 8 stations. Wait for 30 seconds, after that Re-associate the 8 stations.")
# run wifi capacity test here
def thread_fun(station_list):
print(station_list)
@@ -136,6 +157,10 @@ class TestMultiAssoDisassoNat(object):
pass_value = 4 * 0.99
print("pass value ", pass_value)
pass_fail = []
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 4 Mbps so traffic for each station should be 3.96 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -146,13 +171,12 @@ class TestMultiAssoDisassoNat(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -161,6 +185,15 @@ class TestMultiAssoDisassoNat(object):
@pytest.mark.fiveg
@pytest.mark.udp_upload_5g
def test_multi_station_NAT_udp_upload_5g(self, lf_test, lf_tools, create_lanforge_chamberview_dut):
allure.attach(name="Definition",
body="Multiple association/disassociation stability test intends to measure stability of Wi-Fi device " \
"under a dynamic environment with frequent change of connection status.")
allure.attach(name="Procedure",
body="This test case definition states that we Create 16 stations on 5Ghz radio and all of these 16 stations should be on same radio." \
" Run Wifi-capacity test for first 8 stations. " \
"8 stations are picked for sending/receiving packets while the other 8 STAs are picked to do a dis-association/re-association process during the test" \
" Enable uplink 8 Mbps UDP flow from DUT to each of the 8 traffic stations" \
"Disassociate the other 8 stations. Wait for 30 seconds, after that Re-associate the 8 stations.")
# run wifi capacity test here
def thread_fun(station_list):
print(station_list)
@@ -201,6 +234,10 @@ class TestMultiAssoDisassoNat(object):
pass_value = 8 * 0.99
print("pass value ", pass_value)
pass_fail = []
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 8 Mbps so traffic for each station should be 7.92 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -211,13 +248,12 @@ class TestMultiAssoDisassoNat(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")
@@ -226,6 +262,15 @@ class TestMultiAssoDisassoNat(object):
@pytest.mark.fiveg
@pytest.mark.udp_download_5g
def test_multi_station_NAT_udp_download_5g(self, lf_test, lf_tools, create_lanforge_chamberview_dut):
allure.attach(name="Definition",
body="Multiple association/disassociation stability test intends to measure stability of Wi-Fi device " \
"under a dynamic environment with frequent change of connection status.")
allure.attach(name="Procedure",
body="This test case definition states that we Create 16 stations on 5Ghz radio and all of these 16 stations should be on same radio." \
" Run Wifi-capacity test for first 8 stations. " \
"8 stations are picked for sending/receiving packets while the other 8 STAs are picked to do a dis-association/re-association process during the test" \
" Enable downlink 8 Mbps UDP flow from DUT to each of the 8 traffic stations" \
"Disassociate the other 8 stations. Wait for 30 seconds, after that Re-associate the 8 stations.")
# run wifi capacity test here
def thread_fun(station_list):
print(station_list)
@@ -266,6 +311,10 @@ class TestMultiAssoDisassoNat(object):
pass_value = 8 * 0.99
print("pass value ", pass_value)
pass_fail = []
allure.attach(name="Pass Fail Criteria",
body="UDP traffic rate is at least 99% of the configured rate for each station. Here configured " \
"traffic rate is 8 Mbps so traffic for each station should be 7.92 Mbps ")
lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True)
if not csv_val:
print("csv file does not exist, station did not got ip, Test failed")
allure.attach(name="Csv Data", body="station did not got ip Test failed.")
@@ -276,13 +325,12 @@ class TestMultiAssoDisassoNat(object):
pass_fail.append(1)
else:
pass_fail.append(0)
allure.attach(name="Csv Data", body=str(csv_val))
if pass_fail.count(0) == 0:
print("Test passed successfully")
allure.attach(name="Csv Data", body=str(csv_val))
assert True
else:
print(" valueTest failed due to lesser")
allure.attach(name="Csv Data", body=str(csv_val))
assert False
print("Test Completed... Cleaning up Stations")