Commit 50ef6a41 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

QA: Test for basic features of exclusive storage



Check that creation of instances doesn't trigger any error.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 17cfeee9
#!/usr/bin/python -u
#
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -457,6 +457,28 @@ def RunHardwareFailureTests(instance, pnode, snode):
pnode, snode)
def RunExclusiveStorageTests():
"""Test exclusive storage."""
if not qa_config.TestEnabled("cluster-exclusive-storage"):
return
node = qa_config.AcquireNode()
try:
old_es = qa_cluster.TestSetExclStorCluster(True)
if qa_config.TestEnabled("instance-add-plain-disk"):
# Make sure that the cluster doesn't have any pre-existing problem
qa_cluster.AssertClusterVerify()
instance1 = qa_instance.TestInstanceAddWithPlainDisk(node)
instance2 = qa_instance.TestInstanceAddWithPlainDisk(node)
# cluster-verify checks that disks are allocated correctly
qa_cluster.AssertClusterVerify()
qa_instance.TestInstanceRemove(instance1)
qa_instance.TestInstanceRemove(instance2)
qa_cluster.TestSetExclStorCluster(old_es)
finally:
qa_config.ReleaseNode(node)
def RunQa():
"""Main QA body.
......@@ -587,6 +609,8 @@ def RunQa():
finally:
qa_config.ReleaseNode(pnode)
RunExclusiveStorageTests()
RunTestIf("create-cluster", qa_node.TestNodeRemoveAll)
RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy)
......
......@@ -111,6 +111,7 @@
"cluster-epo": true,
"cluster-redist-conf": true,
"cluster-repair-disk-sizes": true,
"cluster-exclusive-storage": true,
"haskell-confd": true,
"htools": true,
......
......@@ -626,3 +626,22 @@ def TestClusterDestroy():
def TestClusterRepairDiskSizes():
"""gnt-cluster repair-disk-sizes"""
AssertCommand(["gnt-cluster", "repair-disk-sizes"])
def TestSetExclStorCluster(newvalue):
"""Set the exclusive_storage node parameter at the cluster level.
@type newvalue: bool
@param newvalue: New value of exclusive_storage
@rtype: bool
@return: The old value of exclusive_storage
"""
oldvalue = _GetBoolClusterField("exclusive_storage")
AssertCommand(["gnt-cluster", "modify", "--node-parameters",
"exclusive_storage=%s" % newvalue])
effvalue = _GetBoolClusterField("exclusive_storage")
if effvalue != newvalue:
raise qa_error.Error("exclusive_storage has the wrong value: %s instead"
" of %s" % (effvalue, newvalue))
return oldvalue
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