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

Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control



On 2012-11-23 23:42, Nicolas Boulenguez wrote:
> Package: lintian
> Version: 2.5.10.2
> Tags: patch
> Followup-For: Bug #692282
> 
> Please consider the attached patch.
> 

Hi,

Thanks for looking at writing at a patch and sorry for the delay in
getting back to you.

I hope I can convince you to do a couple of minor changes to your
original patch.  As Christoph mentioned, the value of the header should
be "autopkgtest".
  Secondly, it would probably be a good idea to move this to
checks/fields and use "$info->field ('testsuite')" instead of
"$info->source_field ('xs-testsuite')"[1].  Note that checks/fields is
also applied to binary packages, so a "if ($type eq 'source')" is needed.

> 
> lintian.diff
> 
> 
> diff -rNu ../old/lintian-2.5.10.2/checks/control-file ./checks/control-file
> --- ../old/lintian-2.5.10.2/checks/control-file	2012-09-17 11:56:05.000000000 +0200
> +++ ./checks/control-file	2012-11-23 23:31:07.000000000 +0100
> @@ -265,6 +265,10 @@
>      }
>  }
>  
> +if (defined $info->source_field ('xs-testsuite')
> +    xor -e $info->debfiles('tests/control')) {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This has a minor issue in that tests or tests/control could be a symlink
pointing to some "system" file, which could be used to disclose the
existance of a given file on the system running Lintian.

> +    tag 'inconsistent-xs-testsuite-field'; }
> +
>  }
>  
>  
> diff -rNu ../old/lintian-2.5.10.2/checks/control-file.desc ./checks/control-file.desc
> --- ../old/lintian-2.5.10.2/checks/control-file.desc	2012-09-17 11:56:05.000000000 +0200
> +++ ./checks/control-file.desc	2012-11-23 22:13:12.000000000 +0100
> @@ -200,3 +200,15 @@
>  Info: The control file contains commented-out VCS-* lines, most
>   probably a result of dh_make. These URLs should either be valid and
>   uncommented, or removed.
> +
> +Tag: inconsistent-xs-testsuite-field
> +Severity: wishlist
> +Certainty: certain
> +Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests;hb=HEAD
> +Info: A debian/tests/control file exists, but no "XS-Testsuite: autopkgtest"
> + header is present in the source stanza of debian/control, or the header
> + exists but not the file.
> + .
> + For discoverability, packages shipping tests for the autopkgtest
> + testing framework should declare their presence using an
> + "XS-Testsuite: autopkgtest" header in debian/control.

A good description, though assuming the migration to $info->field the
tag name should probably change and the description would need a few
minor adjustments (s/XS-// s,debian/control,.dsc file, etc.)

The alternative to moving this to checks/fields could be to make a
dedicated "testsuite"-check, that would also do checking of the tests
control file(s).

~Niels

[1] Rationale for:
 * using $info->field ('testsuite')
   - It tests the field in the .dsc file rather than the d/control.  If
     this field is added automatically by some tool (e.g. dpkg-source)
     in the future, the check will still produce the right result
 * moving it to checks/fields
   - It is where most of our checks for .dsc fields are.


Reply to: