Commit 37889387 authored by Klaus Aehlig's avatar Klaus Aehlig

QA: Factor out the list of available instance test

The knowledge about which instance creating tests are
available is best kept in the module on istances. Moreover,
it is not only used by RunInstanceTests, but will
also be needed by the upgrade test.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 4dbc4c85
......@@ -703,20 +703,9 @@ def IsExclusiveStorageInstanceTestEnabled():
def RunInstanceTests():
"""Create and exercise instances."""
instance_tests = [
("instance-add-plain-disk", constants.DT_PLAIN,
qa_instance.TestInstanceAddWithPlainDisk, 1),
("instance-add-drbd-disk", constants.DT_DRBD8,
qa_instance.TestInstanceAddWithDrbdDisk, 2),
("instance-add-diskless", constants.DT_DISKLESS,
qa_instance.TestInstanceAddDiskless, 1),
("instance-add-file", constants.DT_FILE,
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:
for (test_name, templ, create_fun, num_nodes) in \
qa_instance.available_instance_tests:
if (qa_config.TestEnabled(test_name) and
qa_config.IsTemplateSupported(templ)):
inodes = qa_config.AcquireManyNodes(num_nodes)
......
......@@ -1084,3 +1084,16 @@ def TestInstanceCreationRestrictedByDiskTemplates():
"--ipolicy-disk-templates=%s" %
",".join(enabled_disk_templates)],
fail=False)
available_instance_tests = [
("instance-add-plain-disk", constants.DT_PLAIN,
TestInstanceAddWithPlainDisk, 1),
("instance-add-drbd-disk", constants.DT_DRBD8,
TestInstanceAddWithDrbdDisk, 2),
("instance-add-diskless", constants.DT_DISKLESS,
TestInstanceAddDiskless, 1),
("instance-add-file", constants.DT_FILE,
TestInstanceAddFile, 1),
("instance-add-shared-file", constants.DT_SHARED_FILE,
TestInstanceAddSharedFile, 1),
]
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