Added new option to autoqa --autotest-server which can be used
to set hostname of the autotest server, which will hold the results
of the test. Since our infrastructure has Autotest and AutoQA
on the same machine, default value for this option is the hostname
of current machine (socket.gethostname()).
Also the templates of control were updated, so they propagate
the basic URL to the Autotest results directory.
Test_class_templates were updated, so they create the whole
URL to the results.
---
autoqa | 6 ++++++
hooks/post-koji-build/control.template | 3 ++-
hooks/post-koji-build/test_class_template.py | 5 ++++-
hooks/post-repo-update/control.template | 3 ++-
hooks/post-repo-update/test_class_template.py | 5 ++++-
hooks/post-tree-compose/control.template | 3 ++-
hooks/post-tree-compose/test_class_template.py | 5 ++++-
7 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/autoqa b/autoqa
index efb94e3..9f41c00 100755
--- a/autoqa
+++ b/autoqa
@@ -27,6 +27,7 @@ import optparse
import tempfile
import StringIO
import urlgrabber
+import socket
from ConfigParser import *
from subprocess import call
@@ -139,6 +140,9 @@ parser.add_option('--local', action='store_true',
dest='local',
help='Do not schedule jobs - run test(s) directly on the local
machine')
parser.add_option('-l', '--list-tests', action='store_true',
dest='listtests',
help='list the tests for the given hookname - do not run any tests')
+parser.add_option('--autotest-server', action='store',
default=socket.gethostname(),
+ help='Sets the autotest-server hostname. Used for creating URLs to
results.\
+Hostname of the local machine is used by default.')
# Read and validate the hookname
# Check for no args, or just -h/--help
if len(sys.argv) == 1 or sys.argv[1] in ('-h', '--help'):
@@ -197,6 +201,8 @@ for arch in opts.arch:
# N.B. process_testdata may grow new keyword arguments if we add
new autoqa
# args that add another loop here..
testdata = hook.process_testdata(opts, args, arch=arch)
+ if not 'autotest_server' in testdata.keys():
+ testdata['autotest_server'] = opts.autotest_server
# XXX FIXME: tests need to be able to indicate that they do not
require
# any specific arch (e.g. rpmlint can run on any arch)
for test in testlist:
diff --git a/hooks/post-koji-build/control.template
b/hooks/post-koji-build/control.template
index b90260f..b7c5261 100644
--- a/hooks/post-koji-build/control.template
+++ b/hooks/post-koji-build/control.template
@@ -15,4 +15,5 @@ TEST_CATEGORY = 'Functional'
# kojitag: koji tag applied to this package
job.run_test('testclassname', name=name, envr=envr, kojitag=kojitag,
- config=autoqa_conf)
+ config=autoqa_conf,
+ autotest_url="http://%s/results/%s/" % (autotest_server,
job.tag))
diff --git a/hooks/post-koji-build/test_class_template.py
b/hooks/post-koji-build/test_class_template.py
index cf91865..462dc91 100644
--- a/hooks/post-koji-build/test_class_template.py
+++ b/hooks/post-koji-build/test_class_template.py
@@ -35,7 +35,10 @@ class post_repo_update_test_class_name(test.test):
#utils.system('yum -y install yum-utils')
pass
- def run_once(self, envr, name, kojitag):
+ def run_once(self, envr, name, kojitag, autotest_url):
+ # results_url points to the directory on autotest-server with
+ #the sotred results
+ results_url = "%s%s/" % (autotest_url, self.__class__.__name__)
parentlist = ' '.split(parents)
cmd = 'test_binary --url %s' % baseurl
# You can get stuff from the [test] section of autoqa.conf
like this
diff --git a/hooks/post-repo-update/control.template
b/hooks/post-repo-update/control.template
index 50ba58d..204dc69 100644
--- a/hooks/post-repo-update/control.template
+++ b/hooks/post-repo-update/control.template
@@ -19,4 +19,5 @@ TEST_CATEGORY = 'Functional'
job.run_test('testclassname', baseurl=url,
parents=parents,
reponame=reponame,
- config=autoqa_conf)
+ config=autoqa_conf,
+ autotest_url="http://%s/results/%s/" % (autotest_server,
job.tag))
diff --git a/hooks/post-repo-update/test_class_template.py
b/hooks/post-repo-update/test_class_template.py
index e274f98..c0c0137 100644
--- a/hooks/post-repo-update/test_class_template.py
+++ b/hooks/post-repo-update/test_class_template.py
@@ -33,7 +33,10 @@ class post_repo_update_test_class_name(test.test):
#utils.system('yum -y install yum-utils')
pass
- def run_once(self, baseurl, parents, reponame):
+ def run_once(self, baseurl, parents, reponame, autotest_url):
+ # results_url points to the directory on autotest-server with
+ #the sotred results
+ results_url = "%s%s/" % (autotest_url, self.__class__.__name__)
parentlist = ' '.split(parents)
cmd = 'test_binary --url %s' % baseurl
# You can get stuff from the [test] section of autoqa.conf
like this
diff --git a/hooks/post-tree-compose/control.template
b/hooks/post-tree-compose/control.template
index e327799..ef8ea35 100644
--- a/hooks/post-tree-compose/control.template
+++ b/hooks/post-tree-compose/control.template
@@ -17,4 +17,5 @@ TEST_CATEGORY = 'Functional'
job.run_test('testclassname', baseurl=url,
treename=treename,
- config=autoqa_conf)
+ config=autoqa_conf,
+ autotest_url="http://%s/results/%s/" % (autotest_server,
job.tag))
diff --git a/hooks/post-tree-compose/test_class_template.py
b/hooks/post-tree-compose/test_class_template.py
index 0ffab9d..6084fb1 100644
--- a/hooks/post-tree-compose/test_class_template.py
+++ b/hooks/post-tree-compose/test_class_template.py
@@ -33,7 +33,10 @@ class post_tree_compose_test_class_name(test.test):
#utils.system('yum -y install yum-utils')
pass
- def run_once(self, baseurl, treename):
+ def run_once(self, baseurl, treename, autotest_url):
+ # results_url points to the directory on autotest-server with
+ #the sotred results
+ results_url = "%s%s/" % (autotest_url, self.__class__.__name__)
cmd = 'test_binary --url %s' % baseurl
# You can get stuff from the [test] section of autoqa.conf
like this
email = self.config.get('test','result_email')
--
1.6.6.1