KVM-test: Convert drift to absolute value when comparing with threshold
PATCH 1/1 KVM-test: Convert drift to absolute value when comparing with threshold
If drift is a large negative, it couldn't raise exception.
Signed-off-by Amos Kong <[email protected]>
--- client/tests/kvm/tests/timedrift.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
client/tests/kvm/tests/timedrift.py +2 -2
@@ -166,8 +166,8 @@ def run_timedrift(test, params, env): logging.info("Total drift after rest: %.2f%%" % drift_total) # Fail the test if necessary - if drift > drift_threshold: + if abs(drift) > drift_threshold: raise error.TestFail("Time drift too large: %.2f%%" % drift) - if drift_total > drift_threshold_after_rest: + if abs(drift_total) > drift_threshold_after_rest: raise error.TestFail("Time drift too large after rest period: %.2f%%" % drift_total)
Signature · 1 line
1.5.6.5
Lucas Meneghel Rodrigues
AppliedQuoted 1 line · Amos Kong
If drift is a large negative, it couldn't raise exception.
Applied, thanks!
Quoted 28 lines
Signed-off-by Amos Kong <[email protected]>---
client/tests/kvm/tests/timedrift.py | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)client/tests/kvm/tests/timedrift.py +2
-2@@ -166,8 +166,8 @@ def run_timedrift(test, params, env): logging.info("Total drift after rest: %.2f%%" % drift_total) # Fail the test if necessary - if drift > drift_threshold: + if abs(drift) > drift_threshold: raise error.TestFail("Time drift too large: %.2f%%" % drift) - if drift_total > drift_threshold_after_rest: + if abs(drift_total) > drift_threshold_after_rest:raise
error.TestFail("Time drift too large after rest period: %.2f%%" % drift_total)
--
1.5.6.5_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Signature · 1 line
Lucas