From 9404c451e206a57c0d31ddacf52a19640ac9e681 Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Wed, 24 Aug 2016 15:30:15 -0400 Subject: Slope error Test and fix for error in slope STORPERF-74 Change-Id: I17a8e0e1e588deb875ecace85290f92167df1d5e Signed-off-by: Mark Beierl (cherry picked from commit 8e3587493d685745e08c97e25ec8b2b3a7bd3a00) --- storperf/utilities/steady_state.py | 4 ++-- tests/utilities_tests/steady_state_test.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/storperf/utilities/steady_state.py b/storperf/utilities/steady_state.py index 8bfcb93..233bc78 100644 --- a/storperf/utilities/steady_state.py +++ b/storperf/utilities/steady_state.py @@ -34,8 +34,8 @@ def steady_state(data_series): average_value is not None): # Verification of the Steady State conditions following the SNIA # definition - range_condition = range_value < 0.20 * abs(average_value) - slope_condition = slope_value < 0.10 * abs(average_value) + range_condition = abs(range_value) < 0.20 * abs(average_value) + slope_condition = abs(slope_value) < 0.10 * abs(average_value) steady_state = range_condition and slope_condition diff --git a/tests/utilities_tests/steady_state_test.py b/tests/utilities_tests/steady_state_test.py index d80c60d..564c090 100644 --- a/tests/utilities_tests/steady_state_test.py +++ b/tests/utilities_tests/steady_state_test.py @@ -57,3 +57,9 @@ class SteadyStateTest(unittest.TestCase): data_series = [[-15, 0.43], [-16, 0.41], [-3, 0.45], [4, 0.42]] actual = SteadyState.steady_state(data_series) self.assertEqual(expected, actual) + + def test_negative_slope(self): + expected = False + data_series = [[1.3, 1], [1.2, 1], [1.1, 1.1], [1.0, 1.1]] + actual = SteadyState.steady_state(data_series) + self.assertEqual(expected, actual) -- cgit 1.2.3-korg