From 5d3bd979a706284fa409dc87b48e00b54ec1423d Mon Sep 17 00:00:00 2001 From: Rod Smith Date: Fri, 11 Sep 2015 16:57:54 -0400 Subject: Moved check for --iperf3 and --cpu-load-fail-threshold conformity earlier and changed to dashes in --cpu-load-fail-threshold, as per Jeff's suggestions --- bin/network | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/network b/bin/network index cfa4c5f..0c41dc1 100755 --- a/bin/network +++ b/bin/network @@ -78,10 +78,6 @@ class IPerfPerformanceTest(object): (self.iface.link_speed, self.iface.max_speed)) logging.error("Check your device configuration and try again") return 1 - if self.cpu_load_fail_threshold != 100 and not self.iperf3: - logging.warn("CPU load failure threshold set without the " - "--iperf3 option!") - logging.warn("CPU load testing will not be done!") # Because we can vary the data size, we need to vary the timeout as # well. It takes an estimated 15 minutes to send 1GB over 10Mb/s. @@ -558,7 +554,7 @@ TEST_TARGET_IPERF = iperf-server.example.com "theoretical bandwidth) as a number like 80. (Default is " "%(default)s)")) test_parser.add_argument( - '--cpu_load_fail_threshold', type=int, + '--cpu-load-fail-threshold', type=int, default=100, help=("(IPERF Test ONLY and meaningful ONLY with --iperf3. Set the " "failure threshold (above which the CPU load must not rise) as " @@ -601,6 +597,8 @@ TEST_TARGET_IPERF = iperf-server.example.com info_parser.set_defaults(func=interface_info) args = parser.parse_args() + if args.cpu_load_fail_threshold != 100 and not args.iperf3: + parser.error('--cpu-load-fail-threshold can only be set with --iperf3.') if args.debug: logging.basicConfig(level=logging.DEBUG) -- cgit v1.2.3