Commit f879621b authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Make QA fail if KVM hotplugging fails

Unlike almost all other modification commands, hotplugging a device and
failing does not result in an error code showing that the operation was
unsuccessful. Because of this, the QA ignored hotplugging failures. To
fix this, this patch makes the QA examine the output of the command for
signs of failure.
Signed-off-by: default avatarHrvoje Ribicic <>
Reviewed-by: default avatarKlaus Aehlig <>
parent 011a8e8f
...@@ -500,6 +500,25 @@ def TestInstanceInfo(instance): ...@@ -500,6 +500,25 @@ def TestInstanceInfo(instance):
AssertCommand(["gnt-instance", "info",]) AssertCommand(["gnt-instance", "info",])
def _TestKVMHotplug(instance):
"""Tests hotplug modification commands, noting that they
args_to_try = [
["--net", "-1:add", "--hotplug"],
["--net", "-1:modify,mac=aa:bb:cc:dd:ee:ff", "--hotplug", "--force"],
["--net", "-1:remove", "--hotplug"],
["--disk", "-1:add,size=1G", "--hotplug"],
["--disk", "-1:remove", "--hotplug"],
for alist in args_to_try:
_, stdout, stderr = \
AssertCommand(["gnt-instance", "modify"] + alist + [])
if "failed" in stdout or "failed" in stderr:
raise qa_error.Error("Hotplugging command failed; please check output"
" for further information")
def TestInstanceModify(instance): def TestInstanceModify(instance):
"""gnt-instance modify""" """gnt-instance modify"""
...@@ -545,13 +564,7 @@ def TestInstanceModify(instance): ...@@ -545,13 +564,7 @@ def TestInstanceModify(instance):
]) ])
elif default_hv == constants.HT_KVM and \ elif default_hv == constants.HT_KVM and \
qa_config.TestEnabled("instance-device-hotplug"): qa_config.TestEnabled("instance-device-hotplug"):
args.extend([ _TestKVMHotplug(instance)
["--net", "-1:add", "--hotplug"],
["--net", "-1:modify,mac=aa:bb:cc:dd:ee:ff", "--hotplug", "--force"],
["--net", "-1:remove", "--hotplug"],
["--disk", "-1:add,size=1G", "--hotplug"],
["--disk", "-1:remove", "--hotplug"],
for alist in args: for alist in args:
AssertCommand(["gnt-instance", "modify"] + alist + []) AssertCommand(["gnt-instance", "modify"] + alist + [])
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