Skip to content
Snippets Groups Projects
Commit 9738ca94 authored by Iustin Pop's avatar Iustin Pop
Browse files

QA: add tests for gnt-cluster modify -B


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 52b783c2
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,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)
......
......@@ -49,6 +49,7 @@
"cluster-destroy": true,
"cluster-rename": true,
"cluster-reserved-lvs": true,
"cluster-modify": true,
"node-info": true,
"node-volumes": true,
......
#
#
# Copyright (C) 2007 Google Inc.
# Copyright (C) 2007, 2010 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
......@@ -168,6 +168,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()
......
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