[Rpm-ecosystem] Testing the Dependency Chain

Pavel Odvody podvody at redhat.com
Mon Aug 24 12:03:53 UTC 2015


On Mon, 2015-08-24 at 11:29 +0200, Michael Schroeder wrote:
> On Fri, Aug 21, 2015 at 06:21:37PM +0200, Pavel Odvody wrote:
> > First we need to build the container image that will serve as a basis
> > for our test environment.
> >   
> >   $ git clone https://github.com/shaded-enmity/richdeps-docker
> >   $ cd richdeps-docker/
> >   $ docker build -t richdeps:1.0.0 .
> > 
> > The git repo already contains one testing repository and a few test cases.
> > So let's try the first one:
> > 
> >   $ ./test-launcher.py tests/test1.json
> >   Loading test configuration from:
> >    tests/test1.json
> >   Starting container:
> >    docker run -i -v /home/podvody/Repos/richdeps-docker/repos/test-1:/repo:Z richdeps:1.0.0
> > 
> >   OK
> > 
> > The test succeeded as expected, we installed a package TestA which
> > requires (TestB | TestC), and recommends TestC -- packages TestA and
> > TestC were installed.
> > 
> > The output of the second test is quite lengthy since it fails:
> > 
> >   $ ./test-launcher.py tests/test2.json
> >   (see output at: http://pastebin.com/hb61xrNX)
> > 
> > The test failed since we installed TestB before TestA, and 
> > installing TestA then also installed TestC, which was only in
> > Recommended, and the (TestB | TestC) requirement was already satisfied.
> 
> As you're basically testing libsolv, you might as well use libsolv's
> testcase support. Your first test is:
> 
> repo system 0 testtags <inline>
> repo repo1 0 testtags <inline>
> #>=Pkg: TestA 1 1 noarch
> #>=Req: TestB | TestC
> #>=Pkg: TestB 1 1 noarch
> #>=Pkg: TestC 1 1 noarch
> system x86_64 rpm system
> poolflags implicitobsoleteusescolors
> job install name TestA
> result transaction,problems <inline>
> #>install TestA-1-1.noarch at repo1
> #>install TestC-1-1.noarch at repo1
> 
> The second one (that fails) is:
> 
> repo system 0 testtags <inline>
> #>=Pkg: TestB 1 1 noarch
> repo repo1 0 testtags <inline>
> #>=Pkg: TestA 1 1 noarch
> #>=Req: TestB | TestC
> #>=Pkg: TestB 1 1 noarch
> #>=Pkg: TestC 1 1 noarch
> system x86_64 rpm system
> poolflags implicitobsoleteusescolors
> job install name TestA
> result transaction,problems <inline>
> #>install TestA-1-1.noarch at repo1
> 
> I.e. "TestB" was also added to the installed repo section.
> 
> $ ./testsolv test2.t
> Results differ:
> +install TestC-1-1.noarch at repo1
> 
> Note that it no longer fails if you add a
>     solverflags ignorerecommended
> line.
> 
> Cheers,
>   Michael.
> 

That looks interesting, Michael.
Can this framework do without actually writing all the specfiles?

Is there a documentation for the *.t file syntax or do I have to
reverse-engineer that from tests/* ? :)

-- 
Pavel Odvody <podvody at redhat.com>
Software Engineer - EMEA ENG Developer Experience
5EC1 95C1 8E08 5BD9 9BBF 9241 3AFA 3A66 024F F68D
Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.rpm.org/pipermail/rpm-ecosystem/attachments/20150824/f826a2bc/attachment.asc>


More information about the Rpm-ecosystem mailing list