Commit 0a31dda0 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add consistency test for mcpu dispatch table


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 18e63b75
......@@ -25,6 +25,7 @@
import unittest
from ganeti import mcpu
from ganeti import opcodes
import testutils
......@@ -54,5 +55,14 @@ class TestLockAttemptTimeoutStrategy(unittest.TestCase):
self.assert_(strat.NextAttempt() is None)
class TestDispatchTable(unittest.TestCase):
def test(self):
for opcls in opcodes.OP_MAPPING.values():
if opcls is opcodes.OpCode or opcls is opcodes.OpTestDummy:
continue
self.assert_(opcls in mcpu.Processor.DISPATCH_TABLE,
msg="%s missing handler class" % opcls)
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