mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
example_security_connection autopep8
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -35,7 +35,8 @@ class IPv4Test(LFCliBase):
|
||||
self.timeout = 120
|
||||
self.number_template = number_template
|
||||
self.debug = _debug_on
|
||||
self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port)
|
||||
self.local_realm = realm.Realm(
|
||||
lfclient_host=self.host, lfclient_port=self.port)
|
||||
self.station_profile = self.local_realm.new_station_profile()
|
||||
|
||||
self.station_profile.lfclient_url = self.lfclient_url
|
||||
@@ -51,27 +52,32 @@ class IPv4Test(LFCliBase):
|
||||
def build(self):
|
||||
# Build stations
|
||||
#print("We've gotten into the build stations function")
|
||||
self.station_profile.use_security(self.security, self.ssid, self.password)
|
||||
self.station_profile.use_security(
|
||||
self.security, self.ssid, self.password)
|
||||
self.station_profile.set_number_template(self.number_template)
|
||||
print("Creating stations")
|
||||
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
|
||||
self.station_profile.set_command_param("set_port", "report_timer", 1500)
|
||||
self.station_profile.set_command_flag(
|
||||
"add_sta", "create_admin_down", 1)
|
||||
self.station_profile.set_command_param(
|
||||
"set_port", "report_timer", 1500)
|
||||
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
|
||||
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.station_profile.admin_up()
|
||||
if self.local_realm.wait_for_ip(station_list=self.sta_list, debug=self.debug, timeout_sec=30):
|
||||
self._pass("Station build finished")
|
||||
self.exit_success()
|
||||
else:
|
||||
self._fail("Stations not able to acquire IP. Please check network input.")
|
||||
self._fail(
|
||||
"Stations not able to acquire IP. Please check network input.")
|
||||
self.exit_fail()
|
||||
|
||||
|
||||
def cleanup(self, sta_list):
|
||||
self.station_profile.cleanup(sta_list)
|
||||
LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=sta_list,
|
||||
debug=self.debug)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
parser = LFCliBase.create_basic_argparse(
|
||||
@@ -108,7 +114,8 @@ def main():
|
||||
optional = agroup
|
||||
if optional is not None:
|
||||
optional.add_argument('--mode', help=LFCliBase.Help_Mode)
|
||||
optional.add_argument('--ap',help='Add BSSID of access point to connect to')
|
||||
optional.add_argument(
|
||||
'--ap', help='Add BSSID of access point to connect to')
|
||||
|
||||
args = parser.parse_args()
|
||||
num_sta = 2
|
||||
@@ -130,5 +137,6 @@ def main():
|
||||
ip_test.timeout = 60
|
||||
ip_test.build()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user