Revision 0511ce91 qa/qa_monitoring.py

b/qa/qa_monitoring.py
24 24
"""
25 25

  
26 26
from ganeti import _autoconf
27
from ganeti import constants
27 28

  
28 29
import qa_config
30
import qa_utils
29 31

  
30 32
from qa_utils import AssertCommand
31 33
from qa_instance_utils import CreateInstanceByDiskTemplate, \
......
38 40
  """Test the Xen instance status collector.
39 41

  
40 42
  """
43
  enabled_hypervisors = qa_config.GetEnabledHypervisors()
44
  is_xen = (constants.HT_XEN_PVM in enabled_hypervisors or
45
            constants.HT_XEN_HVM in enabled_hypervisors)
46
  fail = not is_xen
47

  
41 48
  # Execute on master on an empty cluster
42
  AssertCommand([MON_COLLECTOR, "inst-status-xen"])
49
  AssertCommand([MON_COLLECTOR, "inst-status-xen"], fail=fail)
43 50

  
44 51
  #Execute on cluster with instances
45 52
  node1 = qa_config.AcquireNode()
......
47 54
  template = qa_config.GetDefaultDiskTemplate()
48 55

  
49 56
  instance = CreateInstanceByDiskTemplate([node1, node2], template)
50
  AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node1)
51
  AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node2)
57
  AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node1, fail=fail)
58
  AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node2, fail=fail)
52 59
  RemoveInstance(instance)
53 60

  
54 61
  node1.Release()

Also available in: Unified diff