Revision e5c2accd
b/qa/ganeti-qa.py | ||
---|---|---|
199 | 199 |
RunTestIf("instance-reboot", qa_instance.TestInstanceReboot, instance) |
200 | 200 |
|
201 | 201 |
if qa_config.TestEnabled('instance-rename'): |
202 |
rename_source = instance["name"] |
|
202 | 203 |
rename_target = qa_config.get("rename", None) |
203 | 204 |
if rename_target is None: |
204 | 205 |
print qa_utils.FormatError("Can rename instance, 'rename' entry is" |
205 | 206 |
" missing from configuration") |
206 | 207 |
else: |
207 | 208 |
RunTest(qa_instance.TestInstanceShutdown, instance) |
208 |
RunTest(qa_instance.TestInstanceRename, instance, rename_target) |
|
209 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceRename, instance, rename_target) |
|
209 |
RunTest(qa_instance.TestInstanceRename, rename_source, rename_target) |
|
210 |
RunTest(qa_instance.TestInstanceRename, rename_target, rename_source) |
|
211 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceRename, rename_source, rename_target) |
|
212 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceRename, rename_target, rename_source) |
|
210 | 213 |
RunTest(qa_instance.TestInstanceStartup, instance) |
211 | 214 |
|
212 | 215 |
RunTestIf("tags", qa_tags.TestInstanceTags, instance) |
b/qa/qa_instance.py | ||
---|---|---|
133 | 133 |
_ReadSsconfInstanceList()) |
134 | 134 |
|
135 | 135 |
|
136 |
def TestInstanceRename(instance, rename_target):
|
|
136 |
def TestInstanceRename(rename_source, rename_target):
|
|
137 | 137 |
"""gnt-instance rename""" |
138 |
rename_source = instance['name'] |
|
139 |
|
|
140 |
for name1, name2 in [(rename_source, rename_target), |
|
141 |
(rename_target, rename_source)]: |
|
142 |
_CheckSsconfInstanceList(name1) |
|
143 |
AssertCommand(["gnt-instance", "rename", name1, name2]) |
|
144 |
_CheckSsconfInstanceList(name2) |
|
138 |
_CheckSsconfInstanceList(rename_source) |
|
139 |
AssertCommand(["gnt-instance", "rename", rename_source, rename_target]) |
|
140 |
_CheckSsconfInstanceList(rename_target) |
|
145 | 141 |
|
146 | 142 |
|
147 | 143 |
def TestInstanceFailover(instance): |
b/qa/qa_rapi.py | ||
---|---|---|
402 | 402 |
_WaitForRapiJob(_rapi_client.MigrateInstance(instance["name"])) |
403 | 403 |
|
404 | 404 |
|
405 |
def TestRapiInstanceRename(instance, rename_target):
|
|
405 |
def TestRapiInstanceRename(rename_source, rename_target):
|
|
406 | 406 |
"""Test renaming instance via RAPI""" |
407 |
rename_source = instance["name"] |
|
408 |
|
|
409 |
for name1, name2 in [(rename_source, rename_target), |
|
410 |
(rename_target, rename_source)]: |
|
411 |
_WaitForRapiJob(_rapi_client.RenameInstance(name1, name2)) |
|
407 |
_WaitForRapiJob(_rapi_client.RenameInstance(rename_source, rename_target)) |
|
412 | 408 |
|
413 | 409 |
|
414 | 410 |
def TestRapiInstanceModify(instance): |
Also available in: Unified diff