mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 12:48:00 +00:00 
			
		
		
		
	test_l3.py : autopep8 refresh
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		
				
					committed by
					
						
						shivam
					
				
			
			
				
	
			
			
			
						parent
						
							32dad9be95
						
					
				
				
					commit
					fa09ecf78f
				
			@@ -47,26 +47,26 @@ Example using wifi_settings
 | 
				
			|||||||
     --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000
 | 
					     --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000
 | 
				
			||||||
     --test_rig CT-US-001 --test_tag 'test_L3'
 | 
					     --test_rig CT-US-001 --test_tag 'test_L3'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NOTES: 
 | 
					NOTES:
 | 
				
			||||||
command composer : <lanforge ip>:8080/help 
 | 
					command composer : <lanforge ip>:8080/help
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Drop RX - in port manager is not the same are layer 3 cx Rx Drop %
 | 
					Drop RX - in port manager is not the same are layer 3 cx Rx Drop %
 | 
				
			||||||
Notes from Ben Greear
 | 
					Notes from Ben Greear
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Port Mgr Drop Rx
 | 
					Port Mgr Drop Rx
 | 
				
			||||||
unlikely you will see rx drop on port mgr
 | 
					unlikely you will see rx drop on port mgr
 | 
				
			||||||
layer-3 rx drop is related to gaps in rx sequence numbers, 
 | 
					layer-3 rx drop is related to gaps in rx sequence numbers,
 | 
				
			||||||
which means network under test dropped frames somehow and/or re-ordered them.
 | 
					which means network under test dropped frames somehow and/or re-ordered them.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Layer 3 cx Rx Drop %
 | 
					Layer 3 cx Rx Drop %
 | 
				
			||||||
cx mgr drop% is based on number peer inpoint transmitted vs what we received.  
 | 
					cx mgr drop% is based on number peer inpoint transmitted vs what we received.
 | 
				
			||||||
It would ignore reodering problem, and also detect complete path loss 
 | 
					It would ignore reodering problem, and also detect complete path loss
 | 
				
			||||||
(where rx drop based on seq numbers would not since there is no gap).  
 | 
					(where rx drop based on seq numbers would not since there is no gap).
 | 
				
			||||||
But, packets in-flight through network under test may be counted as dropped 
 | 
					But, packets in-flight through network under test may be counted as dropped
 | 
				
			||||||
when really they are probably not dropped.
 | 
					when really they are probably not dropped.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
you can quiesce a test at the end, which means stop transmitter 
 | 
					you can quiesce a test at the end, which means stop transmitter
 | 
				
			||||||
but leave received going to drain packets from the network and get better drop% calculations.  
 | 
					but leave received going to drain packets from the network and get better drop% calculations.
 | 
				
			||||||
Stopping a test would record packets in flight at the moment it is stopped as dropped.
 | 
					Stopping a test would record packets in flight at the moment it is stopped as dropped.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -399,13 +399,13 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
                    total_dl_rate += int(endp["rx rate"])
 | 
					                    total_dl_rate += int(endp["rx rate"])
 | 
				
			||||||
                    total_dl_rate_ll += int(endp["rx rate ll"])
 | 
					                    total_dl_rate_ll += int(endp["rx rate ll"])
 | 
				
			||||||
                    total_dl_pkts_ll += int(endp["rx pkts ll"])
 | 
					                    total_dl_pkts_ll += int(endp["rx pkts ll"])
 | 
				
			||||||
                    dl_rx_drop_percent = round(endp["rx drop %"],2)
 | 
					                    dl_rx_drop_percent = round(endp["rx drop %"], 2)
 | 
				
			||||||
                # -B upload side
 | 
					                # -B upload side
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    total_ul_rate += int(endp["rx rate"])
 | 
					                    total_ul_rate += int(endp["rx rate"])
 | 
				
			||||||
                    total_ul_rate_ll += int(endp["rx rate ll"])
 | 
					                    total_ul_rate_ll += int(endp["rx rate ll"])
 | 
				
			||||||
                    total_ul_pkts_ll += int(endp["rx pkts ll"])
 | 
					                    total_ul_pkts_ll += int(endp["rx pkts ll"])
 | 
				
			||||||
                    ul_rx_drop_percent = round(endp["rx drop %"],2)
 | 
					                    ul_rx_drop_percent = round(endp["rx drop %"], 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return lat, jit, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, dl_rx_drop_percent, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, ul_rx_drop_percent
 | 
					        return lat, jit, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, dl_rx_drop_percent, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, ul_rx_drop_percent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -643,7 +643,6 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
    # sta_json = super().json_get(
 | 
					    # sta_json = super().json_get(
 | 
				
			||||||
    #   "port/1/{resource}/list?field=alias".format(resource=self.resource))['interfaces']
 | 
					    #   "port/1/{resource}/list?field=alias".format(resource=self.resource))['interfaces']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def start(self, print_pass=False):
 | 
					    def start(self, print_pass=False):
 | 
				
			||||||
        logger.info("Bringing up stations")
 | 
					        logger.info("Bringing up stations")
 | 
				
			||||||
        self.admin_up(self.side_b)
 | 
					        self.admin_up(self.side_b)
 | 
				
			||||||
@@ -861,7 +860,7 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
                    self.multicast_profile.stop_mc()
 | 
					                    self.multicast_profile.stop_mc()
 | 
				
			||||||
                    # TODO the passes and expected_passes are not checking anything
 | 
					                    # TODO the passes and expected_passes are not checking anything
 | 
				
			||||||
                    if passes == expected_passes:
 | 
					                    if passes == expected_passes:
 | 
				
			||||||
                        # Sets the pass indication 
 | 
					                        # Sets the pass indication
 | 
				
			||||||
                        self._pass(
 | 
					                        self._pass(
 | 
				
			||||||
                            "PASS: Requested-Rate: %s <-> %s  PDU: %s <-> %s   All tests passed" %
 | 
					                            "PASS: Requested-Rate: %s <-> %s  PDU: %s <-> %s   All tests passed" %
 | 
				
			||||||
                            (ul, dl, ul_pdu, dl_pdu), print_pass)
 | 
					                            (ul, dl, ul_pdu, dl_pdu), print_pass)
 | 
				
			||||||
@@ -1023,13 +1022,13 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            self.csv_results_writer.writerow(row)
 | 
					            self.csv_results_writer.writerow(row)
 | 
				
			||||||
            self.csv_results_file.flush()
 | 
					            self.csv_results_file.flush()
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    # quiesce the cx : quiesce a test at the end, which means stop transmitter 
 | 
					    # quiesce the cx : quiesce a test at the end, which means stop transmitter
 | 
				
			||||||
    # but leave received going to drain packets from the network and get better drop% calculations.  
 | 
					    # but leave received going to drain packets from the network and get better drop% calculations.
 | 
				
			||||||
    # Stopping a test would record packets in flight at the moment it is stopped as dropped.
 | 
					    # Stopping a test would record packets in flight at the moment it is stopped as dropped.
 | 
				
			||||||
    def quiesce_cx(self):
 | 
					    def quiesce_cx(self):
 | 
				
			||||||
        self.cx_profile.quiesce_cx()
 | 
					        self.cx_profile.quiesce_cx()
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    # Stop traffic and admin down stations.
 | 
					    # Stop traffic and admin down stations.
 | 
				
			||||||
    def stop(self):
 | 
					    def stop(self):
 | 
				
			||||||
        self.cx_profile.stop_cx()
 | 
					        self.cx_profile.stop_cx()
 | 
				
			||||||
@@ -1632,9 +1631,9 @@ Setting wifi_settings per radio
 | 
				
			|||||||
        '--debug',
 | 
					        '--debug',
 | 
				
			||||||
        help='--debug this will enable debugging in py-json method',
 | 
					        help='--debug this will enable debugging in py-json method',
 | 
				
			||||||
        action='store_true')
 | 
					        action='store_true')
 | 
				
			||||||
    parser.add_argument('--log_level', 
 | 
					    parser.add_argument('--log_level',
 | 
				
			||||||
        default=None, 
 | 
					                        default=None,
 | 
				
			||||||
        help='Set logging level: debug | info | warning | error | critical')
 | 
					                        help='Set logging level: debug | info | warning | error | critical')
 | 
				
			||||||
    parser.add_argument(
 | 
					    parser.add_argument(
 | 
				
			||||||
        '-t',
 | 
					        '-t',
 | 
				
			||||||
        '--endp_type',
 | 
					        '--endp_type',
 | 
				
			||||||
@@ -1908,7 +1907,7 @@ Setting wifi_settings per radio
 | 
				
			|||||||
                    exit(1)
 | 
					                    exit(1)
 | 
				
			||||||
                wifi_mode_list.append(radio_info_dict['wifi_mode'])
 | 
					                wifi_mode_list.append(radio_info_dict['wifi_mode'])
 | 
				
			||||||
                enable_flags_str = radio_info_dict['enable_flags'].replace(
 | 
					                enable_flags_str = radio_info_dict['enable_flags'].replace(
 | 
				
			||||||
                    '(', '').replace(')', '').replace('|', ',').replace('&&',',')
 | 
					                    '(', '').replace(')', '').replace('|', ',').replace('&&', ',')
 | 
				
			||||||
                enable_flags_list = list(enable_flags_str.split(","))
 | 
					                enable_flags_list = list(enable_flags_str.split(","))
 | 
				
			||||||
                wifi_enable_flags_list.append(enable_flags_list)
 | 
					                wifi_enable_flags_list.append(enable_flags_list)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
@@ -2065,9 +2064,9 @@ Setting wifi_settings per radio
 | 
				
			|||||||
    report.start_content_div2()
 | 
					    report.start_content_div2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    report.set_obj_html("Objective", "The Layer 3 Traffic Generation Test is designed to test the performance of the "
 | 
					    report.set_obj_html("Objective", "The Layer 3 Traffic Generation Test is designed to test the performance of the "
 | 
				
			||||||
                                    "Access Point by running layer 3 Cross-Connect Traffic.  Layer-3 Cross-Connects represent a stream "
 | 
					                        "Access Point by running layer 3 Cross-Connect Traffic.  Layer-3 Cross-Connects represent a stream "
 | 
				
			||||||
                                    "of data flowing through the system under test. A Cross-Connect (CX) is composed of two Endpoints, "
 | 
					                        "of data flowing through the system under test. A Cross-Connect (CX) is composed of two Endpoints, "
 | 
				
			||||||
                                    "each of which is associated with a particular Port (physical or virtual interface).")
 | 
					                        "each of which is associated with a particular Port (physical or virtual interface).")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    report.build_objective()
 | 
					    report.build_objective()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -2098,45 +2097,44 @@ Setting wifi_settings per radio
 | 
				
			|||||||
    report.build_table_title()
 | 
					    report.build_table_title()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wifi_mode_dict = {
 | 
					    wifi_mode_dict = {
 | 
				
			||||||
        0 : 'AUTO',         #  802.11g
 | 
					        0: 'AUTO',  # 802.11g
 | 
				
			||||||
        1 : '802.11a',      #  802.11a
 | 
					        1: '802.11a',  # 802.11a
 | 
				
			||||||
        2 : '802.11b',      #  802.11b
 | 
					        2: '802.11b',  # 802.11b
 | 
				
			||||||
        3 : '802.11g',      #  802.11g
 | 
					        3: '802.11g',  # 802.11g
 | 
				
			||||||
        4 : '802.11abg',    #  802.11abg
 | 
					        4: '802.11abg',  # 802.11abg
 | 
				
			||||||
        5 : '802.11abgn',   #  802.11abgn
 | 
					        5: '802.11abgn',  # 802.11abgn
 | 
				
			||||||
        6 : '802.11bgn',    #  802.11bgn
 | 
					        6: '802.11bgn',  # 802.11bgn
 | 
				
			||||||
        7 : '802.11bg',     #  802.11bg
 | 
					        7: '802.11bg',  # 802.11bg
 | 
				
			||||||
        8 : '802.11abgnAC', #  802.11abgn-AC
 | 
					        8: '802.11abgnAC',  # 802.11abgn-AC
 | 
				
			||||||
        9 : '802.11anAC',   #  802.11an-AC
 | 
					        9: '802.11anAC',  # 802.11an-AC
 | 
				
			||||||
        10: '802.11an',     #  802.11an
 | 
					        10: '802.11an',  # 802.11an
 | 
				
			||||||
        11: '802.11bgnAC',  #  802.11bgn-AC
 | 
					        11: '802.11bgnAC',  # 802.11bgn-AC
 | 
				
			||||||
        12: '802.11abgnAX', #  802.11abgn-AX
 | 
					        12: '802.11abgnAX',  # 802.11abgn-AX
 | 
				
			||||||
                                #     a/b/g/n/AC/AX (dual-band AX) support
 | 
					        #     a/b/g/n/AC/AX (dual-band AX) support
 | 
				
			||||||
        13: '802.11bgnAX',  #  802.11bgn-AX
 | 
					        13: '802.11bgnAX',  # 802.11bgn-AX
 | 
				
			||||||
        14: '802.11anAX',   #  802.11an-AX
 | 
					        14: '802.11anAX',  # 802.11an-AX
 | 
				
			||||||
        15: '802.11aAX'     #  802.11a-AX (6E disables /n and /ac)
 | 
					        15: '802.11aAX'  # 802.11a-AX (6E disables /n and /ac)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (
 | 
					    for (
 | 
				
			||||||
        radio_,
 | 
					            radio_,
 | 
				
			||||||
        ssid_,
 | 
					            ssid_,
 | 
				
			||||||
        ssid_password_,
 | 
					            ssid_password_,
 | 
				
			||||||
        ssid_security_,
 | 
					            ssid_security_,
 | 
				
			||||||
        mode_,
 | 
					            mode_,
 | 
				
			||||||
        wifi_enable_flags_list_,
 | 
					            wifi_enable_flags_list_,
 | 
				
			||||||
        reset_port_enable_,
 | 
					            reset_port_enable_,
 | 
				
			||||||
        reset_port_time_min_,
 | 
					            reset_port_time_min_,
 | 
				
			||||||
        reset_port_time_max_) in zip(
 | 
					            reset_port_time_max_) in zip(
 | 
				
			||||||
        radio_name_list,
 | 
					            radio_name_list,
 | 
				
			||||||
        ssid_list,
 | 
					            ssid_list,
 | 
				
			||||||
        ssid_password_list,
 | 
					            ssid_password_list,
 | 
				
			||||||
        ssid_security_list,
 | 
					            ssid_security_list,
 | 
				
			||||||
        wifi_mode_list,
 | 
					            wifi_mode_list,
 | 
				
			||||||
        wifi_enable_flags_list,
 | 
					            wifi_enable_flags_list,
 | 
				
			||||||
        reset_port_enable_list,
 | 
					            reset_port_enable_list,
 | 
				
			||||||
        reset_port_time_min_list,
 | 
					            reset_port_time_min_list,
 | 
				
			||||||
        reset_port_time_max_list):
 | 
					            reset_port_time_max_list):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        mode_value = wifi_mode_dict[int(mode_)]
 | 
					        mode_value = wifi_mode_dict[int(mode_)]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user