diff --git a/CHANGES b/CHANGES index 94afc578..ee2be870 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2012-12-10: Fix spurious error when running netperf-wrapper with a test name + that is also an existing file name (that is, make the error message + intelligible). + 2012-12-09: Automatically switch CDF plots to log scale if the median values differ by more than an order of magnitude. diff --git a/netperf_wrapper/formatters.py b/netperf_wrapper/formatters.py index dc8a61ae..a30ce843 100644 --- a/netperf_wrapper/formatters.py +++ b/netperf_wrapper/formatters.py @@ -339,7 +339,9 @@ def _do_cdf_plot(self, results, config=None, axis=None, postfix=""): # More than an order of magnitude difference; switch to log scale axis.set_xscale('log') min_val = min(self.min_vals) - axis.set_xlim(left=min_val-min_val%10) # nearest value divisible by 10 + if min_val > 10: + min_val -= min_val%10 # nearest value divisible by 10 + axis.set_xlim(left=min_val) def _do_meta_plot(self, results, postfix=""): for i,config in enumerate(self.configs): diff --git a/netperf_wrapper/settings.py b/netperf_wrapper/settings.py index 24e9036b..88e67064 100644 --- a/netperf_wrapper/settings.py +++ b/netperf_wrapper/settings.py @@ -175,7 +175,10 @@ def load_test(self, test_name): self.HOST = self.HOSTS[0] test_env = TestEnvironment(self.__dict__) - s = test_env.execute(os.path.join(TEST_PATH, test_name + ".conf")) + filename = os.path.join(TEST_PATH, test_name + ".conf") + if not os.path.exists(filename): + raise RuntimeError("No config file found for test '%s'" % test_name) + s = test_env.execute(filename) for k,v in list(s.items()): if k == k.upper(): @@ -230,9 +233,6 @@ def load(): test_name = args[0] - if os.path.exists(test_name): - test_name = os.path.splitext(os.path.basename(test_file))[0] - settings.load_test(test_name) results = [ResultSet(NAME=settings.NAME, HOST=settings.HOST,