[Rpm-ecosystem] Testing the Dependency Chain

Michael Schroeder mls at suse.de
Mon Aug 24 09:29:19 UTC 2015


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.

-- 
Michael Schroeder                                   mls at suse.de
SUSE LINUX GmbH,           GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}


More information about the Rpm-ecosystem mailing list