here's my check-in to our Package Update Acceptance Test Plan (maybe PUATP?).
I've been playing with autotest labels lately and I've flooded this
conference with results just a moments ago, but I'll repeat a short
* Patched autoqa is in 'labels' branch
* Enumeration of our autotest labels is on our wiki ("Managing
The staging autotest server and client jlaska provided was a tremendous
help, but I ran into some issues with virtual guests, so I'll have to
dig into it a little deeper and ask a lot of questions (apologies to
jlaska in advance). Mainly about networking (I studied network bridges
recently but I'm still not proficient with it), adding clients to autotest
(what must be installed), etc. I also intend to prepare a simple kickstart
script that will ease the task of preparing a new VM client and hooking
it up into autotest, because it's boring (and slow) to do it by hand.
today, I made some magic working, so i'd like to share it with you :)
So what's the deal - we want to have complete results in resultsdb, when
any exception is raised during the testrun, it's immediately stopped
(killed), and no other function (not even the postprocess) from the test
object is called.
This is obviously bad, since the information about the fail is not
propagated into the resultsdb.
The most obvious solution is to put the whole thing in try-catch block,
and if an exception is raised, store the info inside resultsdb. This not
good looking, though, so i created a decorator which catches the
exception, stores it, calls the 'trigger function' which it has as a
parameter, and after calling this function, it re-raises the exception.
You can see the usage here
the decorator is here
This solution has one 'drawback', though - you need to have the **kwargs
parameter in the initialize & run_once functions, since the autotest
calls them with all parameters specified in the run() call in control
file, and does some nasty magic with introspection to see which
parameters to actually call the function with (e.g. not to call the
run_once with the config parameter etc). And i was not able to replicate
this behaviour, even though i know how is it done (there's probably some
other step in the autotest magic which i did not discover), so i decided
to KISS and just add the **kwargs parameter, which solves the problem.
Any comments on the decorator, it's usage in the test and resultsdb API
calls (the same library as the decorator) are appreciated.
#136: ResultsDB: Study MediaWiki RPC mechanism
Reporter: jskladan | Owner: wwoods
Type: task | Status: new
Priority: major | Milestone: Resultdb
Component: infrastructure | Version: 1.0
We want to store metadata about tests on our wiki. To grab the information
back, we'll need a way to 'query' wiki for certain page/sub-page.
Investigate on the MediaWiki RPC mechanism and propose a way to use it.
Ticket URL: <https://fedorahosted.org/autoqa/ticket/136>
Automated QA project
hooks/post-bodhi-update/watch-bodhi-requests.py | 30 +------------
lib/python/bodhi_utils.py | 49 +++++++++++++++++++++++
2 files changed, 52 insertions(+), 27 deletions(-)
create mode 100755 lib/python/bodhi_utils.py
diff --git a/hooks/post-bodhi-update/watch-bodhi-requests.py b/hooks/post-bodhi-update/watch-bodhi-requests.py
index f1a4e6c..1df5654 100755
@@ -55,6 +55,7 @@ import optparse
from autoqa.repoinfo import repoinfo
+from autoqa.bodhi_utils import bodhitime, parse_bodhitime, bodhi_list
cachedir = '/var/cache/autoqa/watch-bodhi-requests'
@@ -69,32 +70,8 @@ except OSError, e:
bodhi_releases = ['F11','F12','F13']
archlist = ('i686', 'x86_64', 'noarch')
- '''Convert timestamp (seconds since Epoch, assumed to be local time) to a
- Bodhi-approved time string ('%Y-%m-%d %H:%M:%S')'''
- return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(timestamp))
- '''Convert a Bodhi-approved time string ('%Y-%m-%d %H:%M:%S') to a
- float-represented number of seconds since Epoch (local time)'''
- return time.mktime(time.strptime(bodhitimestr,'%Y-%m-%d %H:%M:%S'))
-def bodhi_list(params, limit=100):
- '''Perform a bodhi 'list' method call, with pagination handling'''
- bodhi = fedora.client.bodhi.BodhiClient()
- params['tg_paginate_limit'] = limit
- params['tg_paginate_no'] = 1
- updates = list()
- num_items = 1 # this is a lie to get us in the loop
- while num_items > len(updates):
- r = bodhi.send_request('list', params)
- num_items = r['num_items']
- updates += r['updates']
- params['tg_paginate_no'] += 1
- return updates
+# XXX NOTE we could probably be using cPickle or something here, rather than
+# a possibly-unreliable invented encoding/decoding to save a set()
def save_update_ids(update_ids, cachefile):
f = open(cachefile,'w')
@@ -103,7 +80,6 @@ def save_update_ids(update_ids, cachefile):
except IOError, e:
print "error: failed to write %s: %s" % (cachefile, str(e))
update_ids = set()
diff --git a/lib/python/bodhi_utils.py b/lib/python/bodhi_utils.py
new file mode 100755
@@ -0,0 +1,49 @@
+# bodhi_utils.py - utility functions for dealing with bodhi
+# 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.
+# Will Woods <wwoods(a)redhat.com>
+ '''Convert timestamp (seconds since Epoch, assumed to be local time) to a
+ Bodhi-approved time string ('%Y-%m-%d %H:%M:%S')'''
+ return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(timestamp))
+ '''Convert a Bodhi-approved time string ('%Y-%m-%d %H:%M:%S') to a
+ float-represented number of seconds since Epoch (local time)'''
+ return time.mktime(time.strptime(bodhitimestr,'%Y-%m-%d %H:%M:%S'))
+def bodhi_list(params, limit=100):
+ '''Perform a bodhi 'list' method call, with pagination handling'''
+ bodhi = fedora.client.bodhi.BodhiClient()
+ params['tg_paginate_limit'] = limit
+ params['tg_paginate_no'] = 1
+ updates = list()
+ num_items = 1 # this is a lie to get us in the loop
+ while num_items > len(updates):
+ r = bodhi.send_request('list', params)
+ num_items = r['num_items']
+ updates += r['updates']
+ params['tg_paginate_no'] += 1
+ return updates
The post-bodhi-update hook code (in my git branch) has been off in its
own branch for too long - I think it's about time to try to merge it to
master, so we can start writing tests and trying to get depcheck
Is there anything missing before we're sure that the hook/watcher are
functional enough to merge? James, you've been testing the watcher - are
you satisfied that it's ready to land? Or should we try to write the
helloworld test first, to be super-sure it's ready before we merge?
Any thoughts? If nobody has any strong opinions against it, I'll attempt
to merge it tomorrow.
I have been reading through instructions how to add new autotest
clients  and I've seen a link there pointing to non-existent
page "Managing autotest labels". So I created it, here it is:
I will soon post a code that will allow us to use also additional
autotest labels in AutoQA, not just the platform labels. So I have
taken this opportunity and proposed on that page how the additional
labels could look like:
Maybe we will need some more labels, I still haven't figured them
out yet (maybe "destructive" in one candidate). We can add them
in the future.
Do you have any comments on those proposed ones? Are they intuitive
or should we change them somehow? Suggestions welcome.