From 302424e71a4a65b4ffddf2de9bf7fa88b28e9e92 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 14 May 2012 11:33:04 +0200
Subject: [PATCH] Make x509 unittest testClockSkew a bit less flaky
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since the tested function actually uses time.time(), it cannot be make
fully stable, but 1 second is very dangerous; let's just test SKEW * 2
and higher since that should be good (if the delta between _GenCert
and VerifyX509Certificate is 5 minutes, then…).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 test/ganeti.utils.x509_unittest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/ganeti.utils.x509_unittest.py b/test/ganeti.utils.x509_unittest.py
index 40425d214..007dca8e2 100755
--- a/test/ganeti.utils.x509_unittest.py
+++ b/test/ganeti.utils.x509_unittest.py
@@ -195,7 +195,7 @@ class TestCertVerification(testutils.GanetiTestCase):
       self.assertEqual(result, (None, None))
 
     # skew too great, not accepting certs
-    for before in [SKEW + 1, SKEW * 2, SKEW * 10]:
+    for before in [SKEW * 2, SKEW * 10]:
       cert = self._GenCert(key, before, validity)
       (status, msg) = utils.VerifyX509Certificate(cert, 1, 2)
       self.assertEqual(status, utils.CERT_WARNING)
-- 
GitLab