Hello,
I created new test for AutoQA named 'helloworld', ticket #195. It's
simple test, that will only forward parameters that were passed in
control file. Main purpose is to show, how to write new tests for
AutoQA. Patch included.
---
From 78a996deb74201984a42d3d3783c1a47e213396f Mon Sep 17 00:00:00 2001
From: vaschenb <vaschenb(a)redhat.com>
Date: Tue, 13 Jul 2010 15:37:26 +0200
Subject: [PATCH] 195: Add helloworld test for AutoQA
---
tests/helloworld/control | 18 +++++++++++++++++
tests/helloworld/helloworld.py | 41 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 0 deletions(-)
create mode 100644 tests/helloworld/control
create mode 100644 tests/helloworld/helloworld.py
diff --git a/tests/helloworld/control b/tests/helloworld/control
new file mode 100644
index 0000000..af19252
--- /dev/null
+++ b/tests/helloworld/control
@@ -0,0 +1,18 @@
+# vim: set syntax=python
+TIME="SHORT"
+AUTHOR = "Vojtech Aschenbrenner <vaschenb(a)redhat.com>"
+DOC = """
+This test runs helloworld. It will only print params what it will get.
+Main purpose is to show, how to write tests.
+"""
+NAME = 'helloworld'
+TEST_TYPE = 'CLIENT' # SERVER can be used for tests that need multiple machines
+TEST_CLASS = 'General'
+TEST_CATEGORY = 'Functional'
+
+# post-koji-build tests can expect the following variables from autoqa:
+# envr: package NVR (required, epoch can be skipped)
+# name: package name
+# kojitag: koji tag applied to this package
+
+job.run_test('helloworld', name=name, envr=envr, kojitag=kojitag,
config=autoqa_conf)
diff --git a/tests/helloworld/helloworld.py b/tests/helloworld/helloworld.py
new file mode 100644
index 0000000..6d1bdf8
--- /dev/null
+++ b/tests/helloworld/helloworld.py
@@ -0,0 +1,41 @@
+#
+# Copyright 2010, Red Hat, 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.
+#
+# Author: Vojtech Aschenbrenner <vaschenb(a)redhat.com>
+
+from autotest_lib.client.bin import test
+from autotest_lib.client.bin.test_config import config_loader
+import autoqa.util
+import os
+
+class helloworld(test.test):
+ version = 1 # increment if setup() changes
+
+ def initialize(self, envr, config):
+ self.config = config_loader(config, self.tmpdir)
+ self.autotest_url = autoqa.util.make_autotest_url(self.config)
+
+ def setup(self):
+ pass
+
+ def run_once(self, **kwargs):
+ self.arguments = kwargs
+ print "===Printing passed params==="
+ for self.name, self.arg in self.arguments.iteritems():
+ print "%s = %r" % (self.name, self.arg)
+ print "%s = %r" % ("autotest_url", self.autotest_url)
+ print "===End of passed params==="
--
1.7.1.1