Revision c9c33a28

b/test/ganeti.mcpu_unittest.py
34 34
import testutils
35 35

  
36 36

  
37
REQ_BGL_WHITELIST = frozenset([
38
  opcodes.OpClusterActivateMasterIp,
39
  opcodes.OpClusterDeactivateMasterIp,
40
  opcodes.OpClusterDestroy,
41
  opcodes.OpClusterPostInit,
42
  opcodes.OpClusterRename,
43
  opcodes.OpInstanceRename,
44
  opcodes.OpNodeAdd,
45
  opcodes.OpNodeRemove,
46
  opcodes.OpTestAllocator,
47
  ])
48

  
49

  
37 50
class TestLockAttemptTimeoutStrategy(unittest.TestCase):
38 51
  def testConstants(self):
39 52
    tpa = mcpu.LockAttemptTimeoutStrategy._TIMEOUT_PER_ATTEMPT
......
67 80
      self.assertTrue(opcls in mcpu.Processor.DISPATCH_TABLE,
68 81
                      msg="%s missing handler class" % opcls)
69 82

  
83
      # Check against BGL whitelist
84
      lucls = mcpu.Processor.DISPATCH_TABLE[opcls]
85
      if lucls.REQ_BGL:
86
        self.assertTrue(opcls in REQ_BGL_WHITELIST,
87
                        msg=("%s not whitelisted for BGL" % opcls.OP_ID))
88
      else:
89
        self.assertFalse(opcls in REQ_BGL_WHITELIST,
90
                         msg=("%s whitelisted for BGL, but doesn't use it" %
91
                              opcls.OP_ID))
92

  
70 93

  
71 94
if __name__ == "__main__":
72 95
  testutils.GanetiTestProgram()

Also available in: Unified diff