mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	optional number_template argument in create_l3
Signed-off-by: Matthew Stidham <stidmatt@protonmail.com>
This commit is contained in:
		@@ -24,6 +24,7 @@ import time
 | 
				
			|||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
from realm import TestGroupProfile
 | 
					from realm import TestGroupProfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CreateL3(Realm):
 | 
					class CreateL3(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,
 | 
				
			||||||
@@ -64,7 +65,6 @@ class CreateL3(Realm):
 | 
				
			|||||||
            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
 | 
				
			||||||
        self.cx_profile.name_prefix = self.name_prefix
 | 
					        self.cx_profile.name_prefix = self.name_prefix
 | 
				
			||||||
@@ -78,7 +78,6 @@ class CreateL3(Realm):
 | 
				
			|||||||
        for sta in self.sta_list:
 | 
					        for sta in self.sta_list:
 | 
				
			||||||
            self.rm_port(sta, check_exists=True)
 | 
					            self.rm_port(sta, check_exists=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def build(self):
 | 
					    def build(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.station_profile.use_security(self.security,
 | 
					        self.station_profile.use_security(self.security,
 | 
				
			||||||
@@ -98,6 +97,7 @@ class CreateL3(Realm):
 | 
				
			|||||||
                               sleep_time=0)
 | 
					                               sleep_time=0)
 | 
				
			||||||
        self._pass("PASS: Station build finished")
 | 
					        self._pass("PASS: Station build finished")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    parser = LFCliBase.create_basic_argparse(
 | 
					    parser = LFCliBase.create_basic_argparse(
 | 
				
			||||||
        prog='create_l3.py',
 | 
					        prog='create_l3.py',
 | 
				
			||||||
@@ -136,6 +136,7 @@ python3 ./test_ipv4_variable_time.py
 | 
				
			|||||||
    --a_min 1000
 | 
					    --a_min 1000
 | 
				
			||||||
    --b_min 1000
 | 
					    --b_min 1000
 | 
				
			||||||
    --ap "00:0e:8e:78:e1:76"
 | 
					    --ap "00:0e:8e:78:e1:76"
 | 
				
			||||||
 | 
					    --number_template 0000
 | 
				
			||||||
    --debug
 | 
					    --debug
 | 
				
			||||||
            ''')
 | 
					            ''')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -156,16 +157,18 @@ python3 ./test_ipv4_variable_time.py
 | 
				
			|||||||
    if optional_args is not None:
 | 
					    if optional_args is not None:
 | 
				
			||||||
        optional_args.add_argument('--mode', help='Used to force mode of stations')
 | 
					        optional_args.add_argument('--mode', help='Used to force mode of stations')
 | 
				
			||||||
        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')
 | 
				
			||||||
 | 
					        optional_args.add_argument('--number_template', help='Start the station numbering with a particular number. Default is 0000', default=0000)
 | 
				
			||||||
    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 = CreateL3(host=args.mgr,
 | 
					    ip_var_test = CreateL3(host=args.mgr,
 | 
				
			||||||
                           port=args.mgr_port,
 | 
					                           port=args.mgr_port,
 | 
				
			||||||
                                   number_template="0000",
 | 
					                           number_template=str(args.number_template),
 | 
				
			||||||
                           sta_list=station_list,
 | 
					                           sta_list=station_list,
 | 
				
			||||||
                           name_prefix="VT",
 | 
					                           name_prefix="VT",
 | 
				
			||||||
                           upstream=args.upstream_port,
 | 
					                           upstream=args.upstream_port,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user