[csw-maintainers] GAR: Basic custom tests for packages
Maciej (Matchek) Blizinski
maciej at opencsw.org
Mon Jan 11 17:56:10 CET 2010
On Thu, Oct 22, 2009 at 8:12 AM, Dagobert Michelsen <dam at opencsw.org> wrote:
> 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.
Can a hook be created between the prototype creation and the package
creation? Say, just after the creation of the per-package prototype
files, so that I can also check that certain files have landed in the
specific packages.
>>> 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
How do I know I'm in the global modulation?
> 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:
I've been recently bitten by something that would've been prevented
easily using this kind of a test, so I'll get back to it soon.
Maciej
More information about the maintainers
mailing list