Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
import unittest import unittest
from ganeti import mcpu from ganeti import mcpu
from ganeti import opcodes
import testutils import testutils
...@@ -54,5 +55,14 @@ class TestLockAttemptTimeoutStrategy(unittest.TestCase): ...@@ -54,5 +55,14 @@ class TestLockAttemptTimeoutStrategy(unittest.TestCase):
self.assert_(strat.NextAttempt() is None) 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__": if __name__ == "__main__":
testutils.GanetiTestProgram() testutils.GanetiTestProgram()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment