Commit 8cd4f8cf authored by Bernardo Dal Seno's avatar Bernardo Dal Seno

Add QA for gnt-instance modify --disk

Just a very basic test that adds and then removes a disk.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 1f14b07e
......@@ -567,6 +567,8 @@ def RunInstanceTests():
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceConvertDiskToPlain, instance, inodes)
RunTest(qa_instance.TestInstanceStartup, instance)
RunTestIf("instance-modify-disks", qa_instance.TestInstanceModifyDisks,
instance)
RunCommonInstanceTests(instance)
RunGroupListTests()
RunExportImportTests(instance, inodes)
......
......@@ -155,6 +155,7 @@
"instance-list": true,
"instance-migrate": true,
"instance-modify": true,
"instance-modify-disks": false,
"instance-reboot": true,
"instance-reinstall": true,
"instance-rename": true,
......
......@@ -263,6 +263,11 @@ def IsDiskReplacingSupported(instance):
return templ == constants.DT_DRBD8
def IsDiskSupported(instance):
templ = qa_config.GetInstanceTemplate(instance)
return templ != constants.DT_DISKLESS
def TestInstanceAddWithPlainDisk(nodes, fail=False):
"""gnt-instance add -t plain"""
assert len(nodes) == 1
......@@ -586,6 +591,20 @@ def TestInstanceConvertDiskToPlain(instance, inodes):
"-n", inodes[1]["primary"], name])
@InstanceCheck(INST_UP, INST_UP, FIRST_ARG)
def TestInstanceModifyDisks(instance):
"""gnt-instance modify --disk"""
if not IsDiskSupported(instance):
print qa_utils.FormatInfo("Instance doesn't support disks, skipping test")
return
size = qa_config.get("disk")[-1]
name = instance["name"]
build_cmd = lambda arg: ["gnt-instance", "modify", "--disk", arg, name]
AssertCommand(build_cmd("add:size=%s" % size))
AssertCommand(build_cmd("remove"))
@InstanceCheck(INST_DOWN, INST_DOWN, FIRST_ARG)
def TestInstanceGrowDisk(instance):
"""gnt-instance grow-disk"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment