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

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 <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
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"]],
fail=True)
# ...while making it online is ok, and should work
AssertCommand(["gnt-instance", "modify", "--online", instance["name"]])
@InstanceCheck(INST_DOWN, INST_DOWN, FIRST_ARG)
......@@ -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