Revision 21bf2e2e qa/qa_cluster.py

b/qa/qa_cluster.py
40 40
#: cluster verify command
41 41
_CLUSTER_VERIFY = ["gnt-cluster", "verify"]
42 42

  
43

  
43 44
def _RemoveFileFromAllNodes(filename):
44 45
  """Removes a file from all nodes.
45 46

  
......
231 232
    (False, _CLUSTER_VERIFY),
232 233
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]),
233 234
    (False, ["lvcreate", "-L1G", "-nqa-test", "xenvg"]),
234
    (True,  _CLUSTER_VERIFY),
235
    (True, _CLUSTER_VERIFY),
235 236
    (False, ["gnt-cluster", "modify", "--reserved-lvs",
236 237
             "xenvg/qa-test,.*/other-test"]),
237 238
    (False, _CLUSTER_VERIFY),
238 239
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ".*/qa-.*"]),
239 240
    (False, _CLUSTER_VERIFY),
240 241
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]),
241
    (True,  _CLUSTER_VERIFY),
242
    (True, _CLUSTER_VERIFY),
242 243
    (False, ["lvremove", "-f", "xenvg/qa-test"]),
243 244
    (False, _CLUSTER_VERIFY),
244 245
    ]:
......
251 252
    # mem
252 253
    (False, ["gnt-cluster", "modify", "-B", "memory=256"]),
253 254
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 256$'"]),
254
    (True,  ["gnt-cluster", "modify", "-B", "memory=a"]),
255
    (True, ["gnt-cluster", "modify", "-B", "memory=a"]),
255 256
    (False, ["gnt-cluster", "modify", "-B", "memory=128"]),
256 257
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 128$'"]),
257 258
    # vcpus
258 259
    (False, ["gnt-cluster", "modify", "-B", "vcpus=4"]),
259 260
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 4$'"]),
260
    (True,  ["gnt-cluster", "modify", "-B", "vcpus=a"]),
261
    (True, ["gnt-cluster", "modify", "-B", "vcpus=a"]),
261 262
    (False, ["gnt-cluster", "modify", "-B", "vcpus=1"]),
262 263
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 1$'"]),
263 264
    # auto_balance
264 265
    (False, ["gnt-cluster", "modify", "-B", "auto_balance=False"]),
265 266
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: False$'"]),
266
    (True,  ["gnt-cluster", "modify", "-B", "auto_balance=1"]),
267
    (True, ["gnt-cluster", "modify", "-B", "auto_balance=1"]),
267 268
    (False, ["gnt-cluster", "modify", "-B", "auto_balance=True"]),
268 269
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: True$'"]),
269 270
    ]:
......
274 275
  if bep:
275 276
    AssertCommand(["gnt-cluster", "modify", "-B", bep])
276 277

  
278

  
277 279
def TestClusterInfo():
278 280
  """gnt-cluster info"""
279 281
  AssertCommand(["gnt-cluster", "info"])
......
306 308
    ["--new-cluster-domain-secret", "--cluster-domain-secret=/dev/null"],
307 309
    ]
308 310
  for i in conflicting:
309
    AssertCommand(cmd+i, fail=True)
311
    AssertCommand(cmd + i, fail=True)
310 312

  
311 313
  # Invalid RAPI certificate
312 314
  cmd = ["gnt-cluster", "renew-crypto", "--force",

Also available in: Unified diff