Commit a5877534 authored by Michele Tartara's avatar Michele Tartara
Browse files

Add QA for instance status collector



This commit introduces the QA for the instance status collector.

Begin the first QA for a monitoring-related component, the files and some
functions are named after monitoring because they are meant to contain
future monitoring QAs as well.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 8fada090
......@@ -778,6 +778,7 @@ qa_scripts = \
qa/qa_instance.py \
qa/qa_instance_utils.py \
qa/qa_job.py \
qa/qa_monitoring.py \
qa/qa_node.py \
qa/qa_os.py \
qa/qa_rapi.py \
......
......@@ -38,6 +38,7 @@ import qa_env
import qa_error
import qa_group
import qa_instance
import qa_monitoring
import qa_network
import qa_node
import qa_os
......@@ -687,6 +688,11 @@ def RunInstanceTests():
qa_cluster.AssertClusterVerify()
def RunMonitoringTests():
if qa_config.TestEnabled("mon-collector"):
RunTest(qa_monitoring.TestInstStatusCollector)
def RunQa():
"""Main QA body.
......@@ -809,6 +815,8 @@ def RunQa():
snode.Release()
qa_cluster.AssertClusterVerify()
RunMonitoringTests()
RunTestIf("create-cluster", qa_node.TestNodeRemoveAll)
RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy)
......
......@@ -228,7 +228,9 @@
"# Run instance tests with different cluster configurations": null,
"default-instance-tests": true,
"exclusive-storage-instance-tests": false
"exclusive-storage-instance-tests": false,
"mon-collector": true
},
"options": {
......
#
#
# Copyright (C) 2007, 2011, 2012, 2013 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
"""Monitoring related QA tests.
"""
from ganeti import _autoconf
import qa_config
from qa_utils import AssertCommand
from qa_instance_utils import CreateInstanceByDiskTemplate, \
RemoveInstance
MON_COLLECTOR = _autoconf.PKGLIBDIR + "/mon-collector"
def TestInstStatusCollector():
"""Test the Xen instance status collector.
"""
# Execute on master on an empty cluster
AssertCommand([MON_COLLECTOR, "inst-status-xen"])
#Execute on cluster with instances
node1 = qa_config.AcquireNode()
node2 = qa_config.AcquireNode()
template = qa_config.GetDefaultDiskTemplate()
instance = CreateInstanceByDiskTemplate([node1, node2], template)
AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node1)
AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node2)
RemoveInstance(instance)
node1.Release()
node2.Release()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment