Commit 0b6c56bb authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Unit tests for constants consistency



This patch adds some unit tests to ensure the consistency
of various constants regarding disk templates.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 615551b2
......@@ -156,6 +156,17 @@ class TestConfdConstants(unittest.TestCase):
self.assertFalse(utils.FindDuplicates(constants.CONFD_REPL_STATUSES),
msg="Duplicated confd reply status code")
class TestDiskTemplateConstants(unittest.TestCase):
def testPreference(self):
self.assertEqual(set(constants.DISK_TEMPLATE_PREFERENCE),
set(constants.DISK_TEMPLATES))
def testMapToStorageTypes(self):
for disk_template in constants.DISK_TEMPLATES:
self.assertTrue(
constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[disk_template] is not None)
if __name__ == "__main__":
testutils.GanetiTestProgram()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment