Skip to content
Snippets Groups Projects
Commit e85be22a authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Add option to disable iallocator use in QA


By default some QA tests use iallocators. It is now possible to disable
iallocators in QA, so that QA doesn't force having iallocators set up.
The affected tests have now alternatives pathways.

Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 8bd977e9
No related branches found
No related tags found
No related merge requests found
...@@ -164,7 +164,8 @@ ...@@ -164,7 +164,8 @@
"burnin-check-instances": false, "burnin-check-instances": false,
"burnin-rename": "xen-test-rename", "burnin-rename": "xen-test-rename",
"burnin-reboot": true, "burnin-reboot": true,
"reboot-types": ["soft", "hard", "full"] "reboot-types": ["soft", "hard", "full"],
"use-iallocators": false
}, },
"# vim: set syntax=javascript :": null "# vim: set syntax=javascript :": null
......
...@@ -485,19 +485,23 @@ def TestReplaceDisks(instance, pnode, snode, othernode): ...@@ -485,19 +485,23 @@ def TestReplaceDisks(instance, pnode, snode, othernode):
cmd.append(instance["name"]) cmd.append(instance["name"])
return cmd return cmd
options = qa_config.get("options", {})
use_ialloc = options.get("use-iallocators", True)
for data in [ for data in [
["-p"], ["-p"],
["-s"], ["-s"],
["--new-secondary=%s" % othernode["primary"]], # A placeholder; the actual command choice depends on use_ialloc
["-I", constants.DEFAULT_IALLOCATOR_SHORTCUT], None,
# Restore the original secondary
["--new-secondary=%s" % snode["primary"]],
]: ]:
if data is None:
if use_ialloc:
data = ["-I", constants.DEFAULT_IALLOCATOR_SHORTCUT]
else:
data = ["--new-secondary=%s" % othernode["primary"]]
AssertCommand(buildcmd(data)) AssertCommand(buildcmd(data))
# Restore the original secondary, if needed
currsec = _GetInstanceInfo(instance)["nodes"][1]
if currsec != snode["primary"]:
AssertCommand(buildcmd(["--new-secondary=%s" % snode["primary"]]))
AssertCommand(buildcmd(["-a"])) AssertCommand(buildcmd(["-a"]))
AssertCommand(["gnt-instance", "stop", instance["name"]]) AssertCommand(["gnt-instance", "stop", instance["name"]])
AssertCommand(buildcmd(["-a"]), fail=True) AssertCommand(buildcmd(["-a"]), fail=True)
...@@ -541,22 +545,31 @@ def TestRecreateDisks(instance, pnode, snode, othernodes): ...@@ -541,22 +545,31 @@ def TestRecreateDisks(instance, pnode, snode, othernodes):
@param othernodes: list/tuple of nodes where to temporarily recreate disks @param othernodes: list/tuple of nodes where to temporarily recreate disks
""" """
options = qa_config.get("options", {})
use_ialloc = options.get("use-iallocators", True)
other_seq = ":".join([n["primary"] for n in othernodes]) other_seq = ":".join([n["primary"] for n in othernodes])
orig_seq = pnode["primary"] orig_seq = pnode["primary"]
if snode: if snode:
orig_seq = orig_seq + ":" + snode["primary"] orig_seq = orig_seq + ":" + snode["primary"]
# These fail because the instance is running # These fail because the instance is running
_AssertRecreateDisks(["-n", other_seq], instance, fail=True, destroy=False) _AssertRecreateDisks(["-n", other_seq], instance, fail=True, destroy=False)
_AssertRecreateDisks(["-I", "hail"], instance, fail=True, destroy=False) if use_ialloc:
_AssertRecreateDisks(["-I", "hail"], instance, fail=True, destroy=False)
else:
_AssertRecreateDisks(["-n", other_seq], instance, fail=True, destroy=False)
AssertCommand(["gnt-instance", "stop", instance["name"]]) AssertCommand(["gnt-instance", "stop", instance["name"]])
# Disks exist: this should fail # Disks exist: this should fail
_AssertRecreateDisks([], instance, fail=True, destroy=False) _AssertRecreateDisks([], instance, fail=True, destroy=False)
# Recreate disks in place # Recreate disks in place
_AssertRecreateDisks([], instance) _AssertRecreateDisks([], instance)
# Move disks away # Move disks away
_AssertRecreateDisks(["-I", "hail"], instance) if use_ialloc:
# Move disks somewhere else _AssertRecreateDisks(["-I", "hail"], instance)
_AssertRecreateDisks(["-I", constants.DEFAULT_IALLOCATOR_SHORTCUT], instance) # Move disks somewhere else
_AssertRecreateDisks(["-I", constants.DEFAULT_IALLOCATOR_SHORTCUT],
instance)
else:
_AssertRecreateDisks(["-n", other_seq], instance)
# Move disks back # Move disks back
_AssertRecreateDisks(["-n", orig_seq], instance, check=False) _AssertRecreateDisks(["-n", orig_seq], instance, check=False)
# This and InstanceCheck decoration check that the disks are working # This and InstanceCheck decoration check that the disks are working
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment