Welcome! Log In Create A New Profile

Advanced

Re: Improving Config Validation Testing

Maxim Dounin
June 29, 2010 11:38AM
Hello!

On Tue, Jun 29, 2010 at 03:47:24PM +0100, Hassan Syed wrote:

> I am wondering if there is anything in the pipeline that may ease config
> validation testing. The use-case I am currently working on is testing the
> validity of config for a certain module. If for a particular location a
> module is active, than a certain other directives should be present, and if
> they are present it should be possible to test for some other predicates at
> runtime (for example files on the file-system, where filenames are specified
> as directives for the module).

Normally cross-directive dependencies are hand-checked during
configuration merge, see e.g. proxy module for an example.

In some trivial cases dependencies may be checked in command set
or post handlers (but this doesn't work if some dependant
directives may be inherited from upper levels).

> Nginx's out-of-the-box configuration is quite elegant, and it is hard to
> write incorrect config files. And most common settings have default values.
> However in my case I require more validation.
>
> I have hacked together some code to test weather all requisite directives
> have been set (in contrast to checking them one by one, and returning a
> single error at a time). If one or more aren't, the code builds and returns
> a formatted list of missing directives.
>
> I'm just wondering if there is room for modelling such dependencies directly
> in the "ngx_comman_t array" provided when creating a module, and perhaps for
> a general purpose delegate mechanism that would allow other predicates to be
> evaluated at runtime.

I believe introducing some generic mechanism for checking
dependencies would be non-trivial as there are lots of possible
dependencies and lots of possible directive effects. So
eventually you'll end up writing custom checks... and you may
easily do this right now, without even talking about mechanisms.
;)

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Improving Config Validation Testing

hassan.syed 3297 June 29, 2010 10:48AM

Re: Improving Config Validation Testing

Maxim Dounin 1094 June 29, 2010 11:38AM

RE: Improving Config Validation Testing

hassan.syed 1623 June 30, 2010 12:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready