diff --git a/tests/e2e/advanced/rate_vs_range/wpa2_personal/test_bridge_mode.py b/tests/e2e/advanced/rate_vs_range/wpa2_personal/test_bridge_mode.py index 83bb3ba94..73e17e0aa 100644 --- a/tests/e2e/advanced/rate_vs_range/wpa2_personal/test_bridge_mode.py +++ b/tests/e2e/advanced/rate_vs_range/wpa2_personal/test_bridge_mode.py @@ -68,9 +68,9 @@ class TestRatevsRangeBridge(object): print(ser_no) val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:;TCP'], ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])], - ['attenuations: 0 100 210..+30..630'], ['attenuations2: 0 100 210..+30..630']] + ['attenuations: 0 100 210..+100..630'], ['attenuations2: 0 100 210..+100..630'],['chamber: DUT-Chamber'], ['tt_deg: 0']] if station: - rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,duration="5000", + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, download_rate="1Gpbs", duration='5000', instance_name="MODEBRIDGE_RVR_11B_TWOG_modified", vlan_id=vlan, dut_name=dut_name, raw_lines=val) report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] @@ -84,10 +84,8 @@ class TestRatevsRangeBridge(object): pass_value = {"strong": 100, "medium": 95, "weak": 14} atn = [0, 10, 21, 24, 27,30,33,36,39,42,45,48,51,54,57,60,63] if kpi in entries: - kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], - dir_name=report_name) # name="CSV Data", body="Throughput value : " + str(kpi_val) + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) print(kpi_val) - allure.attach.file(source="../reports/" + report_name + "/" + kpi, name="kpi.csv") if str(kpi_val) == "empty": print("Throughput value from kpi.csv is empty, Test failed") allure.attach(name="CSV Data", body="Throughput value from kpi.csv is empty, Test failed") @@ -97,15 +95,15 @@ class TestRatevsRangeBridge(object): start, thrpt_val, pass_fail = 0, {}, [] for i in pass_value: # count = 0 - dirction = "DUT-TX" + direction = "DUT-TX" for j in range(start, len(kpi_val), len(atn)): - thrpt_val[f"{atn[start]}--{dirction}"] = kpi_val[j][0] + thrpt_val[f"{atn[start]}--{direction}"] = kpi_val[j][0] if kpi_val[j][0] >= pass_value[i]: pass_fail.append("PASS") else: pass_fail.append("FAIL") # count += 1 - dirction = "DUT-RX" + direction = "DUT-RX" start += 7 if "FAIL" in pass_fail: print("Test failed due to lesser value") @@ -150,18 +148,54 @@ class TestRatevsRangeBridge(object): print(ser_no) val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types: TCP'], ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])], - ['attenuations: 0 100 210..+30..630'], ['attenuations2: 0 100 210..+30..630']] + ['attenuations: 0 100 210..+30..630'], ['attenuations2: 0 100 210..+30..630'],['chamber: DUT-Chamber'], ['tt_deg: 0']] if station: time.sleep(3) - rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, download_rate="1Gpbs", instance_name="MODEBRIDGE_RVR_11G_TWOG_modified", vlan_id=vlan, dut_name=dut_name, raw_lines=val) report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test") print("Test Completed... Cleaning up Stations") lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True) - assert station + kpi = "kpi.csv" + pass_value = {"strong": 100, "medium": 95, "weak": 14} + atn = [0, 10, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63] + if kpi in entries: + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(kpi_val) + if str(kpi_val) == "empty": + print("Throughput value from kpi.csv is empty, Test failed") + allure.attach(name="CSV Data", body="Throughput value from kpi.csv is empty, Test failed") + assert False, "Throughput value from kpi.csv is empty, Test failed" + else: + allure.attach(name="CSV Data", body="Throughput value : " + str(kpi_val)) + start, thrpt_val, pass_fail = 0, {}, [] + for i in pass_value: + # count = 0 + direction = "DUT-TX" + for j in range(start, len(kpi_val), len(atn)): + thrpt_val[f"{atn[start]}--{direction}"] = kpi_val[j][0] + if kpi_val[j][0] >= pass_value[i]: + pass_fail.append("PASS") + else: + pass_fail.append("FAIL") + # count += 1 + direction = "DUT-RX" + start += 7 + if "FAIL" in pass_fail: + print("Test failed due to lesser value") + assert False, "Test failed due to lesser value" + else: + print("Test passed successfully") + assert True + else: + print("csv file does not exist, Test failed") + allure.attach(name="CSV Data", body="csv file does not exist") + assert False, "csv file does not exist" else: print("Test failed due to no station ip") assert False, "Test failed due to no station ip" @@ -195,18 +229,54 @@ class TestRatevsRangeBridge(object): print(ser_no) val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'], ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])], - ['attenuations: 0 100 210..+30..540'], ['attenuations2: 0 100 210..+30..540']] + ['attenuations: 0 100 210..+30..540'], ['attenuations2: 0 100 210..+30..540'],['chamber: DUT-Chamber'], ['tt_deg: 0']] if station: time.sleep(3) - rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,download_rate="1Gpbs", instance_name="MODEBRIDGE_RVR_11A_FIVEG_modified", vlan_id=vlan, dut_name=dut_name, raw_lines=val) report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test") print("Test Completed... Cleaning up Stations") lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True) - assert station + kpi = "kpi.csv" + pass_value = {"strong": 100, "medium": 95, "weak": 14} + atn = [0, 10, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63] + if kpi in entries: + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(kpi_val) + if str(kpi_val) == "empty": + print("Throughput value from kpi.csv is empty, Test failed") + allure.attach(name="CSV Data", body="Throughput value from kpi.csv is empty, Test failed") + assert False, "Throughput value from kpi.csv is empty, Test failed" + else: + allure.attach(name="CSV Data", body="Throughput value : " + str(kpi_val)) + start, thrpt_val, pass_fail = 0, {}, [] + for i in pass_value: + # count = 0 + direction = "DUT-TX" + for j in range(start, len(kpi_val), len(atn)): + thrpt_val[f"{atn[start]}--{direction}"] = kpi_val[j][0] + if kpi_val[j][0] >= pass_value[i]: + pass_fail.append("PASS") + else: + pass_fail.append("FAIL") + # count += 1 + direction = "DUT-RX" + start += 7 + if "FAIL" in pass_fail: + print("Test failed due to lesser value") + assert False, "Test failed due to lesser value" + else: + print("Test passed successfully") + assert True + else: + print("csv file does not exist, Test failed") + allure.attach(name="CSV Data", body="csv file does not exist") + assert False, "csv file does not exist" else: print("Test failed due to no station ip") assert False, "Test failed due to no station ip" @@ -241,18 +311,54 @@ class TestRatevsRangeBridge(object): print(ser_no) val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'], ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])], - ['attenuations: 0 100 210..+30..540'], ['attenuations2: 0 100 210..+30..540']] + ['attenuations: 0 100 210..+30..540'], ['attenuations2: 0 100 210..+30..540'],['chamber: DUT-Chamber'], ['tt_deg: 0']] if station: time.sleep(3) - rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,download_rate="1Gpbs", instance_name="MODEBRIDGE_RVR_11AN_FIVEG_modified", vlan_id=vlan, dut_name=dut_name, raw_lines=val) report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test") print("Test Completed... Cleaning up Stations") lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True) - assert station + kpi = "kpi.csv" + pass_value = {"strong": 100, "medium": 95, "weak": 14} + atn = [0, 10, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63] + if kpi in entries: + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(kpi_val) + if str(kpi_val) == "empty": + print("Throughput value from kpi.csv is empty, Test failed") + allure.attach(name="CSV Data", body="Throughput value from kpi.csv is empty, Test failed") + assert False, "Throughput value from kpi.csv is empty, Test failed" + else: + allure.attach(name="CSV Data", body="Throughput value : " + str(kpi_val)) + start, thrpt_val, pass_fail = 0, {}, [] + for i in pass_value: + # count = 0 + direction = "DUT-TX" + for j in range(start, len(kpi_val), len(atn)): + thrpt_val[f"{atn[start]}--{direction}"] = kpi_val[j][0] + if kpi_val[j][0] >= pass_value[i]: + pass_fail.append("PASS") + else: + pass_fail.append("FAIL") + # count += 1 + direction = "DUT-RX" + start += 7 + if "FAIL" in pass_fail: + print("Test failed due to lesser value") + assert False, "Test failed due to lesser value" + else: + print("Test passed successfully") + assert True + else: + print("csv file does not exist, Test failed") + allure.attach(name="CSV Data", body="csv file does not exist") + assert False, "csv file does not exist" else: print("Test failed due to no station ip") assert False, "Test failed due to no station ip" @@ -287,19 +393,55 @@ class TestRatevsRangeBridge(object): print(ser_no) val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'], ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])], - ['attenuations: 0 100 210..+30..540'],['attenuations2: 0 100 210..+30..540']] + ['attenuations: 0 100 210..+30..540'],['attenuations2: 0 100 210..+30..540'],['chamber: DUT-Chamber'], ['tt_deg: 0']] if station: time.sleep(3) - rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,download_rate="1Gpbs", instance_name="MODEBRIDGE_RVR_11AC_FIVEG_modified", vlan_id=vlan, dut_name=dut_name, raw_lines=val) report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test") print("Test Completed... Cleaning up Stations") lf_test.Client_disconnect(clear_all_sta=True, clean_l3_traffic=True) - assert station + kpi = "kpi.csv" + pass_value = {"strong": 100, "medium": 95, "weak": 14} + atn = [0, 10, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63] + if kpi in entries: + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(kpi_val) + if str(kpi_val) == "empty": + print("Throughput value from kpi.csv is empty, Test failed") + allure.attach(name="CSV Data", body="Throughput value from kpi.csv is empty, Test failed") + assert False, "Throughput value from kpi.csv is empty, Test failed" + else: + allure.attach(name="CSV Data", body="Throughput value : " + str(kpi_val)) + start, thrpt_val, pass_fail = 0, {}, [] + for i in pass_value: + # count = 0 + direction = "DUT-TX" + for j in range(start, len(kpi_val), len(atn)): + thrpt_val[f"{atn[start]}--{direction}"] = kpi_val[j][0] + if kpi_val[j][0] >= pass_value[i]: + pass_fail.append("PASS") + else: + pass_fail.append("FAIL") + # count += 1 + direction = "DUT-RX" + start += 7 + if "FAIL" in pass_fail: + print("Test failed due to lesser value") + assert False, "Test failed due to lesser value" + else: + print("Test passed successfully") + assert True + else: + print("csv file does not exist, Test failed") + allure.attach(name="CSV Data", body="csv file does not exist") + assert False, "csv file does not exist" else: print("Test failed due to no station ip") assert False, "Test failed due to no station ip"