Revision a08e181f test/py/qa.qa_config_unittest.py

b/test/py/qa.qa_config_unittest.py
252 252
    self.assertEqual(self.config.GetMasterNode(), self.config["nodes"][0])
253 253

  
254 254

  
255
class TestQaConfig(unittest.TestCase):
256
  def setUp(self):
257
    filename = \
258
      testutils.TestDataFilename("qa-minimal-nodes-instances-only.json")
259

  
260
    self.config = qa_config._QaConfig.Load(filename)
261

  
262
  def testExclusiveStorage(self):
263
    self.assertRaises(AssertionError, self.config.GetExclusiveStorage)
264

  
265
    for value in [False, True, 0, 1, 30804, ""]:
266
      self.config.SetExclusiveStorage(value)
267
      self.assertEqual(self.config.GetExclusiveStorage(), bool(value))
268

  
269
      for template in constants.DISK_TEMPLATES:
270
        if value and template not in constants.DTS_EXCL_STORAGE:
271
          self.assertFalse(self.config.IsTemplateSupported(template))
272
        else:
273
          self.assertTrue(self.config.IsTemplateSupported(template))
274

  
275

  
255 276
if __name__ == "__main__":
256 277
  testutils.GanetiTestProgram()

Also available in: Unified diff