Revision 9738ca94 qa/qa_cluster.py
b/qa/qa_cluster.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007 Google Inc. |
|
4 |
# Copyright (C) 2007, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
168 | 168 |
utils.ShellQuoteArgs(cmd)).wait(), rcode) |
169 | 169 |
|
170 | 170 |
|
171 |
def TestClusterModifyBe(): |
|
172 |
"""gnt-cluster modify -B""" |
|
173 |
master = qa_config.GetMasterNode() |
|
174 |
|
|
175 |
for rcode, cmd in [ |
|
176 |
# mem |
|
177 |
(0, ["gnt-cluster", "modify", "-B", "memory=256"]), |
|
178 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 256$'"]), |
|
179 |
(1, ["gnt-cluster", "modify", "-B", "memory=a"]), |
|
180 |
(0, ["gnt-cluster", "modify", "-B", "memory=128"]), |
|
181 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 128$'"]), |
|
182 |
# vcpus |
|
183 |
(0, ["gnt-cluster", "modify", "-B", "vcpus=4"]), |
|
184 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 4$'"]), |
|
185 |
(1, ["gnt-cluster", "modify", "-B", "vcpus=a"]), |
|
186 |
(0, ["gnt-cluster", "modify", "-B", "vcpus=1"]), |
|
187 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 1$'"]), |
|
188 |
# auto_balance |
|
189 |
(0, ["gnt-cluster", "modify", "-B", "auto_balance=False"]), |
|
190 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: False$'"]), |
|
191 |
(1, ["gnt-cluster", "modify", "-B", "auto_balance=1"]), |
|
192 |
(0, ["gnt-cluster", "modify", "-B", "auto_balance=True"]), |
|
193 |
(0, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: True$'"]), |
|
194 |
]: |
|
195 |
AssertEqual(StartSSH(master['primary'], |
|
196 |
utils.ShellQuoteArgs(cmd)).wait(), rcode) |
|
197 |
|
|
198 |
|
|
171 | 199 |
def TestClusterInfo(): |
172 | 200 |
"""gnt-cluster info""" |
173 | 201 |
master = qa_config.GetMasterNode() |
Also available in: Unified diff