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:
Matthew Stidham
2021-09-21 16:13:07 -07:00
parent e64d357fb1
commit 4e7e8b9360
27 changed files with 182 additions and 59 deletions

View File

@@ -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()