[erlang-questions] Paths in Common Test app.config

Roger Lipscombe roger@REDACTED
Sat Nov 18 14:17:02 CET 2017

On 17 November 2017 at 23:21, Fred Hebert <mononcqc@REDACTED> wrote:
> The safe thing to do would be to give the certificates and files required in
> the data_dir for Common Test. This is a directory in test/ with the name
> your_SUITE_data/. In init_per_suite, you can then set the application env
> value:

My problem is that I have several configuration settings that require
filenames, at various levels of nesting. I also kinda wanted to share
the cert files between all of the suites for the application.

>    init_per_suite(Config) ->
>        application:load(your_app),
>        Cert = filename:join([?config(data_dir, Config), "some_cert.crt"]),
>        applicatoin:set_env(your_app, certfile, Cert),
>        Config.

It occurs that it might be possible to do something in a CT hook: it
could recursively look for string values and do $VAR replacements on
them from environment variables, or from that CT hook's options...

> The test can then proceed as usual. If you really want to have the ability
> to 'carry' a file at all times with an app, that tends to be done through
> the priv/ directory of that application.

Sure, but these are explicitly test artifacts; I'm not going to be
keeping the production certificates and keys in the repository
(*those* get installed by, e.g., chef during machine bring-up).

More information about the erlang-questions mailing list