[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#755040: apt: fix tests failing on ci.debian.net



Hi,

On Sat, Sep 06, 2014 at 12:52:01PM +0200, David Kalnischkies wrote:
> First an observation I should probably report as a bug against debci
> instead, but I will mention it anyhow: debci (and/or the stuff below)
> seems to not "protect" itself against an agressive umask. I have 027 on
> my test system so I get various permission issues for files created by
> 'debci setup' in the chroot like the config files for apt/dpkg.
> Following the documentation to the letter gives me as the configured
> normal user even with a less agressive umask setup of 022 a python
> traceback anyhow, but it runs as root so enough "complaining" for now:

Fair enough. Please do report a bug.

> The problem is that the tests pass on my system, while they fail on
> ci.d.n.  Specifically just one testcase:
> >>>>
> Run Testcase (13/141) test-apt-get-changelog
> […]
> Test for correctness of file apt.changelog … 
> -::::::::::::::
> -/tmp/apt-changelog-xnLT3Schangelog
> -::::::::::::::
>  apt (1.0) stable; urgency=low
>  
>    * Initial release
> FAIL
> […]
> <<<<
> 
> What the test does is redirecting the output of "apt-get changelog" to
> a file and compare that file with what should have been downloaded. The
> command uses the sensible-pager to display the file and in the ci.d.n
> tests the configured pager seems to issue this "helpful" header while it
> doesn't if you run the tests at home. I was told that on the ubuntu
> instance this works as well (beside that it works on travis-ci and my
> buildbot instance), so while we could workaround this of course,
> I wonder if this shouldn't "just work" and there is something wrong in
> the setup of ci.d.n or am I just not seeing the elephant in the room…
> After all, I doubt apt is the only command which runs stuff through
> a pager at times.

I think you should use explicitly the pager you know gives you the exact
output you want, or at least make the tests depend on it (assuming it
being installed makes sensible-pager use it by default).

IMO it is not reasonable to expect the sensible-* wrappers to give you
the exact interface you want no matter what actual tool is being
invoked. Assuming sensible-pager to always produce exactly the output
that less would produce seems to equivalent to assuming sensible-editor
will always give you a vi-compatible user interface, or that
sensible-browser will always give you a window that is visually
identical from the iceweasel user interface.

Another point, perhaps more important, would be that an automated test
suite is something that is mainly supposed to run unattended, so using a
pager at all does not look like a good decision to me. If you want the
contents of a file to show up in the test logs, you might want to use
just `cat`, or even `tee` exactly at the point where the file is
created:

  apt-get changelog | tee /path/to/file

-- 
Antonio Terceiro <terceiro@debian.org>

Attachment: signature.asc
Description: Digital signature


Reply to: