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
This commit is contained in:
Slawek Kaplonski 2023-03-29 11:14:27 +02:00
parent 3318a5d57a
commit e71301ef56
4 changed files with 0 additions and 76 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')