mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
1. Updating argparse commands so they include flags
2. Create check_argparse which allows us to check which flags are or are not included in argparse statements. Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
'''
|
||||
this script creates 1 station on given arguments
|
||||
how to run - [lanforge@LF4-Node2 py-scripts]$ python3 station_banao.py -hst localhost -s TestAP22 -pwd [BLANK] -sec open -rad wiphy0
|
||||
'''
|
||||
import sys
|
||||
import os
|
||||
import importlib
|
||||
import argparse
|
||||
import time
|
||||
|
||||
|
||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
|
||||
|
||||
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
||||
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
|
||||
LFCliBase = lfcli_base.LFCliBase
|
||||
realm = importlib.import_module("py-json.realm")
|
||||
Realm = realm.Realm
|
||||
|
||||
|
||||
class STATION(LFCliBase):
|
||||
def __init__(self, lfclient_host, lfclient_port, ssid, paswd, security, radio, sta_list=None, name_prefix="L3Test", upstream="eth2"):
|
||||
#!/usr/bin/env python3
|
||||
'''
|
||||
this script creates 1 station on given arguments
|
||||
how to run - [lanforge@LF4-Node2 py-scripts]$ python3 station_banao.py -hst localhost -s TestAP22 -pwd [BLANK] -sec open -rad wiphy0
|
||||
'''
|
||||
import sys
|
||||
import os
|
||||
import importlib
|
||||
import argparse
|
||||
import time
|
||||
|
||||
|
||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
|
||||
|
||||
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
||||
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
|
||||
LFCliBase = lfcli_base.LFCliBase
|
||||
realm = importlib.import_module("py-json.realm")
|
||||
Realm = realm.Realm
|
||||
|
||||
|
||||
class STATION(LFCliBase):
|
||||
def __init__(self, lfclient_host, lfclient_port, ssid, paswd, security, radio, sta_list=None, name_prefix="L3Test", upstream="eth2"):
|
||||
super().__init__(lfclient_host, lfclient_port)
|
||||
self.host = lfclient_host
|
||||
self.port = lfclient_port
|
||||
@@ -83,7 +83,10 @@ class STATION(LFCliBase):
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Netgear AP DFS Test Script")
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='station_layer3.py',
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
description="Netgear AP DFS Test Script")
|
||||
parser.add_argument('-hst', '--host', type=str, help='host name')
|
||||
parser.add_argument('-s', '--ssid', type=str, help='ssid for client')
|
||||
parser.add_argument('-pwd', '--passwd', type=str, help='password to connect to ssid')
|
||||
@@ -101,6 +104,6 @@ def main():
|
||||
obj.precleanup(station_list)
|
||||
obj.build()
|
||||
obj.start(station_list)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user