import/export: Validate remote host/port
[ganeti-local] / test / ganeti.constants_unittest.py
index ddc6814..f21c99d 100755 (executable)
@@ -27,6 +27,8 @@ import re
 
 from ganeti import constants
 
+import testutils
+
 
 class TestConstants(unittest.TestCase):
   """Constants tests"""
@@ -58,6 +60,14 @@ class TestConstants(unittest.TestCase):
     self.failUnless(constants.LDS_OKAY < constants.LDS_UNKNOWN)
     self.failUnless(constants.LDS_UNKNOWN < constants.LDS_FAULTY)
 
+  def testClockSkew(self):
+    self.failUnless(constants.NODE_MAX_CLOCK_SKEW <
+                    (0.8 * constants.CONFD_MAX_CLOCK_SKEW))
+
+  def testSslCertExpiration(self):
+    self.failUnless(constants.SSL_CERT_EXPIRATION_ERROR <
+                    constants.SSL_CERT_EXPIRATION_WARN)
+
 
 class TestParameterNames(unittest.TestCase):
   """HV/BE parameter tests"""
@@ -79,7 +89,7 @@ class TestConfdConstants(unittest.TestCase):
 
   def testFourCc(self):
     self.failUnlessEqual(len(constants.CONFD_MAGIC_FOURCC), 4,
-                    "Invalid fourcc len, should be 4")
+                         "Invalid fourcc len, should be 4")
 
   def _IsUniqueSequence(self, sequence):
     seen = set()
@@ -99,4 +109,4 @@ class TestConfdConstants(unittest.TestCase):
 
 
 if __name__ == '__main__':
-  unittest.main()
+  testutils.GanetiTestProgram()