From patchwork Tue Dec 29 09:27:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 70093 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBT9Kqaf001826 for ; Tue, 29 Dec 2009 09:20:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703AbZL2JUu (ORCPT ); Tue, 29 Dec 2009 04:20:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752694AbZL2JUu (ORCPT ); Tue, 29 Dec 2009 04:20:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51816 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbZL2JUt (ORCPT ); Tue, 29 Dec 2009 04:20:49 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBT9Kl5F016616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Dec 2009 04:20:47 -0500 Received: from localhost.localdomain ([10.66.91.190]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBT9KYEL010079; Tue, 29 Dec 2009 04:20:43 -0500 From: Amos Kong To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Amos Kong Subject: [AUTOTEST PATCH] KVM-test: Convert drift to absolute value when comparing with threshold Date: Tue, 29 Dec 2009 17:27:04 +0800 Message-Id: <1262078824-1680-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py index 146fa12..0a211f5 100644 --- a/client/tests/kvm/tests/timedrift.py +++ b/client/tests/kvm/tests/timedrift.py @@ -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)