sta_scan_test.py : fixed imports

tip_station_powersave.py : added --help
lf_qa.py : fixed comments in help

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-09-27 16:26:44 -06:00
parent 30cc3c532a
commit 12d02af9b6
3 changed files with 31 additions and 9 deletions

View File

@@ -14,22 +14,23 @@ License: Free to distribute and modify. LANforge systems must be licensed.
import sys import sys
import os import os
import importlib
if sys.version_info[0] != 3: if sys.version_info[0] != 3:
print("This script requires Python 3") print("This script requires Python 3")
exit(1) exit(1)
if 'py-json' not in sys.path:
sys.path.append(os.path.join(os.path.abspath('..'), 'py-json'))
if 'py-dashboard' not in sys.path:
sys.path.append(os.path.join(os.path.abspath('..'), 'py-dashboard'))
import argparse import argparse
from LANforge import LFUtils
from realm import Realm
import time import time
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
LFCliBase = lfcli_base.LFCliBase
realm = importlib.import_module("py-json.realm")
Realm = realm.Realm
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
class StaScan(Realm): class StaScan(Realm):
def __init__(self, def __init__(self,

View File

@@ -5,6 +5,7 @@ import importlib
import pprint import pprint
import time import time
import datetime import datetime
import argparse
if sys.version_info[0] != 3: if sys.version_info[0] != 3:
print("This script requires Python 3") print("This script requires Python 3")
@@ -380,6 +381,26 @@ class TIPStationPowersave(LFCliBase):
self.sta_powersave_disabled_profile.cleanup(desired_stations=self.normal_sta_list) self.sta_powersave_disabled_profile.cleanup(desired_stations=self.normal_sta_list)
def main(): def main():
parser = argparse.ArgumentParser(
prog='tip_station_powersave.py',
formatter_class=argparse.RawTextHelpFormatter,
epilog='''\
tip_station_powersave.py
''',
description='''\
This script uses filters from realm's PacketFilter class to filter pcap output for specific packets.
Currently it uses a filter for association packets using wlan.fc.type_subtype<=3. It is also using a filter
for QOS Null packets using wlan.fc.type_subtype==44. Both filters are also looking for the existence of
either the station MAC or the AP MAC in wlan.addr
These are returned as an array of lines from the output in the format
$subtype $mac_addresses $wlan.fc.pwrmgt
#Currently, this test can only be applied to UDP connections
''')
args = parser.parse_args()
lfjson_host = "localhost" lfjson_host = "localhost"
lfjson_port = 8080 lfjson_port = 8080
#station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000) #station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=0, end_id_=4, padding_number_=10000)

View File

@@ -464,7 +464,7 @@ class csv_sqlite_dash():
def main(): def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog='kpi_csv_sq.py', prog='lf_qa.py',
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
epilog='''\ epilog='''\
read kpi.csv into sqlite database , save png of history and preset on dashboard read kpi.csv into sqlite database , save png of history and preset on dashboard