From cceaac7b862156ec0e5b3191edf0d87911e6c3f0 Mon Sep 17 00:00:00 2001 From: Christian Ardiente Eda Date: Tue, 29 Dec 2020 10:20:26 +0100 Subject: [PATCH] [#46] Static tests instead of parameters --- CHANGELOG.md | 1 + .../molecule/default/tests/test_app.yml | 62 +++++++++---------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a38d69..5455832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ### Added ### Changed - *[#47](https://github.com/idealista/cookiecutter-ansible-role/pull/47) Bump goss version from 0.3.14 to 0.3.16* @vicsufer +- *[#46](https://github.com/idealista/cookiecutter-ansible-role/issues/46) Static tests instead of parameters* @xtianae7 ### Removed ## [2.3.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.3.0) diff --git a/{{cookiecutter.app_name}}_role/molecule/default/tests/test_app.yml b/{{cookiecutter.app_name}}_role/molecule/default/tests/test_app.yml index 7b5b857..ed278f2 100644 --- a/{{cookiecutter.app_name}}_role/molecule/default/tests/test_app.yml +++ b/{{cookiecutter.app_name}}_role/molecule/default/tests/test_app.yml @@ -1,36 +1,36 @@ --- - -file: - {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}: - {% if cookiecutter.has_service == 'True' %} - owner: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %} - group: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %} - {% endif %} - exists: true - filetype: directory -{% if cookiecutter.has_service == 'True' %} -# port: -# # Check port at IPv6 -# # https://github.com/aelsabbahy/goss/issues/177 -# tcp6:{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_port {% raw %}}}{% endraw %}: -# listening: true -# ip: -# - '::' - service: {{ cookiecutter.app_name }}: enabled: true running: true -process: - {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}: - running: true -user: - {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}: - exists: true - groups: - - {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %} - shell: /usr/sbin/nologin -group: - {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}: - exists: true -{% endif %} \ No newline at end of file +## Goss Documentation: https://github.com/aelsabbahy/goss/blob/master/docs/manual.md +## Minimum recommended tests to have in every role +# process: +# exec_name: +# running: true +# user: +# example_user: +# exists: true +# groups: +# - example_group +# shell: /usr/sbin/nologin +# group: +# example_group: +# exists: true +# +## Tests to check if the needed directories were created propperly +# file: +# bin_path: +# owner: example_user +# group: % example_group +# exists: true +# filetype: directory +# +## Check if ports are really exposed +# port: +# # Check port at IPv6 +# # https://github.com/aelsabbahy/goss/issues/177 +# tcp6:: +# listening: true +# ip: +# - '::'