Commit Graph

1045 Commits (59fdd2d1ee44403563ec9dcab2a17038d446dc0f)

Author SHA1 Message Date
Jiri Podivin 59fdd2d1ee Test folder structure rearranged.
Patch prepares ground for further work on tripleo_validations
unit tests.

Datastructures used for testing were factored out.

__init__.py files for lookup plugins and library tests were added.
Together with minimal docstring.

.gitingore was updated to ignore stestr files.

test-requirements.txt and requirements.txt were updated to include
all necessary dependencies

Depends-On: https://review.rdoproject.org/r/c/openstack/tripleo-validations-distgit/+/32545

Closes-Bug: #1922726

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: If67992bec97831cc45b46e33af234a9444c5ae4c
2021-04-19 13:23:31 +02:00
Zuul 06d7104408 Merge "Remove apk and references from bindep.txt" 2021-04-15 14:47:58 +00:00
Zuul 6d3c5e0287 Merge "Rename Dockerfile.j2 to Dockerfile" 2021-04-15 14:47:30 +00:00
Sergii Golovatiuk af9f86a81e Rename Dockerfile.j2 to Dockerfile
Unify check_undercloud_conf deprecated_params testing with all others

Change-Id: I11d7dc75bb0a49961bc72909c5af2db1db378b18
2021-04-15 01:21:41 +02:00
Wes Hayutin aa8d53b1d5 Use a more targeted job for tripleo-validations
* using multinode jobs for validations is too heavy
and uses too much resources
* remove standalone004 - worthless sans rpm build
* add a validations job that targets validations

Change-Id: Ifef837dc884c7338f9396214e36a197cdbb060c6
2021-04-14 14:04:39 -06:00
Wes Hayutin 36b5c707e6 check-ram is not compat w/ upstream
A new check should be added for 8gb
perhaps call it upstream-check-ram

Change-Id: I8fd99f5eceae76b938a5685513c3cf641d82a8d2
2021-04-09 13:47:03 -06:00
Zuul 5848b3030e Merge "Removes retired services from process count validation" 2021-04-09 05:21:56 +00:00
Zuul 66dfe8c7be Merge "Fix typo in readme file." 2021-04-09 05:21:39 +00:00
Zuul 433e4b4101 Merge "Zuul runs tests in py36 only" 2021-04-09 05:21:22 +00:00
Zuul 6251461e70 Merge "Coverage considers other all main source folders, omits tests" 2021-04-08 21:19:52 +00:00
Zuul 42b65202ab Merge "Coverage now uses stestr." 2021-04-08 21:17:21 +00:00
Jiri Podivin c5cd9b7c9e Zuul runs tests in py36 only
Python 3.6 is the oldest version of python
supported by the package, and newer, supported,
minor versions do not break any substantial functionality
by design, while introducing new features.

Therefore we do not need to run unit tests for
each minor version. As all possible issues affecting
versions >3.6 would necessarily be related to features
introduced in versions >3.6.

Wallaby Zuul test template was removed from layout.yaml.
The pep8 test environment was folded into linters in tox.ini.
Zuul is now explicitly running tests only in one, oldest supported,
python environment, Python 3.6.

PEP387: https://www.python.org/dev/peps/pep-0387/
https://docs.python.org/3/whatsnew/3.7.html#porting-to-python-37
https://docs.python.org/3/whatsnew/3.8.html#porting-to-python-3-8

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: If8e31e72b215dcdb0db897b03403e8d28a2545b3
2021-04-07 13:42:55 +02:00
Jiri Podivin a7b7152071 Coverage considers other all main source folders, omits tests
This should have been in the initial patch, arguably.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I765218b61f761ce1df387abea33e35f2c96a1ec6
2021-04-07 07:13:38 +00:00
Jiri Podivin 79955d1742 Coverage now uses stestr.
This brings coverage measuring in line with
the standard tox testing process.

Closes-bug: #1922726

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I6bf27ffe88ff55b62e202678340a324058d30051
2021-04-06 13:30:28 +00:00
Zuul c2708a2d6d Merge "Add new tripleo-latest-packages-version playbook" 2021-03-29 05:51:50 +00:00
Zuul d47c660cc7 Merge "Remove RoleNames ansible-lint custom rule" 2021-03-27 05:46:33 +00:00
Gael Chamoulaud (Strider) 9808650864
Remove RoleNames ansible-lint custom rule
As this rule has been merged upstream, we don't need it anymore locally.

This patch also bumps the ansible-lint release from v4.3.5 to v5.0.3

It also mocks the following modules and roles coming from
validations-common to pass the --syntax-check:
- hiera, validations_read_ini and warn customs libs
- check_latest_packages_version role

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Idc560dd4c459228da43a1e7b3dc089d379b9dccb
2021-03-26 11:38:03 +01:00
Gael Chamoulaud (Strider) eb21b9d24f Add new tripleo-latest-packages-version playbook
This patch adds a new TripleO specific playbook which will call the
check_latest_packages_version role hosted in validations-common. This
playbook will test if the python3-tripleoclient package is at its latest
version on the Undercloud before starting an upgrade.

Note1: The check-latest-packages-versions validation hosted in
validations-common will be refactored to only test non TripleO packages.

Note2: The documentation automation has been modified to point to the
external role official documentation.

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I606f650029dd4daad7dc7aac248c388130e9d503
2021-03-26 11:28:26 +01:00
matbu 408aec4dc3 Move back tripleo_validator.py to tripleoclient
The reason of this revert is example in the depends-on review
in tripleoclient

Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/782776
Change-Id: Ifab62c734bf8d1f2f6647144b084d1ec1313588d
2021-03-24 16:52:38 +01:00
Jiri Podivin c4e7b83ada Removes retired services from process count validation
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I68be1dcaaf843adf7d562ca978bf837ad05b3ba9
2021-03-23 11:23:09 +01:00
Zuul c876cbba8d Merge "Introduce tox-ansible to tripleo-validations" 2021-03-22 11:01:30 +00:00
Sergii Golovatiuk 5e9fd43a6e Remove apk and references from bindep.txt
Use bindep only for RPM amd dpkg bases distros

Change-Id: Ia423fb3f9c363cc88e685dd5cd5791aab8e8d806
2021-03-19 17:36:21 +01:00
Gael Chamoulaud (Strider) edb1ad9210
Introduce tox-ansible to tripleo-validations
This patch adds basic configuration for tox-ansible[1].

Tox-ansible is a plugin for tox which auto-generates tox environments
for running quality assurance tools like ansible-test or molecule. This
tool is rather tightly integrated for the official Molecule testing tool
that integrates with Ansible.

At first, it will allow us to list very quickly all the Ansible Molecule
tests for each roles with their scenario(s):

Example:

    $ tox -l
    ...
    roles-ceph-ceph-ansible-installed
    roles-ceph-default
    roles-check_kernel_version-default
    roles-check_network_gateway-default
    roles-check_rhsm_version-default
    roles-check_rhsm_version-rhsm_mismatch
    roles-check_undercloud_conf-config_OK
    roles-check_undercloud_conf-default
    roles-check_undercloud_conf-deprecated_drivers
    roles-check_undercloud_conf-deprecated_params
    roles-check_undercloud_conf-required_missing
    ...

However, we won't be able to execute them as it for now without to make
some small manual modifications in the molecule.yml file first before to
execute them. This will be covered as soon as possible in a following-patch.

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

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ia1606db814f37a11e48508139b90cdd43c083f6b
2021-03-19 15:01:46 +01:00
Zuul fbe95ff482 Merge "Remove linters dependency from content-provider in gate" 2021-03-19 13:47:58 +00:00
Zuul ebc1025a5f Merge "Use static inventory for component CI role and clean component list" 2021-03-18 22:49:02 +00:00
Zuul 3171ac4467 Merge "Rename system_encoding playbooks." 2021-03-18 15:26:01 +00:00
Zuul 0e4b48a53f Merge "Add update roles on several validations." 2021-03-18 15:25:58 +00:00
Mathieu Bultel 9f5b4167ba Use static inventory for component CI role and clean component list
* Use static inventory for tripleo-validations role for component CI
* Remove nova-svirt from the component compute list since this validation
is not made for running on Standalone deployment.
* Moving neutron-sanity-check to undercloud-neutron-sanity-check because
this validation is made for being kicked against an Overcloud
* And replace disk-check by process count for Component CI PoC

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I2de47f7226c232226712cf45be7d1dfb4b62873a
2021-03-17 17:08:38 +01:00
Marios Andreou 3573a5f050 Remove linters dependency from content-provider in gate
As part of [1] lets remove the dependency on linters from the
content-provider in the gate, in line with all the other repos.
We don't want to delay the gate for linting since any issues should
be resolved before a change hits the gate.

[1] https://review.opendev.org/q/topic:tripleo-ci-reduce

Change-Id: I31ad623cae3db284b4f6b694033fab5bb9dc4360
2021-03-17 11:41:11 +00:00
Zuul 0ad1e42658 Merge "Replace user with openssh_keypair" 2021-03-16 14:34:17 +00:00
Zuul 87e830a622 Merge "Trigger molecule tests when modifying CI scripts" 2021-03-16 14:34:13 +00:00
Daniel Bengtsson cce263b578 Rename system_encoding playbooks.
Rename system_encoding.yaml to system-encoding.yaml to respect the
nomenclature.

Change-Id: I811ee8c811fbc4171c4f54cf8d03e801eec62009
2021-03-16 14:53:18 +01:00
Zuul 4178dbd6cf Merge "Rename Dockerfile.j2 to Dockerfile" 2021-03-16 00:21:45 +00:00
Zuul a9e684d5b5 Merge "Python tests are now run trough stestr." 2021-03-15 14:04:22 +00:00
Daniel Bengtsson 5bbbd844f9 Add update roles on several validations.
Review existing validations and update groups when it's useful.

Change-Id: I30a0faeb381e290ac5eb1080c1c1cea0ca2ad5b3
2021-03-15 11:32:45 +01:00
Zuul 010e31fd9e Merge "Activate virtual environment" 2021-03-11 21:32:06 +00:00
Jiri Podivin c8e66a89f2 Python tests are now run trough stestr.
Number of the environment variables passed to tox envs was
reduced from all, to just one.

This is preparatory step for further test developmet.
Reviews for test infrastructure, refactoring and coverage
will be on branches from this one.

tools/validate_files.py:
	Changed encoding to utf-8 to prevent
	linting error.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Idd82aecb7b66433396639ed800a33b109a06e11a
2021-03-10 11:38:34 +01:00
Sergii Golovatiuk d0a4e0706c
Replace user with openssh_keypair
On Fedora 33 user: doesn't create id_rsa.pub, so next task fails as

TASK [Slurp pub key]
fatal: [test]: FAILED! => {
    "changed": false
}

MSG:

file not found: /home/sgolovat/.ssh/id_rsa.pub

This patch replaces user: with openssh_keypair: to have more control
over ssh key pair creation

Change-Id: I6b303c13957f905aae0a04ea99cf53ceb9684de2
2021-03-10 09:55:42 +01:00
Gael Chamoulaud (Strider) 7db15e5fe2
Trigger molecule tests when modifying CI scripts
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I585d03ad42fc0435c711a02717b2b17c1ec8275b
2021-03-10 09:55:07 +01:00
Sergii Golovatiuk 52c72cc2f2 Activate virtual environment
Enable virtualenv after installation. Without it, python packages from
system location will be used. So if bindep is not installed in system
packages the failure will be as

~/tripleo-validations/scripts/..//scripts/bindep-install: line 37: bindep: command not found

This patch activates virtualenv after creation on previous step in
accordance rather than before pytest.

Change-Id: I3725bf64bead30b02f10eb9a68d220c4e422b531
2021-03-09 15:45:13 +01:00
Sergii Golovatiuk 2850e3a676 Rename Dockerfile.j2 to Dockerfile
Rename Dockerfile.j2 to Dockerfile.

Change-Id: Iebd9ddd32a97697406c575e6188676c9e1c7cc7a
2021-03-09 01:25:18 +01:00
Sergii Golovatiuk 0550d6900c Fix unbound variable
If operator runs script without any variables it will fail as

scripts/run-local-test: line 26: $1: unbound variable

This patch adds usage function and check if script is run without
ROLE_NAME

Change-Id: I9137821c8396568be125ec686bad2534f9d433b2
2021-03-05 16:58:47 +01:00
Zuul ec24e3ed7a Merge "Fix api call to get_deployment_status" 2021-03-03 12:47:21 +00:00
Zuul 1a9f1758d1 Merge "Optionally fail ceph-health if HEALTH_WARN" 2021-02-25 13:28:57 +00:00
Owen McGonagle df0ae71422 Fix api call to get_deployment_status
Function get_deployment_status requires the stack_name parameter, cannot pass plan=plan

Without fix, getting this error:

openstack tripleo validator run --group pre-update-prepare --plan overcloud
get_deployment_status() got an unexpected keyword argument 'plan'

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>
Change-Id: I7b5da62a564c22738427632ea03b1e33cdf2f89a
2021-02-24 16:08:13 -05:00
Owen McGonagle cae7d151ad Replace exception with LOG.info
Updated _run_validator_run to no longer raise an execption if/when a group is empty

Using a log vs. exception is useful when we want to run an automated set of validations
within our Update CI pipeline.

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>
Change-Id: I1046148da87712934184373a10fa3d2a46e620e4
2021-02-23 15:31:41 -05:00
Zuul d9c04528ef Merge "Modify find to use -H to support symbolic links" 2021-02-19 14:21:00 +00:00
Owen McGonagle bf84c426e0 Modify find to use -H to support symbolic links
Use -H switch on find command to follow symbolic links for
find command line arguments.

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>

Change-Id: I60c8703e06fb8e399dce0f009e434d0cc3731e64
2021-02-17 14:38:50 -05:00
David Vallee Delisle 4fc80c6bd5 Introducing the overcloud-service-status role
This role will hit the overcloud API for nova and cinder, retrieve the
services and will trig a failure if one of these services are either
down or deprecated. The original intent was to validate that
nova-consoleauth was deleted after an update to RHOSP16.

Related: https://bugzilla.redhat.com/1921115
Change-Id: I057349fdac90a093c67aeb0b2f0a825c4c915e0b
2021-02-16 01:35:38 +00:00
David Vallee Delisle 98791eafff [autodoc] guessing converge playbook
If a molecule has a defined converge playbook, we should use it instead
of defaulting to the role's playbook.

Change-Id: Idc55fba78ce91d472ed367f5097505c9a5d9b6dd
2021-02-16 01:35:24 +00:00