system-config/testinfra/test_static.py
Ian Wienand 2f1b2f3eae static: Add service-types.openstack.org
Publishing changes done with https://review.opendev.org/#/c/708518/

Change-Id: I13934473aa85fce17a269f81f67c6332d51a9ab1
Story: #2006598
Task: #37723
2020-02-20 11:09:28 +11:00

62 lines
2.4 KiB
Python

# Copyright 2019 Red Hat, Inc.
#
# 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.
testinfra_hosts = ['static01.opendev.org']
def test_apache(host):
apache = host.service('apache2')
assert apache.is_running
def test_governance_openstack_org(host):
cmd = host.run('curl --insecure '
'--resolve governance.openstack.org:443:127.0.0.1 '
'https://governance.openstack.org/')
assert 'OpenStack Governance' in cmd.stdout
def test_security_openstack_org(host):
cmd = host.run('curl --insecure '
'--resolve security.openstack.org:443:127.0.0.1 '
'https://security.openstack.org/')
assert 'OpenStack Security Project' in cmd.stdout
def test_tarballs_openstack_org(host):
cmd = host.run('curl --insecure '
'--resolve tarballs.openstack.org:443:127.0.0.1 '
'--resolve tarballs.opendev.org:443:127.0.0.1 '
'https://tarballs.openstack.org/nova/')
# The redirect page should send us to tarballs.opendev.org
assert '302 Found' in cmd.stdout
assert 'https://tarballs.opendev.org/openstack/nova/' in cmd.stdout
def test_tarballs_opendev_org(host):
cmd = host.run('curl --insecure '
'--resolve tarballs.opendev.org:443:127.0.0.1 '
'https://tarballs.opendev.org/openstack/nova/')
# An old file that should be present
assert 'nova-12.0.0.tar.gz' in cmd.stdout
def test_specs_opendev_org(host):
cmd = host.run('curl --insecure '
'--resolve specs.openstack.org:443:127.0.0.1 '
'https://specs.openstack.org/specs.opml')
assert 'OpenStack Specs Feeds' in cmd.stdout
def test_service_types_opendev_org(host):
cmd = host.run('curl --insecure '
'--resolve service-types.openstack.org:443:127.0.0.1 '
'https://service-types.openstack.org')
assert 'OpenStack Service Types Authority Data' in cmd.stdout