Dogtail does not work
by Hongqing Yang
Hi, all,
I try to use dogtail to implement fedora installation test automation, I follows the following steps (refer http://www.redhat.com/magazine/020jun06/features/dogtail/)
1. install ImageMagick
2. install rpm-python
3. install ElementTree
4. install AT-SPI, but I do not find pyspi, I search the internet, it says it is migrated to D-bus.
5. install dogtail
6. enable accessibility, gconftool-2 -s -t boolean /desktop/gnome/interface/accessibility true
I have checked atspi and accessibility, details is below:
#ps aux |grep registryd
hongqing 2011 0.0 0.0 42444 3976 ? S 15:14 0:00 /usr/libexec/at-spi2-registryd --use-gnome-session
hongqing 2112 0.0 0.0 42460 3972 ? S 15:14 0:01 /usr/libexec/at-spi2-registryd --use-gnome-session
root 3986 0.0 0.0 103380 828 pts/3 S+ 16:29 0:00 grep --color=auto registryd
#gconftool-2 -g/desktop/gnome/interface/accessibility
true
ps aux |grep Xvfb
root 4070 0.0 0.0 103376 824 pts/3 S+ 16:34 0:00 grep --color=auto Xvfb
After that, when I run my scripts, It always gives me the following error:
Creating logfile at /tmp/dogtail/logs/dvd_install_20110322-162415_debug ...
Error: AT-SPI's desktop is not visible. Do you have accessibility enabled?
Traceback (most recent call last):
File "./dvd_install.py", line 36, in <module>
from anaconda import *
File "/autoqa/tests/anaconda/anaconda.py", line 31, in <module>
from dogtail import config as dt_cfg, procedural
File "/usr/lib/python2.7/site-packages/dogtail/procedural.py", line 18, in <module>
import tree
File "/usr/lib/python2.7/site-packages/dogtail/tree.py", line 1132, in <module>
children = root.children
NameError: name 'root' is not defined
did I miss anything? Thanks for ur help!
13 years, 3 months
[AutoQA] #283: Update all koji RPM downloading code to use get_nvr_rpms
by fedora-badges
#283: Update all koji RPM downloading code to use get_nvr_rpms
--------------------+-------------------------------------------------------
Reporter: tflink | Owner: tflink
Type: task | Status: new
Priority: minor | Milestone: Finger Food
Component: tests | Keywords:
--------------------+-------------------------------------------------------
With the recent fix for #265, there is now a convenience method to
download RPMs from koji.
Update test code to use this new method in order to reduce code
duplication.
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/283>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
[PATCH] Create function to download RPMs from koji for given NVR
by Tim Flink
Create function to download RPMs from koji for given NVR
This patch for master provides a fix for #265 without the extra py.test
stuff from my pytest branch. It also changes 2 tests to use the new
function. I have tested this on my local setup and as far as I can tell,
it works with no regressions.
There were some concerns about the refactoring that I did in
koji_utils.py. I can remove those changes and re-submit if desired.
Tim
diff --git a/lib/python/koji_utils.py b/lib/python/koji_utils.py
index 1eb2c44..71d6d8a 100644
--- a/lib/python/koji_utils.py
+++ b/lib/python/koji_utils.py
@@ -25,26 +25,40 @@ from repoinfo import repoinfo
import rpmUtils.miscutils
import sys
from autoqa.config import SingleConfigParser, autoqa_conf
+import urlgrabber.grabber
+import os.path
-kojiurl = autoqa_conf.get('resources', 'koji_url')
-pkgurl = autoqa_conf.get('resources', 'pkg_url')
+class SimpleKojiClientSession():
-class SimpleKojiClientSession(koji.ClientSession):
- '''Convenience wrapper class for interacting with koji'''
- def __init__(self, server=kojiurl, opts=None):
- return koji.ClientSession.__init__(self, server, opts)
+ '''Convenience wrapper class for interacting with kojiclient'''
+ def __init__(self, server=None, opts=None, kojiclient=None,
url_grabber=None):
+ self.kojiurl = autoqa_conf.get('resources', 'koji_url')
+ self.pkgurl = autoqa_conf.get('resources', 'pkg_url')
+
+ if server == None:
+ server = self.kojiurl
+
+ if kojiclient == None:
+ self.kojiclient = koji.ClientSession(server, opts)
+ else:
+ self.kojiclient = kojiclient
+
+ if url_grabber == None:
+ self.url_grabber = urlgrabber.grabber.URLGrabber()
+ else:
+ self.url_grabber = url_grabber
def list_builds_since(self, timestamp):
'''Return a list of new builds since the given timestamp'''
- return self.listBuilds(completeAfter=timestamp)
+ return self.kojiclient.listBuilds(completeAfter=timestamp)
def list_tags(self, nvr):
'''Return a list of tags applied to the package with the given
nvr'''
- return [t['name'] for t in self.listTags(nvr)]
+ return [t['name'] for t in self.kojiclient.listTags(nvr)]
def tag_history(self, nvr):
'''Returns a list of every tag ever applied to the given nvr'''
- return [t['tag_name'] for t in self.tagHistory(build=nvr)]
+ return [t['tag_name'] for t in
self.kojiclient.tagHistory(build=nvr)]
def latest_by_tag(self, tag, pkgname, max_evr=None):
'''Get the latest package for the given name in the given tag.
If you
@@ -56,7 +70,7 @@ class SimpleKojiClientSession(koji.ClientSession):
max_evr = (0, max_evr[1], max_evr[2])
if max_evr:
- pkgs = self.listTagged(tag, package=pkgname)
+ pkgs = self.kojiclient.listTagged(tag, package=pkgname)
# sort the packages from highest EVR to lowest
pkgs.sort(cmp=lambda x, y: compareEVR(x, y), reverse=True)
for pkg in pkgs[:]:
@@ -68,19 +82,19 @@ class SimpleKojiClientSession(koji.ClientSession):
# since packages are sorted, we can stop here
break
else:
- pkgs = self.listTagged(tag, package=pkgname, latest=True)
+ pkgs = self.kojiclient.listTagged(tag, package=pkgname,
latest=True)
if pkgs:
# the winner is the first package in list
return pkgs[0]
def build_failed(self, nvr):
- return (self.getBuild(nvr)['state'] > 1)
+ return (self.kojiclient.getBuild(nvr)['state'] > 1)
- # Idea taken from the koji CLI
+ # Idea taken from the kojiclient CLI
def ensure_connection(self):
'''Check the connection to koji.'''
try:
- ret = self.getAPIVersion()
+ ret = self.kojiclient.getAPIVersion()
except xmlrpclib.ProtocolError:
print >> sys.stderr, "Unable to connect to server"
sys.exit(2)
@@ -93,7 +107,7 @@ class SimpleKojiClientSession(koji.ClientSession):
timestamp = time.time()
while not builds and (starttime - timestamp < 10000):
timestamp -= 3000
- builds = self.list_builds_since(timestamp)
+ builds = self.kojiclient.list_builds_since(timestamp)
print "Most recent builds: %.0f min ago" %
((starttime-timestamp)/60.0)
return builds
@@ -146,11 +160,11 @@ class SimpleKojiClientSession(koji.ClientSession):
return prev_rlss[0]
def nvr_to_urls(self, nvr, arches=None, debuginfo=False):
- info = self.getBuild(nvr)
- baseurl = '/'.join((pkgurl, info['package_name'],
+ info = self.kojiclient.getBuild(nvr)
+ baseurl = '/'.join((self.pkgurl, info['package_name'],
info['version'], info['release']))
- rpms = self.listRPMs(buildID=info['id'], arches=arches)
+ rpms = self.kojiclient.listRPMs(buildID=info['id'], arches=arches)
if not debuginfo:
rpms = filter(lambda r: not
r['name'].endswith('-debuginfo'), rpms)
# XXX option to skip srpms too?
@@ -161,11 +175,11 @@ class SimpleKojiClientSession(koji.ClientSession):
''' Get a list of RPMs existing for specified NVR. All RPMs
have 'url'
key added with URL where to download the RPM as the value.'''
- info = self.getBuild(nvr)
- baseurl = '/'.join((pkgurl, info['package_name'],
+ info = self.kojiclient.getBuild(nvr)
+ baseurl = '/'.join((self.pkgurl, info['package_name'],
info['version'], info['release']))
- rpms = self.listRPMs(buildID=info['id'])
+ rpms = self.kojiclient.listRPMs(buildID=info['id'])
if not debuginfo:
rpms = filter(lambda r: not
r['name'].endswith('-debuginfo'), rpms)
if not src:
@@ -176,6 +190,19 @@ class SimpleKojiClientSession(koji.ClientSession):
return rpms
+ def get_nvr_rpms(self, nvr, rpm_dir, arches=None, debuginfo=None):
+ ''' Retrieve the rpms associated with an nvr into the specified
+ directory. Return the local filenames of the grabbed rpms
+ '''
+
+ rpm_urls = self.nvr_to_urls(nvr, arches=arches,
debuginfo=debuginfo)
+ rpm_files = []
+ for url in rpm_urls:
+ local_file = os.path.join(rpm_dir, os.path.basename(url))
+ rpm_file = self.url_grabber.urlgrab(url, local_file)
+ rpm_files.append(rpm_file)
+ return rpm_files
+
def compareEVR(nvr1, nvr2):
''' Compare EVR from two NVR objects. '''
diff --git a/tests/initscripts/initscripts.py
b/tests/initscripts/initscripts.py
index 2261ceb..69a49ba 100644
--- a/tests/initscripts/initscripts.py
+++ b/tests/initscripts/initscripts.py
@@ -140,16 +140,9 @@ class initscripts(AutoQATest):
#install packages from koji
koji = autoqa.koji_utils.SimpleKojiClientSession()
- pkgurls = koji.nvr_to_urls(nvr, arches = os.uname()[-1])
- rpms = []
print "Saving RPMs to %s" % self.rpmdir
- #download packages
- for p in pkgurls:
- # fetch package to rpmdir
- print "Grabbing %s" % p
- localfile = os.path.join(self.rpmdir, os.path.basename(p))
- autoqa.util.grabber.urlgrab(p, localfile)
- rpms.append(localfile)
+ rpms = koji.get_nvr_rpms(nvr, self.rpmdir, arches =
os.uname()[-1])
+
#and install them
cmd = "yum -y --nogpgcheck localinstall %s" % " ".join(rpms)
utils.system_output(cmd)
diff --git a/tests/rpmlint/rpmlint.py b/tests/rpmlint/rpmlint.py
index 73d798f..3997485 100644
--- a/tests/rpmlint/rpmlint.py
+++ b/tests/rpmlint/rpmlint.py
@@ -74,12 +74,8 @@ class rpmlint(AutoQATest):
os.remove(os.path.join(self.rpmdir, rpm))
# download packages
- pkgurls = koji.nvr_to_urls(nvr)
print "Saving RPMs to %s" % self.rpmdir
- for p in pkgurls:
- print "Grabbing %s" % p
- localfile = os.path.join(self.rpmdir, os.path.basename(p))
- autoqa.util.grabber.urlgrab(p, localfile)
+ koji.get_nvr_rpms(nvr, self.rpmdir)
# run rpmlint
cmd = 'rpmlint %s' % self.rpmdir
13 years, 3 months
Error - depcheck including multiple versions of same package ?
by James Laska
Greetings,
Just tossing this to the list for review before it gets buried. I've
seen this with several depcheck results so far. Is the fwd'd depcheck
log finding a bug in bodhi/koji where multiple versions of a package are
showing up?
Thanks,
James
13 years, 3 months
Test Repository Idea
by Tim Flink
Forking this (delayed) conversation out of #276 - Support for
independent test development
(https://fedorahosted.org/autoqa/ticket/276) since it isn't directly
related to the ticket.
>> This would be more of a long term idea, but it might be interesting
>> to start putting tests into a pypi-ish
>> (http://pypi.python.org/pypi) repository.
>>
>> There might be some impedance mismatch, but there are already tools
>> out there to pull packages from pypi and assuming that we could use
>> packages with non-python code wrapped in python, it could provide a
>> mechanism for people to develop and update tests outside of the
>> autoqa RPM, grab and run stand-alone tests in addition to keeping
>> them updated on automated clients.
>>
>> Not sure how that would work with rpm packaging, though.
>
> Thanks for the suggestion! Anything pypi is well outside my current
> knowledge, but I'm definitely open to understanding how it can solve
> this problem.
The idea would be to have a repository of tests that could be downloaded
to any test client.
PyPI is a repository of python packages. It can keep documentation,
versions and dependencies inside its metadata. Tools like pip
(http://pypi.python.org/pypi/pip) or easy_install
(http://pypi.python.org/pypi/setuptools or
http://pypi.python.org/pypi/distribute depending on your preferred
flavor) can pull packages from PyPI and install them locally.
I'm not proposing that we try to use the official PyPI repositories, but
there are PyPI implementations out there that we could use to set up our
own repository. I haven't looked into whether PyPI could support
everything we want to do, but at the moment I'm more interested in the
concept.
Instead of having to deal with numerous git repositories that we have
absolutely no control over, this would allow us to have all of our tests
in a single location. Test clients could check for the most recent
version of a test prior to running and other users could install any
individual test on their system to run without having to install ALL of
the tests.
As an example:
Something like 'pip install -i http://repositoryoftests.fp.org/
magical_pony_test' would install the magical_pony_test test bundle on a
system.
As another part of this, I think it would be wise to set up some sort of
CI system to pull in tests from various version control systems
(fedorahosted git/hg/svn, github, bitbucket etc.), package them and
update the repository. This way, we wouldn't have to worry about
interfacing directly with any version control system and specifically
multiple version control systems (assuming that we didn't force just
one). This way, we could have fewer requirements around the tests.
I don't think that we have enough tests at the moment to justify this
level of infrastructure, but I sincerely hope that we do have enough to
justify something like this in the near future.
Tim
13 years, 3 months
autoqa-0.4.4 deployed!
by James Laska
Congrats everyone!
I just deployed an updated autoqa-0.4.4-1 into production. Stay tuned
for any issues that surface.
Thanks,
James
13 years, 3 months
Concerns over patch for #265 - Create function to download RPMs from koji for given NVR
by Tim Flink
kparal and I had a discussion in IRC around the changes currently
proposed in my patch for #265 - Create function to download RPMs from
koji for given NVR. I am summarizing the conversation here.
- koji_utils is an extraordinarily difficult class to test due to the
way that it is currently written and as such, was a poor choice for a
testing proof-of-concept.
- The refactoring in koji_utils decreases the functionality in the class
- The advantages brought by the refactoring are not trivial to
visualize and mostly affect the testability of the code
- tflink did miss a side-effect while testing that would break
upgradepath
The current plan of action is:
- tflink will rewrite the code for #265 in order to not change
koji_utils
- testing will start with simpler code, if possible
- a ticket will be filed to deal with the testability issues in
koji_utils.
Let us know if you have any other ideas/concerns/etc. I will be
submitting a new patch for #265 in the next day or so.
Tim
13 years, 3 months
[AutoQA] #279: depcheck: KeyError: 'visualvm-1.3.1-3.fc14'
by fedora-badges
#279: depcheck: KeyError: 'visualvm-1.3.1-3.fc14'
--------------------+-------------------------------------------------------
Reporter: jlaska | Owner: jskladan
Type: task | Status: new
Priority: major | Milestone: 0.4.4
Component: tests | Keywords:
--------------------+-------------------------------------------------------
{{{
Packages skipped because of dependency problems:
visualvm-1.3.1-3.fc14.x86_64 from f14-updates-testing
visualvm-1.3.2-1.2.7.fc14.x86_64 from pending
REJECT: visualvm-1.3.1-3.fc14.x86_64 visualvm-1.3.2-1.2.7.fc14.x86_64
ACCEPT: backintime-gnome-1.0.6-1.fc14.noarch xine-lib-
devel-1.1.19-2.fc14.2.i686 2:postfix-2.7.3-1.fc14.x86_64
rawstudio-1.2-10.fc14.20110226svn3835.x86_64 directfb-1.4.11-3.fc14.i686
puddletag-0.10.0-1.fc14.noarch docky-devel-2.0.12-1.fc14.i686 backintime-
common-1.0.6-1.fc14.noarch tintin-2.00.6-1.fc14.x86_64 docky-
devel-2.0.12-1.fc14.x86_64 ghc-ForSyDe-prof-3.1.1-4.fc14.x86_64 ghc-
ForSyDe-devel-3.1.1-4.fc14.x86_64 ghc-ForSyDe-devel-3.1.1-4.fc14.i686
perl-voms-server-0.11-1.fc14.noarch directfb-1.4.11-3.fc14.x86_64 perl-
VOMS-Lite-0.11-1.fc14.noarch docky-2.0.12-1.fc14.x86_64 backintime-
kde-1.0.6-1.fc14.noarch perl-VOMS-Lite-tests-0.11-1.fc14.noarch tintin-
doc-2.00.6-1.fc14.noarch directfb-devel-1.4.11-3.fc14.x86_64 xine-lib-
devel-1.1.19-2.fc14.2.x86_64 xine-lib-extras-1.1.19-2.fc14.2.i686 tzdata-
2011b-3.fc14.noarch 2:postfix-perl-scripts-2.7.3-1.fc14.x86_64 perl-
Package-DeprecationManager-0.10-3.fc14.noarch jpilot-1.8.0-2.fc14.x86_64
xine-lib-1.1.19-2.fc14.2.x86_64 rawstudio-1.2-10.fc14.20110226svn3835.i686
ghc-ForSyDe-3.1.1-4.fc14.x86_64 xine-lib-1.1.19-2.fc14.2.i686 xine-lib-
extras-1.1.19-2.fc14.2.x86_64 directfb-devel-1.4.11-3.fc14.i686 scap-
workbench-0.2.3-1.fc14.noarch vifir-0.8-1.fc14.x86_64 tzdata-java-
2011b-3.fc14.noarch
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/autoqa/decorators.py", line 71,
in newf
f_result = f(*args, **kwargs) #call the decorated function
File "/usr/share/autotest/tests/depcheck/depcheck.py", line 133, in
run_once
rejected_builds = set([pending_parent_map[nvr] for nvr in
rejected_nvrs])
KeyError: 'visualvm-1.3.1-3.fc14'
}}}
Complete log available at
http://test1186.test.redhat.com/results/104-autotest/test189.test.redhat....
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/279>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
[PATCH] Add --tag|-t option to watch-koji-builds.py
by James Laska
While debugging watch-koji-builds.py output, it was helpful to add a
command-line option to limit the koji tags searched. This patch adds support
for a --tag|-t option that, when provided, only schedules jobs for the provided
tags. The provided tags must also exist in repoinfo.conf.
---
hooks/post-koji-build/watch-koji-builds.py | 41 +++++++++++++++++++---------
lib/python/config.py | 8 +++++-
lib/python/repoinfo.py | 2 +-
3 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/hooks/post-koji-build/watch-koji-builds.py b/hooks/post-koji-build/watch-koji-builds.py
index eaf8ff7..9469a94 100755
--- a/hooks/post-koji-build/watch-koji-builds.py
+++ b/hooks/post-koji-build/watch-koji-builds.py
@@ -40,7 +40,7 @@ class KojiWatcher(object):
cachedir = '/var/cache/autoqa/watch-koji-builds/'
cachefile = os.path.join(cachedir, 'koji_history_prevtimes.cache')
- def __init__(self, verbose = False, dry_run = False, prevtime = None):
+ def __init__(self, verbose = False, dry_run = False, prevtime = None, only_tags = []):
self.dry_run = dry_run
self.verbose = verbose
@@ -63,11 +63,12 @@ class KojiWatcher(object):
self.prevtimes = {} # if this is empty, default_prevtime is used (see list_new_builds)
if self.verbose:
print "Loading taglist"
- self.taglist, self.master_repos, self.pending_repos = self._load_repoinfo() # returns tuple of sets
+ self.taglist, self.master_repos, self.pending_repos = self._load_repoinfo(only_tags) # returns tuple of sets
- def _load_repoinfo(self):
+ def _load_repoinfo(self, only_tags=[]):
"""
- Loads the tags from repoinfo.conf using autoqa.repoinfo.
+ Loads the tags from repoinfo.conf using autoqa.repoinfo. If only_tags
+ is provided, only the tags provided will be used.
returns (taglist, master_repos, pending_repos)
taglist = Set of all tags found in repoinfo
@@ -79,14 +80,23 @@ class KojiWatcher(object):
"""
+ def is_tag_requested(tag, only_tags):
+ '''
+ If only_tags is non-empty, returns whether the provided tag is
+ a member of only_tags.
+ if only_tags is empty, returns True
+ '''
+ return not only_tags or tag in only_tags
+
taglist = set()
master_repos = set()
pending_repos = set()
for repo in repoinfo.repos():
# Always include the tag for the development branch (aka rawhide)
if repoinfo.get(repo, "collection_name") == "devel":
- taglist.add(repoinfo.get(repo, "tag"))
-
+ tagname = repoinfo.get(repo, "tag")
+ if is_tag_requested(tagname, only_tags):
+ taglist.add(tagname)
else:
'''
for all the repos do:
@@ -98,13 +108,15 @@ class KojiWatcher(object):
NOTE: This assumes that updates are tagged in the format 'dist-fNN-updates-candidate'
'''
if len(repoinfo.getparents(repo)) == 0:
- reponame = repoinfo.get(repo, "tag") + "-updates-candidate"
- taglist.add(reponame)
- master_repos.add(repoinfo.get(repo, "tag")) #save the 'master' repo for later filtering
+ tagname = repoinfo.get(repo, "tag") + "-updates-candidate"
+ if is_tag_requested(tagname, only_tags):
+ taglist.add(tagname)
+ master_repos.add(repoinfo.get(repo, "tag")) #save the 'master' repo for later filtering
else:
- reponame = repoinfo.get(repo, "tag") + "-pending"
- taglist.add(reponame)
- pending_repos.add(reponame)
+ tagname = repoinfo.get(repo, "tag") + "-pending"
+ if is_tag_requested(tagname, only_tags):
+ taglist.add(tagname)
+ pending_repos.add(tagname)
if self.verbose:
print "\ntaglist:", sorted(taglist), "\n\n", "pending_repos:", sorted(pending_repos), "\n"
@@ -490,6 +502,9 @@ if __name__ == '__main__':
tags for new builds and kick off tests when new builds/packages are found.')
parser.add_option('--dryrun', '--dry-run', action='store_true',
help='Do not actually execute commands, just show what would be done')
+ parser.add_option('-t', '--tag', action='append',
+ type='string', default=[], dest="tags",
+ help='Only look for builds in the specified koji tags (default: all)')
parser.add_option('-p', '--prevtime', action='store',
type='float', default=None,
help='How far back to look for new builds (seconds since last epoch)')
@@ -499,7 +514,7 @@ tags for new builds and kick off tests when new builds/packages are found.')
try:
- watcher = KojiWatcher(verbose = opts.verbose, dry_run = opts.dryrun, prevtime = opts.prevtime)
+ watcher = KojiWatcher(verbose = opts.verbose, dry_run = opts.dryrun, prevtime = opts.prevtime, only_tags = opts.tags)
exit_status = watcher.run()
except KeyboardInterrupt:
13 years, 3 months