Revision 5de31440 qa/qa_instance.py
b/qa/qa_instance.py | ||
---|---|---|
161 | 161 |
" %s" % (field, instance, info_out)) |
162 | 162 |
|
163 | 163 |
|
164 |
def IsFailoverSupported(instance): |
|
165 |
templ = qa_config.GetInstanceTemplate(instance) |
|
166 |
return templ in constants.DTS_MIRRORED |
|
167 |
|
|
168 |
|
|
169 |
def IsMigrationSupported(instance): |
|
170 |
templ = qa_config.GetInstanceTemplate(instance) |
|
171 |
return templ in constants.DTS_MIRRORED |
|
172 |
|
|
173 |
|
|
174 |
def IsDiskReplacingSupported(instance): |
|
175 |
templ = qa_config.GetInstanceTemplate(instance) |
|
176 |
return templ == constants.DT_DRBD8 |
|
177 |
|
|
178 |
|
|
164 | 179 |
@InstanceCheck(None, INST_UP, RETURN_VALUE) |
165 | 180 |
def TestInstanceAddWithPlainDisk(node): |
166 | 181 |
"""gnt-instance add -t plain""" |
... | ... | |
302 | 317 |
@InstanceCheck(INST_UP, INST_UP, FIRST_ARG) |
303 | 318 |
def TestInstanceFailover(instance): |
304 | 319 |
"""gnt-instance failover""" |
320 |
if not IsFailoverSupported(instance): |
|
321 |
print qa_utils.FormatInfo("Instance doesn't support failover, skipping" |
|
322 |
" test") |
|
323 |
return |
|
324 |
|
|
305 | 325 |
cmd = ["gnt-instance", "failover", "--force", instance["name"]] |
306 | 326 |
|
307 | 327 |
# failover ... |
... | ... | |
315 | 335 |
@InstanceCheck(INST_UP, INST_UP, FIRST_ARG) |
316 | 336 |
def TestInstanceMigrate(instance, toggle_always_failover=True): |
317 | 337 |
"""gnt-instance migrate""" |
338 |
if not IsMigrationSupported(instance): |
|
339 |
print qa_utils.FormatInfo("Instance doesn't support migration, skipping" |
|
340 |
" test") |
|
341 |
return |
|
342 |
|
|
318 | 343 |
cmd = ["gnt-instance", "migrate", "--force", instance["name"]] |
319 | 344 |
af_par = constants.BE_ALWAYS_FAILOVER |
320 | 345 |
af_field = "be/" + constants.BE_ALWAYS_FAILOVER |
... | ... | |
459 | 484 |
def TestInstanceConvertDisk(instance, snode): |
460 | 485 |
"""gnt-instance modify -t""" |
461 | 486 |
name = instance["name"] |
487 |
template = qa_config.GetInstanceTemplate(instance) |
|
488 |
if template != "drbd": |
|
489 |
print qa_utils.FormatInfo("Unsupported template %s, skipping conversion" |
|
490 |
" test" % template) |
|
491 |
return |
|
462 | 492 |
AssertCommand(["gnt-instance", "modify", "-t", "plain", name]) |
463 | 493 |
AssertCommand(["gnt-instance", "modify", "-t", "drbd", |
464 | 494 |
"-n", snode["primary"], name]) |
... | ... | |
467 | 497 |
@InstanceCheck(INST_DOWN, INST_DOWN, FIRST_ARG) |
468 | 498 |
def TestInstanceGrowDisk(instance): |
469 | 499 |
"""gnt-instance grow-disk""" |
500 |
if qa_config.GetExclusiveStorage(): |
|
501 |
print qa_utils.FormatInfo("Test not supported with exclusive_storage") |
|
502 |
return |
|
470 | 503 |
name = instance["name"] |
471 | 504 |
all_size = qa_config.get("disk") |
472 | 505 |
all_grow = qa_config.get("disk-growth") |
... | ... | |
515 | 548 |
cmd.append(instance["name"]) |
516 | 549 |
return cmd |
517 | 550 |
|
551 |
if not IsDiskReplacingSupported(instance): |
|
552 |
print qa_utils.FormatInfo("Instance doesn't support disk replacing," |
|
553 |
" skipping test") |
|
554 |
return |
|
555 |
|
|
518 | 556 |
options = qa_config.get("options", {}) |
519 | 557 |
use_ialloc = options.get("use-iallocators", True) |
520 | 558 |
for data in [ |
Also available in: Unified diff