from ganeti import constants
+import testutils
+
class TestConstants(unittest.TestCase):
"""Constants tests"""
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"""
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()
if __name__ == '__main__':
- unittest.main()
+ testutils.GanetiTestProgram()