Bug#1008267: pkg-perl-autopkgtest: use.t: reading debian/tests/pkg-perl/use-whitelist too restrained?

Niko Tyni ntyni at debian.org
Sat Mar 26 14:22:29 GMT 2022


On Fri, Mar 25, 2022 at 06:25:16PM +0100, gregor herrmann wrote:
> Package: pkg-perl-autopkgtest
> Version: 0.34
> Severity: normal

> I just had an issue with our use.t and
> debian/tests/pkg-perl/use-whitelist, and after reading the code, it
> seems to me that there is a bug (since forever). What I did was to
> add a second warning I wanted to ignore to use-whitelist, and
> autopkgtest still failed, so I added a few print statements to use.t
> and found that it only had one word from the whitelist file.

Thanks for catching this.

Reading #845771 I think it was intentionally just one line. OTOH the
documentation in autopkgtest.pod has always said "expected warnings can
be listed as regular expressions", where the plural does not correspond
to reality.  So there is a bug, we just need to decide where :)

I suppose all use cases could be expressed in one regexp with '|'
alternation, but allowing multiple lines with separate comments gives
a much cleaner and self documenting file. So I'm all for that.

> Now even if only reading one line is ok, as this is used as a regexp
> in line 106, /(\S+)/ seems a bit, hm, minimalistic.

I assume you're referring to not allowing whitespace in the pattern?
Yeah I think that's a bug. I think I'd prefer to keep all whitespace
and any other words on the same line.

Not sure how much we need to worry about compatibility with existing
files with currently ignored whitespace or multiple words.

Also, while looking at the code, I can't see any reason for limiting
use-name to just one name either. The main test already handles multiple
modules if they come from @ARGV.

Similarly for whitespace in use-name. The name is interpolated into
a shell command, but \S doesn't protect from anything and the source
package can run arbitrary code inside the testbed by design.

I've filed MR !16 with a lightly tested fix. Please review and feel
free to merge if it looks good.

 https://salsa.debian.org/perl-team/modules/packages/pkg-perl-tools/-/merge_requests/16

-- 
Niko



More information about the pkg-perl-maintainers mailing list