From 1ba25bad84826ee053fe6889b702be5319b9d314 Mon Sep 17 00:00:00 2001 From: Guido Trotter Date: Wed, 19 Dec 2012 13:33:02 +0100 Subject: [PATCH] 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: Guido Trotter Reviewed-by: Iustin Pop --- qa/qa_instance.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/qa/qa_instance.py b/qa/qa_instance.py index 701d583..b604d97 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -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]) -- 1.7.10.4