Commit f9b76ed4 authored by Helga Velroyen's avatar Helga Velroyen

Prepare QA for shared file storage

This prepares the QA for running tests regarding
shared file storage.
Signed-off-by: default avatarHelga Velroyen <>
Reviewed-by: default avatarThomas Thrainer <>
parent ffde7fb6
......@@ -408,7 +408,8 @@ def RunExportImportTests(instance, inodes):
# based storage types are untested, though. Also note that import could still
# work, but is deeply embedded into the "export" case.
if (qa_config.TestEnabled("instance-export") and
instance.disk_template != constants.DT_FILE):
instance.disk_template not in [constants.DT_FILE,
RunTest(qa_instance.TestInstanceExportNoTarget, instance)
pnode = inodes[0]
......@@ -707,7 +708,9 @@ def RunInstanceTests():
("instance-add-diskless", constants.DT_DISKLESS,
qa_instance.TestInstanceAddDiskless, 1),
("instance-add-file", constants.DT_FILE,
qa_instance.TestInstanceAddFile, 1)
qa_instance.TestInstanceAddFile, 1),
("instance-add-shared-file", constants.DT_SHARED_FILE,
qa_instance.TestInstanceAddSharedFile, 1),
for (test_name, templ, create_fun, num_nodes) in instance_tests:
......@@ -195,6 +195,7 @@
"instance-add-plain-disk": true,
"instance-add-file": true,
"instance-add-shared-file": true,
"instance-add-drbd-disk": true,
"instance-add-diskless": true,
"instance-add-restricted-by-disktemplates": true,
......@@ -276,6 +276,14 @@ def TestInstanceAddFile(nodes):
return CreateInstanceByDiskTemplateOneNode(nodes, constants.DT_FILE)
@InstanceCheck(None, INST_UP, RETURN_VALUE)
def TestInstanceAddSharedFile(nodes):
"""gnt-instance add -t sharedfile"""
assert len(nodes) == 1
if constants.DT_SHARED_FILE in qa_config.GetEnabledDiskTemplates():
return CreateInstanceByDiskTemplateOneNode(nodes, constants.DT_SHARED_FILE)
@InstanceCheck(None, INST_UP, RETURN_VALUE)
def TestInstanceAddDiskless(nodes):
"""gnt-instance add -t diskless"""
......@@ -915,6 +923,9 @@ def TestRecreateDisks(instance, inodes, othernodes):
def TestInstanceExport(instance, node):
"""gnt-backup export -n ..."""
name =
# Export does not work for file-based templates, thus we skip the test
if instance.disk_template in [constants.DT_FILE, constants.DT_SHARED_FILE]:
AssertCommand(["gnt-backup", "export", "-n", node.primary, name])
return qa_utils.ResolveInstanceName(name)
......@@ -936,6 +947,8 @@ def TestInstanceExportNoTarget(instance):
def TestInstanceImport(newinst, node, expnode, name):
"""gnt-backup import"""
templ = constants.DT_PLAIN
if not qa_config.IsTemplateSupported(templ):
cmd = (["gnt-backup", "import",
"--disk-template=%s" % templ,
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