mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-04 12:48:00 +00:00
example-security-connection: Add exit code logic.
And clean up stations on exit if --noclean was not selected. Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
@@ -225,6 +225,7 @@ Command example:
|
||||
create_vaps.append(create_vap)
|
||||
|
||||
# TODO: Add logic to clean up vap, unless --noclean option is specified.
|
||||
# TODO: Set radio back to previous channel.
|
||||
|
||||
any_failed = False
|
||||
for v in create_vaps:
|
||||
|
||||
@@ -4,15 +4,16 @@ import os
|
||||
import importlib
|
||||
import argparse
|
||||
import logging
|
||||
from time import sleep
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python 3")
|
||||
logger.critical("This script requires Python 3")
|
||||
exit(1)
|
||||
|
||||
|
||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
lf_logger_config = importlib.import_module("py-scripts.lf_logger_config")
|
||||
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
||||
realm = importlib.import_module("py-json.realm")
|
||||
@@ -148,6 +149,14 @@ def main():
|
||||
ip_test.timeout = 60
|
||||
ip_test.build()
|
||||
|
||||
if not args.noclean:
|
||||
sleep(5)
|
||||
ip_test.cleanup(station_list)
|
||||
|
||||
if ip_test.passes():
|
||||
ip_test.exit_success()
|
||||
else:
|
||||
ip_test.exit_fail()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user