mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	Fix whitespace errors in create_l4.py
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
		@@ -13,7 +13,6 @@ if sys.version_info[0] != 3:
 | 
				
			|||||||
    print("This script requires Python 3")
 | 
					    print("This script requires Python 3")
 | 
				
			||||||
    exit(1)
 | 
					    exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
					 | 
				
			||||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
 | 
					sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
 | 
					lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
 | 
				
			||||||
@@ -27,7 +26,7 @@ TestGroupProfile = realm.TestGroupProfile
 | 
				
			|||||||
class CreateL4(Realm):
 | 
					class CreateL4(Realm):
 | 
				
			||||||
    def __init__(self,
 | 
					    def __init__(self,
 | 
				
			||||||
                 ssid, security, password, sta_list, name_prefix, upstream, radio,
 | 
					                 ssid, security, password, sta_list, name_prefix, upstream, radio,
 | 
				
			||||||
                 host="localhost", port=8080, mode = 0, ap=None,
 | 
					                 host="localhost", port=8080, mode=0, ap=None,
 | 
				
			||||||
                 side_a_min_rate=56, side_a_max_rate=0,
 | 
					                 side_a_min_rate=56, side_a_max_rate=0,
 | 
				
			||||||
                 side_b_min_rate=56, side_b_max_rate=0,
 | 
					                 side_b_min_rate=56, side_b_max_rate=0,
 | 
				
			||||||
                 number_template="00000", use_ht160=False,
 | 
					                 number_template="00000", use_ht160=False,
 | 
				
			||||||
@@ -43,8 +42,8 @@ class CreateL4(Realm):
 | 
				
			|||||||
        self.security = security
 | 
					        self.security = security
 | 
				
			||||||
        self.password = password
 | 
					        self.password = password
 | 
				
			||||||
        self.radio = radio
 | 
					        self.radio = radio
 | 
				
			||||||
        self.mode= mode
 | 
					        self.mode = mode
 | 
				
			||||||
        self.ap=ap
 | 
					        self.ap = ap
 | 
				
			||||||
        self.number_template = number_template
 | 
					        self.number_template = number_template
 | 
				
			||||||
        self.debug = _debug_on
 | 
					        self.debug = _debug_on
 | 
				
			||||||
        self.name_prefix = name_prefix
 | 
					        self.name_prefix = name_prefix
 | 
				
			||||||
@@ -61,9 +60,8 @@ class CreateL4(Realm):
 | 
				
			|||||||
            self.station_profile.mode = 9
 | 
					            self.station_profile.mode = 9
 | 
				
			||||||
        self.station_profile.mode = mode
 | 
					        self.station_profile.mode = mode
 | 
				
			||||||
        if self.ap is not None:
 | 
					        if self.ap is not None:
 | 
				
			||||||
            self.station_profile.set_command_param("add_sta", "ap",self.ap)
 | 
					            self.station_profile.set_command_param("add_sta", "ap", self.ap)
 | 
				
			||||||
        #self.station_list= LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=2, padding_number_=10000, radio='wiphy0') #Make radio a user defined variable from terminal.
 | 
					        # self.station_list= LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=2, padding_number_=10000, radio='wiphy0') #Make radio a user defined variable from terminal.
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.cx_profile.host = self.host
 | 
					        self.cx_profile.host = self.host
 | 
				
			||||||
        self.cx_profile.port = self.port
 | 
					        self.cx_profile.port = self.port
 | 
				
			||||||
@@ -91,7 +89,9 @@ class CreateL4(Realm):
 | 
				
			|||||||
        self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug)
 | 
					        self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug)
 | 
				
			||||||
        self._pass("PASS: Station build finished")
 | 
					        self._pass("PASS: Station build finished")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, suppress_related_commands_=True)
 | 
					        self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug,
 | 
				
			||||||
 | 
					                               suppress_related_commands_=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    parser = LFCliBase.create_basic_argparse(
 | 
					    parser = LFCliBase.create_basic_argparse(
 | 
				
			||||||
@@ -134,30 +134,31 @@ python3 ./layer4.py
 | 
				
			|||||||
    --debug
 | 
					    --debug
 | 
				
			||||||
            ''')
 | 
					            ''')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    required_args=None
 | 
					    required_args = None
 | 
				
			||||||
    for group in parser._action_groups:
 | 
					    for group in parser._action_groups:
 | 
				
			||||||
        if group.title == "required arguments":
 | 
					        if group.title == "required arguments":
 | 
				
			||||||
            required_args=group
 | 
					            required_args = group
 | 
				
			||||||
            break;
 | 
					            break
 | 
				
			||||||
    if required_args is not None:
 | 
					    if required_args is not None:
 | 
				
			||||||
        required_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
					        required_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
				
			||||||
        required_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
					        required_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    optional_args=None
 | 
					    optional_args = None
 | 
				
			||||||
    for group in parser._action_groups:
 | 
					    for group in parser._action_groups:
 | 
				
			||||||
        if group.title == "optional arguments":
 | 
					        if group.title == "optional arguments":
 | 
				
			||||||
            optional_args=group
 | 
					            optional_args = group
 | 
				
			||||||
            break;
 | 
					            break
 | 
				
			||||||
    if optional_args is not None:
 | 
					    if optional_args is not None:
 | 
				
			||||||
        optional_args.add_argument('--mode',help='Used to force mode of stations', default=0)
 | 
					        optional_args.add_argument('--mode', help='Used to force mode of stations', default=0)
 | 
				
			||||||
        optional_args.add_argument('--ap',help='Used to force a connection to a particular AP')
 | 
					        optional_args.add_argument('--ap', help='Used to force a connection to a particular AP')
 | 
				
			||||||
    args = parser.parse_args()
 | 
					    args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    num_sta = 2
 | 
					    num_sta = 2
 | 
				
			||||||
    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
					    if (args.num_stations is not None) and (int(args.num_stations) > 0):
 | 
				
			||||||
        num_sta = int(args.num_stations)
 | 
					        num_sta = int(args.num_stations)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta-1, padding_number_=10000, radio=args.radio)
 | 
					    station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=num_sta - 1, padding_number_=10000,
 | 
				
			||||||
 | 
					                                          radio=args.radio)
 | 
				
			||||||
    ip_var_test = CreateL4(host=args.mgr,
 | 
					    ip_var_test = CreateL4(host=args.mgr,
 | 
				
			||||||
                           port=args.mgr_port,
 | 
					                           port=args.mgr_port,
 | 
				
			||||||
                           number_template="0000",
 | 
					                           number_template="0000",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user