test_generic: Fix whitespace

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-11-24 16:21:49 -08:00
parent d096890df0
commit 0a3363f51b

View File

@@ -43,7 +43,6 @@ if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
@@ -73,7 +72,7 @@ class GenTest(LFCliBase):
self.name_prefix = name_prefix
self.test_duration = test_duration
self.debug = _debug_on
if (client is not None):
if client:
self.client_name = client
self.station_profile = self.local_realm.new_station_profile()
self.generic_endps_profile = self.local_realm.new_generic_endp_profile()
@@ -92,11 +91,11 @@ class GenTest(LFCliBase):
self.generic_endps_profile.interval = interval
self.generic_endps_profile.file_output = file_output
self.generic_endps_profile.loop_count = loop_count
if (speedtest_min_up is not None):
if speedtest_min_up is not None:
self.generic_endps_profile.speedtest_min_up = float(speedtest_min_up)
if (speedtest_min_dl is not None):
if speedtest_min_dl is not None:
self.generic_endps_profile.speedtest_min_dl = float(speedtest_min_dl)
if (speedtest_max_ping is not None):
if speedtest_max_ping is not None:
self.generic_endps_profile.speedtest_max_ping = float(speedtest_max_ping)
def check_tab_exists(self):
@@ -204,16 +203,21 @@ python3 ./test_generic.py
''',
more_optional=optional)
parser.add_argument('--type', help='type of command to run: generic, lfping, iperf3-client, iperf3-server, lfcurl', default="lfping")
parser.add_argument('--type', help='type of command to run: generic, lfping, iperf3-client, iperf3-server, lfcurl',
default="lfping")
parser.add_argument('--cmd', help='specifies command to be run by generic type endp', default='')
parser.add_argument('--dest', help='destination IP for command', default="10.40.0.1")
parser.add_argument('--test_duration', help='duration of the test eg: 30s, 2m, 4h', default="2m")
parser.add_argument('--interval', help='interval to use when running lfping (1s, 1m)', default=1)
parser.add_argument('--speedtest_min_up', help='sets the minimum upload threshold for the speedtest type', default=None)
parser.add_argument('--speedtest_min_dl', help='sets the minimum download threshold for the speedtest type', default=None)
parser.add_argument('--speedtest_max_ping', help='sets the minimum ping threshold for the speedtest type', default=None)
parser.add_argument('--speedtest_min_up', help='sets the minimum upload threshold for the speedtest type',
default=None)
parser.add_argument('--speedtest_min_dl', help='sets the minimum download threshold for the speedtest type',
default=None)
parser.add_argument('--speedtest_max_ping', help='sets the minimum ping threshold for the speedtest type',
default=None)
parser.add_argument('--client', help='client to the iperf3 server', default=None)
parser.add_argument('--file_output', help='location to output results of lf_curl, absolute path preferred', default=None)
parser.add_argument('--file_output', help='location to output results of lf_curl, absolute path preferred',
default=None)
parser.add_argument('--loop_count', help='determines the number of loops to use in lf_curl', default=None)
args = parser.parse_args()
@@ -313,7 +317,8 @@ python3 ./test_generic.py
try:
genconnections = ','.join([[*x.keys()][0] for x in generic_test.json_get('generic')['endpoints']])
except:
raise ValueError('1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port')
raise ValueError(
'1. Enable the generic tab in LANforge GUI , if still fails 2. Try setting the upstream port flag if your device does not have an eth1 port')
if type(args.gen_cols) is not list:
generic_cols = list(args.gen_cols.split(","))
@@ -335,7 +340,8 @@ python3 ./test_generic.py
try:
monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds()
except ValueError as error:
print(ValueError("The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. "))
print(ValueError(
"The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. "))
exit(1)
generic_test.start(False, False)
generic_test.generic_endps_profile.monitor(generic_cols=generic_cols,
@@ -359,6 +365,5 @@ python3 ./test_generic.py
generic_test.exit_success()
if __name__ == "__main__":
main()