Revision 26a5056d

b/qa/ganeti-qa.py
252 252
  RunTestIf(["instance-console", "rapi"],
253 253
            qa_rapi.TestRapiInstanceConsole, instance)
254 254

  
255
  DOWN_TESTS = ["instance-reinstall", "instance-rename"]
255
  DOWN_TESTS = ["instance-reinstall", "instance-rename", "instance-grow-disk"]
256 256
  # shutdown instance for any 'down' tests
257 257
  RunTestIf(DOWN_TESTS, qa_instance.TestInstanceShutdown, instance)
258 258

  
......
280 280
      RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack,
281 281
                rename_source, rename_target)
282 282

  
283
  RunTestIf(["instance-grow-disk"], qa_instance.TestInstanceGrowDisk, instance)
284

  
283 285
  # and now start the instance again
284 286
  RunTestIf(DOWN_TESTS, qa_instance.TestInstanceStartup, instance)
285 287

  
b/qa/qa-sample.json
106 106

  
107 107
    "instance-export": true,
108 108
    "instance-failover": true,
109
    "instance-grow-disk": true,
109 110
    "instance-import": true,
110 111
    "instance-info": true,
111 112
    "instance-list": true,
b/qa/qa_instance.py
279 279
                 "-n", snode["primary"], name])
280 280

  
281 281

  
282
def TestInstanceGrowDisk(instance):
283
  """gnt-instance grow-disk"""
284
  name = instance["name"]
285
  all_size = qa_config.get("disk")
286
  all_grow = qa_config.get("disk-growth")
287
  if not all_grow:
288
    # missing disk sizes but instance grow disk has been enabled,
289
    # let's set fixed/nomimal growth
290
    all_grow = ["128M" for _ in all_size]
291
  for idx, (size, grow) in enumerate(zip(all_size, all_grow)):
292
    # succeed in grow by amount
293
    AssertCommand(["gnt-instance", "grow-disk", name, str(idx), grow])
294
    # fail in grow to the old size
295
    AssertCommand(["gnt-instance", "grow-disk", "--absolute", name, str(idx),
296
                   size], fail=True)
297
    # succeed to grow to old size + 2 * growth
298
    int_size = utils.ParseUnit(size)
299
    int_grow = utils.ParseUnit(grow)
300
    AssertCommand(["gnt-instance", "grow-disk", "--absolute", name, str(idx),
301
                   str(int_size + 2 * int_grow)])
302

  
303

  
282 304
def TestInstanceList():
283 305
  """gnt-instance list"""
284 306
  qa_utils.GenericQueryTest("gnt-instance", query.INSTANCE_FIELDS.keys())

Also available in: Unified diff