Commit 09470dd8 authored by Michael Hanselmann's avatar Michael Hanselmann

QA: Add tests for “gnt-job list”

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 3086220e
......@@ -506,6 +506,7 @@ qa_scripts = \
qa/qa_error.py \
qa/qa_group.py \
qa/qa_instance.py \
qa/qa_job.py \
qa/qa_node.py \
qa/qa_os.py \
qa/qa_rapi.py \
......
......@@ -38,6 +38,7 @@ import qa_group
import qa_instance
import qa_node
import qa_os
import qa_job
import qa_rapi
import qa_tags
import qa_utils
......@@ -130,6 +131,7 @@ def SetupCluster(rapi_user, rapi_secret):
# Test on empty cluster
RunTestIf("node-list", qa_node.TestNodeList)
RunTestIf("instance-list", qa_instance.TestInstanceList)
RunTestIf("job-list", qa_job.TestJobList)
RunTestIf("create-cluster", qa_node.TestNodeAddAll)
if not qa_config.TestEnabled("create-cluster"):
......@@ -146,6 +148,7 @@ def SetupCluster(rapi_user, rapi_secret):
# Test listing fields
RunTestIf("node-list", qa_node.TestNodeListFields)
RunTestIf("instance-list", qa_instance.TestInstanceListFields)
RunTestIf("job-list", qa_job.TestJobListFields)
RunTestIf("node-info", qa_node.TestNodeInfo)
......@@ -290,6 +293,9 @@ def RunCommonInstanceTests(instance):
# Lists instances, too
RunTestIf("node-list", qa_node.TestNodeList)
# Some jobs have been run, let's test listing them
RunTestIf("job-list", qa_job.TestJobList)
def RunCommonNodeTests():
"""Run a few common node tests.
......
......@@ -113,6 +113,8 @@
"instance-rename": true,
"instance-shutdown": true,
"job-list": true,
"# cron/ganeti-watcher should be disabled for these tests": null,
"instance-automatic-restart": false,
"instance-consecutive-failures": false,
......
#
#
# Copyright (C) 2012 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.
"""Job-related QA tests.
"""
from ganeti import query
import qa_utils
def TestJobList():
"""gnt-job list"""
qa_utils.GenericQueryTest("gnt-job", query.JOB_FIELDS.keys())
def TestJobListFields():
"""gnt-node list-fields"""
qa_utils.GenericQueryFieldsTest("gnt-job", query.JOB_FIELDS.keys())
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