Commit 86c340af authored by Iustin Pop's avatar Iustin Pop
Browse files

Merge branch 'devel-2.2' into devel-2.3



* devel-2.2:
  QA: add tests for gnt-cluster modify -B
  LUSetClusterParms: fix validation of beparams

Conflicts:
	lib/cmdlib.py (reverted & applied manually the change)
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parents 28a7318f 9738ca94
......@@ -2575,8 +2575,7 @@ class LUSetClusterParams(LogicalUnit):
ht.TNone)),
("hvparams", None, ht.TOr(ht.TDictOf(ht.TNonEmptyString, ht.TDict),
ht.TNone)),
("beparams", None, ht.TOr(ht.TDictOf(ht.TNonEmptyString, ht.TDict),
ht.TNone)),
("beparams", None, ht.TOr(ht.TDict, ht.TNone)),
("os_hvp", None, ht.TOr(ht.TDictOf(ht.TNonEmptyString, ht.TDict),
ht.TNone)),
("osparams", None, ht.TOr(ht.TDictOf(ht.TNonEmptyString, ht.TDict),
......
......@@ -128,6 +128,10 @@ def RunClusterTests():
if qa_config.TestEnabled('cluster-reserved-lvs'):
RunTest(qa_cluster.TestClusterReservedLvs)
if qa_config.TestEnabled("cluster-modify"):
RunTest(qa_cluster.TestClusterModifyBe)
# TODO: add more cluster modify tests
if qa_config.TestEnabled('cluster-rename'):
RunTest(qa_cluster.TestClusterRename)
......
......@@ -51,6 +51,7 @@
"cluster-destroy": true,
"cluster-rename": true,
"cluster-reserved-lvs": true,
"cluster-modify": true,
"node-info": true,
"node-volumes": true,
......
......@@ -171,6 +171,34 @@ def TestClusterReservedLvs():
utils.ShellQuoteArgs(cmd)).wait(), rcode)
def TestClusterModifyBe():
"""gnt-cluster modify -B"""
master = qa_config.GetMasterNode()
for rcode, cmd in [
# mem
(0, ["gnt-cluster", "modify", "-B", "memory=256"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 256$'"]),
(1, ["gnt-cluster", "modify", "-B", "memory=a"]),
(0, ["gnt-cluster", "modify", "-B", "memory=128"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 128$'"]),
# vcpus
(0, ["gnt-cluster", "modify", "-B", "vcpus=4"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 4$'"]),
(1, ["gnt-cluster", "modify", "-B", "vcpus=a"]),
(0, ["gnt-cluster", "modify", "-B", "vcpus=1"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 1$'"]),
# auto_balance
(0, ["gnt-cluster", "modify", "-B", "auto_balance=False"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: False$'"]),
(1, ["gnt-cluster", "modify", "-B", "auto_balance=1"]),
(0, ["gnt-cluster", "modify", "-B", "auto_balance=True"]),
(0, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: True$'"]),
]:
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), rcode)
def TestClusterInfo():
"""gnt-cluster info"""
master = qa_config.GetMasterNode()
......
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