215 Commits

Author SHA1 Message Date
Zuul
35f34ffdab Merge "New location of the default log directory." 1.2.0 2021-06-10 21:51:39 +00:00
Jiri Podivin
f07c8e73bb New location of the default log directory.
Json callback now expects the log directory to
be $HOME/validations. Just as defined in the validations libs.

Depends-On: https://review.opendev.org/c/openstack/validations-libs/+/795093

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Id1d39fd907eb154a601da68e9f75756cccfbf91c
2021-06-09 14:26:19 +02:00
Jiri Podivin
ecc67950bb functools provide reduce instead of the ansible
The ansible 'reduce' function is itself imported from the functools:
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/six/__init__.py#L273

And thus provides exactly the same functionality.
Furthermore, the functools is part of python lib since 2.7,
so the result should be compatible across all of our releases.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I981512fa81f0eb2aac0a50a4709c517cce794fa8
2021-06-09 13:07:07 +02:00
Zuul
f4c7f00120 Merge "Renamed variable to something more illuminating." 2021-06-06 19:11:16 +00:00
Gael Chamoulaud (Strider)
92f51eadc7
Update Validations Framework IRC channels
This patch updates the information about the `#tripleo` IRC channel
after the OFTC migration and adds our brand new channel at Libera named
`#validation-framework`.

Change-Id: I48e856b688b9e724ca49858d4aca0d3f32ca2de2
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-06-04 10:04:39 +02:00
Zuul
3a087532e6 Merge "Python 2.7 environment, mimicking the one used by RDO" 2021-06-04 07:10:36 +00:00
Jiri Podivin
2e3e7f3f2b Renamed variable to something more illuminating.
The variable storing start time of playbook run was named 't0'.
While perfecly fine from a functional standpoint,
and also in statistics and physics with subscript,
it is nonetheless a bit hard on the eye.

Tests were adjusted to reflect new var name.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ie0796b1dcb8beacc08755fa04ff3cd4dd884ef59
2021-06-03 08:40:04 +02:00
Gael Chamoulaud (Strider)
4b87cf203b Bump molecule to 3.3.1
This patch also adds molecule-podman driver as a requirement
because molecule >=3.2 stopped installing it by default.

Change-Id: Icf249d47496588a966ffd13b5affebada95d33d0
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-27 09:36:14 +00:00
Gael Chamoulaud (Strider)
4ee27890e3 Trigger molecule jobs when modifying the following files
- ^tests/prepare-test-host.yml
- ^playbooks/molecule/pre.yml
- ^playbooks/molecule/run.yml
- ^molecule-requirements.txt

Change-Id: I765a1e9f1ca7bf5b9cc0803287f0a4b7f1b25e89
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-27 09:35:40 +00:00
Zuul
879be1395c Merge "Rename local variable component to validation_component for Upstream CI" 2021-05-27 07:38:43 +00:00
matbu
3a5e0de20b Rename local variable component to validation_component for Upstream CI
The usage of the component variable for the local and check jobs is
dangerous since this variable is used by the whole component chain for TripleO.
This review renamed it to validation_component.

Change-Id: Icd8e64282306479a84fc6240142ddcb28ce433e5
2021-05-26 15:03:02 +02:00
Gael Chamoulaud (Strider)
dbb069fe0a
Remove Jinja2 constraint
This patch relaxes the Jinja2 constraint since they recently released
the 3.0.1 and this latter is in the upper-constraints.

Related-Bug: #1929420

Change-Id: I55bd4ad75a925e5bdcb13b235dd2ee6f756ab318
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-26 12:29:34 +02:00
Zuul
d0d7da08ed Merge "Reqcheck job for upstream validations-common" 2021-05-21 08:08:16 +00:00
Zuul
f952daa740 Merge "Adds dockerignore to the repo" 2021-05-21 05:02:45 +00:00
Jiri Podivin
8cf7b42bd3 Licences are now listed for all requirements.
All required packages now have licence listed
next to their respective designations.

Licence information was pulled from pip show command
or from package repository, in cases where pip didn't
offer sufficient information.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I296be2577c85a33c91e2156ec1b36762526d599c
2021-05-20 09:33:32 +00:00
Jiri Podivin
1d2149e934 Unblocking the openstack-tox-docs job.
Fixing indentation error breaking openstack-tox-docs

Adjusts openstack-tox-docs job to be triggered by
the validations_common directory changes.

Introducing upper-requirements constraint to the
doc build dependencies.

Adjusts ansible_autodoc to handle missing molecule confs.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I8021f786476b61bbf88bf21a1151ce3198f7abbd
2021-05-20 09:56:52 +02:00
Jiri Podivin
1167633793 Adds dockerignore to the repo
Addition of .dockerignore considerably reduces the size
of newly created containers, as well as time needed for
building them.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ifa94774862c2364483454a648377b0f333b72b99
2021-05-20 05:01:28 +00:00
Zuul
ae6c7e506d Merge "Remove workaround for tox-ansible and global molecule config" 2021-05-19 20:05:00 +00:00
Zuul
b27a31532d Merge "Add testing for custom callback feature" 2021-05-19 19:02:00 +00:00
Zuul
349a7f0b8f Merge "Temporary fetch logs adjustement to detect log folder" 2021-05-19 16:44:51 +00:00
Jiri Podivin
2ae6e68d36 Reqcheck job for upstream validations-common
Zuul job queries the requirements.txt and the relevant
spec file using the `rdopkg reqcheck` to find discrepancies
in the listed dependencies.

Just like the original `rdopkg-reqcheck` this job is non-voting.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I45043407b38bdcd0c0a38b30b65b5d5f70cae76d
2021-05-19 15:20:08 +02:00
Zuul
45a525037b Merge "File validation extended to callback_plugins, main loop optimized" 2021-05-18 08:38:02 +00:00
Jiri Podivin
48c99bdcf8 Temporary fetch logs adjustement to detect log folder
fetch_validations role detects presence of the new
log folder, created via the new log path mechanism
introduced in the 36c9b8cbcbdfe35ba9b10b72c5b52a56c4ce9099
of the validations-libs.

The task should be removed once the related validations-libs
patch is safely merged.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I1a49dc16f65652ad7b1d9736d333c502d563870a
2021-05-18 08:45:26 +02:00
Zuul
5f94808a17 Merge "Fix targeting hosts to 'localhost' instead of 'all'" 2021-05-18 01:48:54 +00:00
Zuul
7dc3bacd55 Merge "Fix callback_type for validation_json.py" 2021-05-18 01:48:48 +00:00
Zuul
d5e75e0791 Merge "Bump pre-commit repositories" 2021-05-18 01:30:23 +00:00
Zuul
f275f808ca Merge "Sync is no longer loopy" 2021-05-18 01:23:38 +00:00
Jiri Podivin
f1ce73f1c8 File validation extended to callback_plugins, main loop optimized
validate-files.py now also checks required attributes
of callback plugins. At this time, only two commonly used
attributes are checked, because not all of our plugins
correctly declare type and documentation.

Main loop of the script was adjusted to work with multiple
types of files to validate, and to minimize unnecessary checks.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I2c92b77f127a82afaf28a3dd5ebfb9e3614bbb07
2021-05-17 15:29:27 +02:00
Jiri Podivin
4fc2ef2b41 Added the 'CALLBACK_NEEDS_WHITELIST' attribute.
Value set to 'True' in order to prevent writing to
our logging dir by other processes using ansible callback
handling routines.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I6e13a6b42ba97b5ce850bc8c37d112ada7c09cd2
2021-05-17 10:46:58 +02:00
Gael Chamoulaud (Strider)
1f3c0d2e7b
Remove workaround for tox-ansible and global molecule config
[1] has been merged and released[2] in upstream tox-ansible and it is now
able to manage global molecule configuration. The workaround, which
consisted in adding the molecule driver name in each scenarios
molecule.yml files, is not necessary anymore.

This patch also removes all the relative symlink to the Dockerfile and
adds directly in the global molecule configuration file.

[1] https://github.com/ansible-community/tox-ansible/pull/89
[2] https://github.com/ansible-community/tox-ansible/releases/tag/v1.5.0

Change-Id: I8ac3f731c9d6af983dd902fc94e06a07c2ab9954
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-17 09:34:32 +02:00
Zuul
7f196ad2bd Merge "Update of validate-files script" 2021-05-14 20:26:10 +00:00
Gael Chamoulaud (Strider)
01842ab1b4
Fix callback_type for validation_json.py
'agregate' callback type is not an official callback type for
Ansible. It should be 'aggregate' with two g instead of one.

This patch fixes that issue.

Change-Id: Ieb1554a455017a0ed8c252fe414ea7479544a028
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-14 09:37:35 +02:00
Zuul
98b33a6448 Merge "Simple tests for validation_json callback." 2021-05-13 16:06:15 +00:00
Zuul
81ec82fd4c Merge "Artifacts directory path is now set in a variable" 2021-05-13 16:05:13 +00:00
Gael Chamoulaud (Strider)
4a05320ddf
Add testing for custom callback feature
This patch adds a custom callback to the execution of the check-cpu and
check-ram validations.

Change-Id: Ic9391998dcad74dd82cab4c29de46343663225c6
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-12 10:42:15 +02:00
Zuul
a9538a3ccd Merge "Disabling strict mode for ConfigParser in read_ini" 2021-05-11 18:44:55 +00:00
Zuul
328416ee61 Merge "ConfigParser exeption message should be returned" 2021-05-11 18:44:41 +00:00
Zuul
74ec790780 Merge "Test for callback initiation." 2021-05-11 18:44:17 +00:00
Gael Chamoulaud (Strider)
5de26bd27f
Fix targeting hosts to 'localhost' instead of 'all'
This patch fixes the targeting hosts for the validations which should be
executed locally.

Rationale: When those validations are executed in the TripleO world,
they are executed on all the nodes including the Overcloud nodes. For
instance, check-ram and check-cpu validations check the Red Hat
recommendations for the Undercloud only and shouldn't be checking the
Overcloud nodes.

Change-Id: Icca554ea4392c3b0b572b27c2e2370b11f8013d7
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-11 11:44:12 +02:00
Jiri Podivin
771eacc0b6 Sync is no longer loopy
Sync doesn't loop over the dir, instead it pulls
all files directly.

There is no need for loop in this case,
as we have only one element to iterate over.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I05606bfdb7fb2191cfe7590a432b7817b3cb35f2
2021-05-07 14:54:48 +02:00
Jiri Podivin
6dfba5189c Artifacts directory path is now set in a variable
The artifact directory where we collect details of
the validations execution from the ansible perspective
is now set as a variable, with the default value
in defaults/main.yaml

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I52d0bf261dd8eeeeb2817cd8f833937ef3c7ab93
2021-05-07 12:52:13 +02:00
Zuul
598869bb06 Merge "Improved test coverage for library/advanced_format.py" 2021-05-06 19:39:07 +00:00
Zuul
de5ffe4a79 Merge "Improved test coverage for library/warn.py" 2021-05-06 19:38:35 +00:00
Zuul
a22b0ccaaf Merge "Add shared configuration for all molecule test" 2021-05-06 19:38:32 +00:00
Jiri Podivin
bafce83c81 Simple tests for validation_json callback.
Callbacks might undergo significant changes
in the near future. Tests will have to be adjusted.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I79ea4d8d07f8cb851af1d0c1fd4dec3ab3c6709c
2021-05-06 13:33:26 +02:00
Jiri Podivin
29575dda05 Test for callback initiation.
Checks for presence of required atributes,
basic functionality of the init method
and the current_time module function.

Closes-Bug: #1922726

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I2e9a4640fad0f9c44b5503d53ea2613a416c6e18
2021-05-06 10:47:18 +02:00
Zuul
97d82bfeaa Merge "Superfluous imports are now mocked" 2021-05-05 19:20:29 +00:00
Gael Chamoulaud (Strider)
e15b080bb0
Bump pre-commit repositories
This patch bumps the following tools:
- pre-commit-hooks[1] to v3.4.0
- yamllint[2] to v5.0.8
- ansible-lint[3] to v5.0.8
- bashate[4] to 2.0.0

And adds pycqa/flake8:
- flake8[5] to 3.9.1

[1] - https://github.com/pre-commit/pre-commit-hooks
[2] - https://github.com/adrienverge/yamllint
[3] - https://github.com/ansible-community/ansible-lint
[4] - https://github.com/openstack-dev/bashate
[5] - https://gitlab.com/pycqa/flake8

Change-Id: I96228d3f05cf27167dc602ac0f264c36ca4cb7d9
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-05 15:47:54 +02:00
Gael Chamoulaud (Strider)
6243262f1e
Add shared configuration for all molecule test
This patch adds a molecule configuration file at the repository
level (validations-common/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in validations-common/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - https://github.com/ansible-community/tox-ansible/issues/88).

Change-Id: I907e2a13a3ba3b152ad7036fa1bb249bec980b76
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
2021-05-05 11:59:40 +02:00
Zuul
c9e4f37707 Merge "Fetch all Validations, json and log files with CI role" 2021-05-05 01:19:14 +00:00