[csw-maintainers] GAR: Basic custom tests for packages

Dagobert Michelsen dam at opencsw.org
Thu Oct 22 10:12:02 CEST 2009


Hi Maciej, hi Ben,

Am 22.10.2009 um 04:44 schrieb Ben Walton:

> Am 22.10.2009 um 01:04 schrieb Maciej (Matchek) Blizinski:
>> Let's suppose I wanted to write some basic checks for a package. For
>> instance, that I expect there to be a certain file in the prototype,
>> with such and such name and such and such attributes (ownership,
>> permissions, etc). I guess I would do something like:
>>
>> TEST_SCRIPTS = custom
>>
>> test-custom:
>>        test code here
>>
>> How do I access things like the prototype, or files at the location
>> from where they're already merged?
>
> I think you'd want to work with the state of things after the merge.
> I don't think the stuff in build-global is guaranteed to be there
> until after that step.  I don't know if there are pre/post merge
> targets though.

Yes. Because the normal cycle for a software is
   configure
   compile
   test
   install
the procedure is the same in GAR. Now to your questions:

>> For instance, that I expect there to be a certain file in the  
>> prototype,
>> with such and such name and such and such attributes (ownership,
>> permissions, etc)

The prototype (if dynamic) is built during 'package' and there is  
currently
no hook in-between after dynamic creation of the packaging source files
and the package creation. You could check after package-creation in
post-package.

>> How do I access things like the prototype, or files at the location
>> from where they're already merged?

 From the global modulation the prototype can be accessed as
   $(WORKDIR)/prototype
and the package specific prototypes as
   $(WORKDIR)/CSWmypkg.prototype

The merge location is available during global or specific modulations as
$(PKGROOT).

I suggest you write your test as post-package to ensure it has been  
built
correctly. However, if it proves useful we could also insert another
step before package creation like
   pkgverify-CSWmypkg:


Best regards

   -- Dago



More information about the maintainers mailing list