RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Choosing a test harness ...

From: Anders F Björklund <afb@rpm5.org>
Date: Fri 31 Aug 2007 - 16:57:34 CEST
Message-Id: <e8731153428c9d37deacd5809f6fb5ab@rpm5.org>
Jeff Johnson wrote:

> My personal preference (today expect quixotic behavior) would be to 
> replace
> the test-harness driver with devtool, and add some additional stanzas 
> to generate
> test manifests using the globs from trpm.
>
> But I'd like to see any harness rather than none.

I found some basic bugs with "rpm --version", "rpmbuild -ba zlib.spec",
and by running the two scripts that I call "rpmqa.py" and "rpmqa.pl":

#!/usr/bin/perl

use RPM;

my $ts = RPM::Transaction->new();
my $it = $ts->packageiterator();

while (my $pkg = $it->next() ) {
    print $pkg->tag('name') . "-" . $pkg->tag('version') . "-" . 
$pkg->tag('release') . "\n";
}

$ts->closedb();
undef $ts;

#!/usr/bin/python

import rpm

ts = rpm.TransactionSet()
mi = ts.dbMatch()

for h in mi:
	print "%s-%s-%s" % (h['name'], h['version'], h['release'])

And a similar thing using the C API called "rpmqa.c" which is much
too long and boring to quote here, but looks pretty much the same.

--anders
Received on Fri Aug 31 16:57:36 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.