Commit 1ba25bad authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix QA for --offline semantics modification

The previous patch series made it simpler to deal with ERROR_up offline
instances, but didn't fix qa, that had the old expectations. This fixes
that, and adds more testing about the expected behavior.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent ff0c9604
......@@ -422,9 +422,12 @@ def TestInstanceModify(instance):
# check no-modify
AssertCommand(["gnt-instance", "modify", instance["name"]], fail=True)
# Marking offline/online while instance is running must fail
for arg in ["--online", "--offline"]:
AssertCommand(["gnt-instance", "modify", arg, instance["name"]], fail=True)
# Marking offline while instance is running must fail...
AssertCommand(["gnt-instance", "modify", "--offline", instance["name"]],
# ...while making it online is ok, and should work
AssertCommand(["gnt-instance", "modify", "--online", instance["name"]])
......@@ -438,6 +441,16 @@ def TestInstanceStoppedModify(instance):
# Mark instance as offline
AssertCommand(["gnt-instance", "modify", "--offline", name])
# When the instance is offline shutdown should only work with --force,
# while start should never work
AssertCommand(["gnt-instance", "shutdown", name], fail=True)
AssertCommand(["gnt-instance", "shutdown", "--force", name])
AssertCommand(["gnt-instance", "start", name], fail=True)
AssertCommand(["gnt-instance", "start", "--force", name], fail=True)
# Also do offline to offline
AssertCommand(["gnt-instance", "modify", "--offline", name])
# And online again
AssertCommand(["gnt-instance", "modify", "--online", name])
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