1
0
mirror of https://gerrit.ovirt.org/vdsm synced 2026-02-05 12:46:23 +01:00
Files
vdsm/tests/testing.py
Marcin Sobczyk 0a9c9d42c4 tests: ssl: Handle rhel8 in ssl tests
Depending on the crypto policy of the distro, some ssl tests
should fail, and some succeed.

This patch adds proper handling of rhel, on which both TLS 1.0
and TLS 1.1 should not work, given the restrictive, default crypto
policy. Additionally some 'six.PY[23]' conditionals have been removed,
since we don't support py2 anymore.

Change-Id: I83faaebc18594794bef62420cfa8eeebde637aeb
Signed-off-by: Marcin Sobczyk <msobczyk@redhat.com>
2020-07-29 07:52:23 +00:00

52 lines
1.5 KiB
Python

#
# Copyright 2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#
"""
testing - Testing environment helpers
"""
from __future__ import absolute_import
from __future__ import division
import os
def on_centos(ver=''):
with open('/etc/redhat-release') as f:
return 'CentOS Linux release {}'.format(ver) in f.readline()
def on_rhel(ver=''):
with open('/etc/redhat-release') as f:
return 'Red Hat Enterprise Linux release {}'.format(
ver) in f.readline()
def on_fedora(ver=''):
with open('/etc/redhat-release') as f:
return 'Fedora release {}'.format(ver) in f.readline()
def on_travis_ci():
return 'TRAVIS_CI' in os.environ
def on_ovirt_ci():
return 'OVIRT_CI' in os.environ