Revision 8cd4f8cf qa/qa_instance.py

b/qa/qa_instance.py
263 263
  return templ == constants.DT_DRBD8
264 264

  
265 265

  
266
def IsDiskSupported(instance):
267
  templ = qa_config.GetInstanceTemplate(instance)
268
  return templ != constants.DT_DISKLESS
269

  
270

  
266 271
def TestInstanceAddWithPlainDisk(nodes, fail=False):
267 272
  """gnt-instance add -t plain"""
268 273
  assert len(nodes) == 1
......
586 591
                 "-n", inodes[1]["primary"], name])
587 592

  
588 593

  
594
@InstanceCheck(INST_UP, INST_UP, FIRST_ARG)
595
def TestInstanceModifyDisks(instance):
596
  """gnt-instance modify --disk"""
597
  if not IsDiskSupported(instance):
598
    print qa_utils.FormatInfo("Instance doesn't support disks, skipping test")
599
    return
600

  
601
  size = qa_config.get("disk")[-1]
602
  name = instance["name"]
603
  build_cmd = lambda arg: ["gnt-instance", "modify", "--disk", arg, name]
604
  AssertCommand(build_cmd("add:size=%s" % size))
605
  AssertCommand(build_cmd("remove"))
606

  
607

  
589 608
@InstanceCheck(INST_DOWN, INST_DOWN, FIRST_ARG)
590 609
def TestInstanceGrowDisk(instance):
591 610
  """gnt-instance grow-disk"""

Also available in: Unified diff