Revision d101b7be
b/qa/qa_cluster.py | ||
---|---|---|
425 | 425 |
other tests. |
426 | 426 |
|
427 | 427 |
""" |
428 |
vgname = qa_config.get("vg-name", constants.DEFAULT_VG) |
|
429 |
AssertCommand( |
|
430 |
["gnt-cluster", "modify", |
|
431 |
"--enabled-disk-templates=%s" % |
|
432 |
",".join(qa_config.GetEnabledDiskTemplates()), |
|
433 |
"--vg-name=%s" % vgname], |
|
434 |
fail=False) |
|
428 |
cmd = ["gnt-cluster", "modify", "--enabled-disk-templates=%s" % |
|
429 |
",".join(qa_config.GetEnabledDiskTemplates())] |
|
430 |
|
|
431 |
if utils.IsLvmEnabled(qa_config.GetEnabledDiskTemplates()): |
|
432 |
vgname = qa_config.get("vg-name", constants.DEFAULT_VG) |
|
433 |
cmd.append("--vg-name=%s" % vgname) |
|
434 |
|
|
435 |
AssertCommand(cmd, fail=False) |
|
435 | 436 |
|
436 | 437 |
|
437 | 438 |
def _TestClusterModifyDiskTemplatesArguments(default_disk_template, |
... | ... | |
568 | 569 |
new_disk_templates = list(set(enabled_disk_templates) |
569 | 570 |
- set([instance_template])) |
570 | 571 |
if not new_disk_templates: |
571 |
new_disk_templates = list(set(constants.DISK_TEMPLATES)
|
|
572 |
new_disk_templates = list(set([constants.DT_DISKLESS, constants.DT_BLOCK])
|
|
572 | 573 |
- set([instance_template])) |
573 | 574 |
AssertCommand( |
574 | 575 |
["gnt-cluster", "modify", |
... | ... | |
580 | 581 |
def _TestClusterModifyUnusedDiskTemplate(instance_template): |
581 | 582 |
"""Tests that unused disk templates can be disabled safely.""" |
582 | 583 |
all_disk_templates = constants.DISK_TEMPLATES |
584 |
if not utils.IsLvmEnabled(qa_config.GetEnabledDiskTemplates()): |
|
585 |
all_disk_templates = list(set(all_disk_templates) - |
|
586 |
set(utils.GetLvmDiskTemplates())) |
|
587 |
|
|
583 | 588 |
AssertCommand( |
584 | 589 |
["gnt-cluster", "modify", |
585 | 590 |
"--enabled-disk-templates=%s" % |
b/qa/qa_instance.py | ||
---|---|---|
1047 | 1047 |
CreateInstanceByDiskTemplate(nodes, disk_template, fail=True) |
1048 | 1048 |
elif (len(enabled_disk_templates) == 1): |
1049 | 1049 |
# If only one disk template is enabled in the QA config, we have to enable |
1050 |
# some of the disabled disk templates in order to test if the disabling the |
|
1051 |
# only enabled disk template prohibits creating instances of that template. |
|
1050 |
# some other templates in order to test if the disabling the only enabled |
|
1051 |
# disk template prohibits creating instances of that template. |
|
1052 |
other_disk_templates = list( |
|
1053 |
set([constants.DT_DISKLESS, constants.DT_BLOCK]) - |
|
1054 |
set(enabled_disk_templates)) |
|
1052 | 1055 |
AssertCommand(["gnt-cluster", "modify", |
1053 | 1056 |
"--enabled-disk-template=%s" % |
1054 |
",".join(disabled_disk_templates)],
|
|
1057 |
",".join(other_disk_templates)],
|
|
1055 | 1058 |
fail=False) |
1056 | 1059 |
CreateInstanceByDiskTemplate(nodes, enabled_disk_templates[0], fail=True) |
1057 | 1060 |
else: |
Also available in: Unified diff