mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
refactored scripts to use --no_cleanup
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
committed by
shivam
parent
4e232d5043
commit
19117b2ece
@@ -761,7 +761,7 @@ class LFCliBase:
|
|||||||
optional.add_argument('--debug_log',
|
optional.add_argument('--debug_log',
|
||||||
default=None,
|
default=None,
|
||||||
help="Specify a file to send debug output to")
|
help="Specify a file to send debug output to")
|
||||||
optional.add_argument('--noclean', help='Do not cleanup before exit',
|
optional.add_argument('--no_cleanup', help='Do not cleanup before exit',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
if more_optional is not None:
|
if more_optional is not None:
|
||||||
for argument in more_optional:
|
for argument in more_optional:
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Command example:
|
|||||||
./create_bond.py
|
./create_bond.py
|
||||||
--bond_name bond0
|
--bond_name bond0
|
||||||
--network_dev_list eth0,eth1
|
--network_dev_list eth0,eth1
|
||||||
--noclean
|
--no_cleanup
|
||||||
--debug
|
--debug
|
||||||
''')
|
''')
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ Command example:
|
|||||||
)
|
)
|
||||||
create_bond.build()
|
create_bond.build()
|
||||||
|
|
||||||
if not args.noclean:
|
if not args.no_cleanup:
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
|
||||||
create_bond.cleanup()
|
create_bond.cleanup()
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Command example:
|
|||||||
create_bridge.build()
|
create_bridge.build()
|
||||||
logger.info('Created bridge: %s' % bridge_list[0])
|
logger.info('Created bridge: %s' % bridge_list[0])
|
||||||
|
|
||||||
if not args.noclean:
|
if not args.no_cleanup:
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
|
||||||
create_bridge.cleanup()
|
create_bridge.cleanup()
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ def main():
|
|||||||
Generate traffic between ports
|
Generate traffic between ports
|
||||||
''',
|
''',
|
||||||
description='''\
|
description='''\
|
||||||
./create_l3.py --ssid lanforge --password password --security wpa2 --radio 1.1.wiphy0 --endp_a wiphy0 --endp_b wiphy1 --noclean
|
./create_l3.py --ssid lanforge --password password --security wpa2 --radio 1.1.wiphy0 --endp_a wiphy0 --endp_b wiphy1 --no_cleanup
|
||||||
''')
|
''')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--min_rate_a',
|
'--min_rate_a',
|
||||||
@@ -141,10 +141,10 @@ def main():
|
|||||||
|
|
||||||
ip_var_test.build()
|
ip_var_test.build()
|
||||||
|
|
||||||
# TODO: Delete the thing just created, unless --noclean option was added.
|
# TODO: Delete the thing just created, unless --no_cleanup option was added.
|
||||||
# Similar to how the create_bond.py does it.
|
# Similar to how the create_bond.py does it.
|
||||||
|
|
||||||
if not args.noclean:
|
if not args.no_cleanup:
|
||||||
ip_var_test.pre_cleanup()
|
ip_var_test.pre_cleanup()
|
||||||
|
|
||||||
if ip_var_test.passes():
|
if ip_var_test.passes():
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ def main():
|
|||||||
ip_var_test.pre_cleanup()
|
ip_var_test.pre_cleanup()
|
||||||
ip_var_test.build()
|
ip_var_test.build()
|
||||||
|
|
||||||
# TODO: Do cleanup by default, allow --noclean option to skip cleanup.
|
# TODO: Do cleanup by default, allow --no_cleanup option to skip cleanup.
|
||||||
|
|
||||||
if ip_var_test.passes():
|
if ip_var_test.passes():
|
||||||
logger.info("Created %s stations and connections" % (num_sta))
|
logger.info("Created %s stations and connections" % (num_sta))
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ python3 ./layer4.py
|
|||||||
ip_var_test.cleanup()
|
ip_var_test.cleanup()
|
||||||
ip_var_test.build()
|
ip_var_test.build()
|
||||||
|
|
||||||
# TODO: Clean up by default, and add --noclean option to NOT do cleanup.
|
# TODO: Clean up by default, and add --no_cleanup option to NOT do cleanup.
|
||||||
|
|
||||||
if ip_var_test.passes():
|
if ip_var_test.passes():
|
||||||
ip_var_test.exit_success()
|
ip_var_test.exit_success()
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ Generic command layout:
|
|||||||
|
|
||||||
ip_test.build()
|
ip_test.build()
|
||||||
|
|
||||||
# TODO: Cleanup by default, add --noclean option to not do cleanup.
|
# TODO: Cleanup by default, add --no_cleanup option to not do cleanup.
|
||||||
|
|
||||||
if ip_test.passes():
|
if ip_test.passes():
|
||||||
print('Created %s MacVlan connections' % args.num_ports)
|
print('Created %s MacVlan connections' % args.num_ports)
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ def main():
|
|||||||
debug=args.debug)
|
debug=args.debug)
|
||||||
create_qvlan.build()
|
create_qvlan.build()
|
||||||
|
|
||||||
# TODO: Add code to clean up the stations built, unless --noclean is specified.
|
# TODO: Add code to clean up the stations built, unless --no_cleanup is specified.
|
||||||
|
|
||||||
if create_qvlan.passes():
|
if create_qvlan.passes():
|
||||||
logging.info('Created %s QVLAN stations' % args.num_ports)
|
logging.info('Created %s QVLAN stations' % args.num_ports)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ def main():
|
|||||||
|
|
||||||
create_station.build()
|
create_station.build()
|
||||||
|
|
||||||
# TODO: Add code to clean up the station, unless --noclean was specified.
|
# TODO: Add code to clean up the station, unless --no_cleanup was specified.
|
||||||
|
|
||||||
if create_station.passes():
|
if create_station.passes():
|
||||||
print('Created %s stations' % num_sta)
|
print('Created %s stations' % num_sta)
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ Command example:
|
|||||||
create_vap._fail("VAP %s was not created." % (vap))
|
create_vap._fail("VAP %s was not created." % (vap))
|
||||||
create_vaps.append(create_vap)
|
create_vaps.append(create_vap)
|
||||||
|
|
||||||
# TODO: Add logic to clean up vap, unless --noclean option is specified.
|
# TODO: Add logic to clean up vap, unless --no_cleanup option is specified.
|
||||||
# TODO: Set radio back to previous channel.
|
# TODO: Set radio back to previous channel.
|
||||||
|
|
||||||
any_failed = False
|
any_failed = False
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ def main():
|
|||||||
ip_test.timeout = 60
|
ip_test.timeout = 60
|
||||||
ip_test.build()
|
ip_test.build()
|
||||||
|
|
||||||
if not args.noclean:
|
if not args.no_cleanup:
|
||||||
sleep(5)
|
sleep(5)
|
||||||
ip_test.cleanup(station_list)
|
ip_test.cleanup(station_list)
|
||||||
|
|
||||||
|
|||||||
@@ -491,7 +491,6 @@ class StaConnect(Realm):
|
|||||||
def main():
|
def main():
|
||||||
parser = Realm.create_basic_argparse(
|
parser = Realm.create_basic_argparse(
|
||||||
prog="sta_connect.py",
|
prog="sta_connect.py",
|
||||||
formatter_class=argparse.RawTextHelpFormatter,
|
|
||||||
description="""LANforge Unit Test: Connect Station to AP
|
description="""LANforge Unit Test: Connect Station to AP
|
||||||
Example:
|
Example:
|
||||||
./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C
|
./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C
|
||||||
|
|||||||
Reference in New Issue
Block a user