From e71301ef56645a576e036babba3f51046ced116b Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Wed, 29 Mar 2023 11:14:27 +0200 Subject: [PATCH] Drop lib-validations dependency We didn't really used it properly in Tobiko and now it will be sunset together with other Tripleo related projects so we should get rid of usage of it in Tobiko. Closes: OSP-23786 Change-Id: If75e7ad47d4acc476f04d377bde0a6a33dcc1369 --- .../roles/tobiko-ir-run/tasks/main.yaml | 8 --- requirements.txt | 1 - tobiko/tests/faults/ha/test_cloud_recovery.py | 2 - tobiko/tripleo/validations.py | 65 ------------------- 4 files changed, 76 deletions(-) delete mode 100644 tobiko/tripleo/validations.py diff --git a/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml b/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml index 9fd36b38b..15ca2e296 100644 --- a/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml +++ b/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml @@ -55,14 +55,6 @@ deploy_git_refspec: '{{ openshift_infrared_git_refspec }}' deploy_git_remote: '{{ openshift_infrared_git_remote }}' - # validations-common here since it's packaged by rhel-osp - - name: install validations-common - ignore_errors: yes - become: true - package: - name: validations-common - state: present - - name: apply pre-requisites before tests run include_role: name=tobiko-ir-before-run diff --git a/requirements.txt b/requirements.txt index e36e655be..b78d7abaa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,3 @@ python-openstackclient>=5.4.0 # Apache-2.0 PyYAML>=5.4.1 # MIT sshtunnel>=0.3.1 # MIT testtools>=2.5.0 # MIT -validations-libs>=1.1.0 # Apache-2.0 diff --git a/tobiko/tests/faults/ha/test_cloud_recovery.py b/tobiko/tests/faults/ha/test_cloud_recovery.py index 25e0b389d..6648d91bc 100644 --- a/tobiko/tests/faults/ha/test_cloud_recovery.py +++ b/tobiko/tests/faults/ha/test_cloud_recovery.py @@ -33,7 +33,6 @@ from tobiko.tripleo import containers from tobiko.tripleo import nova from tobiko.tripleo import overcloud from tobiko.tripleo import undercloud -from tobiko.tripleo import validations LOG = log.getLogger(__name__) @@ -61,7 +60,6 @@ def overcloud_health_checks(passive_checks_only=False, # after any overcloud node is rebooted if not skip_mac_table_size_test: tests.test_ovs_bridges_mac_table_size() - validations.run_post_deployment_validations() # check vm create with ssh and ping checks diff --git a/tobiko/tripleo/validations.py b/tobiko/tripleo/validations.py deleted file mode 100644 index ddbac1319..000000000 --- a/tobiko/tripleo/validations.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2020 Red Hat -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from __future__ import absolute_import - -import os - -from oslo_log import log -from validations_libs import validation_actions - -from tobiko import tripleo -from tobiko.tripleo import overcloud - - -LOG = log.getLogger(__name__) - - -def run_post_deployment_validations(): - """run validtion framework post-deploument validations - only if we're in a tripleo env""" - - if overcloud.has_overcloud(): - inventory_file = os.path.expanduser('~/hosts.yaml') - tripleo.fetch_tripleo_inventary_file(inventory_file=inventory_file) - failures = [] - validates_object = validation_actions.ValidationActions() - try: - validations_result = validates_object.run_validations( - group='post-deployment', - quiet=False, - inventory=inventory_file) - except Exception: - LOG.exception('Validation lib unhandled errors') - return - - for validation in validations_result: - if validation['Status'] == 'FAILED': - failures.append( - 'failed validation: {}\n\n'.format(validation)) - elif validation['Status'] == 'PASSED': - LOG.info('passed validation: {}\n\n'.format(validation)) - if failures: - LOG.info('Failed tripleo validations:\n {}'.format(failures)) - # We should not fail over validations in the beginning we have to - # test run them, and handle false negatives. - - # tobiko.fail( - # 'nova agents are unhealthy:\n{!s}', '\n'.join(failures)) - - # to list possible validations: - # validates_object.list_validations() - - # single validation example - # validates_object.run_validations( - # validation_name='healthcheck-service-status',quiet=False,inventory='/home/stack/hosts.yaml')