Revision 50ef6a41

b/qa/ganeti-qa.py
1 1
#!/usr/bin/python -u
2 2
#
3 3

  
4
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
4
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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
......
457 457
            pnode, snode)
458 458

  
459 459

  
460
def RunExclusiveStorageTests():
461
  """Test exclusive storage."""
462
  if not qa_config.TestEnabled("cluster-exclusive-storage"):
463
    return
464

  
465
  node = qa_config.AcquireNode()
466
  try:
467
    old_es = qa_cluster.TestSetExclStorCluster(True)
468
    if qa_config.TestEnabled("instance-add-plain-disk"):
469
      # Make sure that the cluster doesn't have any pre-existing problem
470
      qa_cluster.AssertClusterVerify()
471
      instance1 = qa_instance.TestInstanceAddWithPlainDisk(node)
472
      instance2 = qa_instance.TestInstanceAddWithPlainDisk(node)
473
      # cluster-verify checks that disks are allocated correctly
474
      qa_cluster.AssertClusterVerify()
475
      qa_instance.TestInstanceRemove(instance1)
476
      qa_instance.TestInstanceRemove(instance2)
477
    qa_cluster.TestSetExclStorCluster(old_es)
478
  finally:
479
    qa_config.ReleaseNode(node)
480

  
481

  
460 482
def RunQa():
461 483
  """Main QA body.
462 484

  
......
587 609
  finally:
588 610
    qa_config.ReleaseNode(pnode)
589 611

  
612
  RunExclusiveStorageTests()
613

  
590 614
  RunTestIf("create-cluster", qa_node.TestNodeRemoveAll)
591 615

  
592 616
  RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy)
b/qa/qa-sample.json
111 111
    "cluster-epo": true,
112 112
    "cluster-redist-conf": true,
113 113
    "cluster-repair-disk-sizes": true,
114
    "cluster-exclusive-storage": true,
114 115

  
115 116
    "haskell-confd": true,
116 117
    "htools": true,
b/qa/qa_cluster.py
626 626
def TestClusterRepairDiskSizes():
627 627
  """gnt-cluster repair-disk-sizes"""
628 628
  AssertCommand(["gnt-cluster", "repair-disk-sizes"])
629

  
630

  
631
def TestSetExclStorCluster(newvalue):
632
  """Set the exclusive_storage node parameter at the cluster level.
633

  
634
  @type newvalue: bool
635
  @param newvalue: New value of exclusive_storage
636
  @rtype: bool
637
  @return: The old value of exclusive_storage
638

  
639
  """
640
  oldvalue = _GetBoolClusterField("exclusive_storage")
641
  AssertCommand(["gnt-cluster", "modify", "--node-parameters",
642
                 "exclusive_storage=%s" % newvalue])
643
  effvalue = _GetBoolClusterField("exclusive_storage")
644
  if effvalue != newvalue:
645
    raise qa_error.Error("exclusive_storage has the wrong value: %s instead"
646
                         " of %s" % (effvalue, newvalue))
647
  return oldvalue

Also available in: Unified diff