
In preparation for updating mirror-update to Noble we move the afsmon installation into a virtualenv. This is necessary because pip on Noble fails by default when installing tools globally. This should be backward compatbile with the old server too so we land this first and ensure it continues to work happily there first. While we are fixing afsmon for Noble we also update file matchers for afsmon and afs-release roles. Currently they are either missing or miss applied to the mirror jobs rather than the mirror-update jobs. Fix this. Change-Id: I4134a6e98f7face59612f9e39c3350129af404ea
125 lines
3.7 KiB
Python
125 lines
3.7 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 = ['mirror-update99.opendev.org']
|
|
|
|
# Manually calculated from the "secret" value in the test host vars
|
|
KEYTAB_SHA256 = '88d4ac38ad3da024913843d8917d5be89ceac4abef7b977718f2c3f1db3ccde4'
|
|
|
|
def test_tools(host):
|
|
f = host.file('/usr/bin/k5start')
|
|
assert f.exists
|
|
f = host.file('/usr/bin/rsync')
|
|
assert f.exists
|
|
f = host.file('/usr/bin/vos')
|
|
assert f.exists
|
|
|
|
def test_rsync_scripts(host):
|
|
for script in ['centos-stream',
|
|
'epel',
|
|
'fedora',
|
|
'openeuler',
|
|
'yum-puppetlabs']:
|
|
f = host.file('/usr/local/bin/%s-mirror-update' % script)
|
|
assert f.exists
|
|
|
|
def test_rsync_scripts_removed(host):
|
|
for script in ['opensuse', 'centos']:
|
|
f = host.file('/usr/local/bin/%s-mirror-update' % script)
|
|
assert not f.exists
|
|
|
|
def test_publisher_script(host):
|
|
f = host.file('/usr/local/bin/publish-mirror-logs')
|
|
assert f.exists
|
|
|
|
def test_keytabs(host):
|
|
for keytab in ['/etc/afsadmin.keytab',
|
|
'/etc/logs.keytab',
|
|
'/etc/centos-stream.keytab',
|
|
'/etc/epel.keytab',
|
|
'/etc/fedora.keytab',
|
|
'/etc/openeuler.keytab',
|
|
'/etc/yum-puppetlabs.keytab',
|
|
'/etc/reprepro.keytab']:
|
|
|
|
f = host.file(keytab)
|
|
assert f.exists
|
|
assert f.sha256sum == KEYTAB_SHA256
|
|
assert f.mode == 0o400
|
|
|
|
def test_keytabs_removed(host):
|
|
for keytab in ['/etc/opensuse.keytab', '/etc/centos.keytab']:
|
|
f = host.file(keytab)
|
|
assert not f.exists
|
|
|
|
def test_afs_release_script(host):
|
|
f = host.file('/opt/afs-release/release-volumes.py')
|
|
assert f.exists
|
|
|
|
def test_afs_release_script_run(host):
|
|
# This will just run the command in a no-op mode to make sure deps
|
|
# are installed, etc.
|
|
cmd = host.run('/opt/afs-release/release-volumes.py '
|
|
'--debug --skip-release')
|
|
assert cmd.succeeded
|
|
|
|
def test_afsmon_installed(host):
|
|
f = host.file('/usr/local/afsmonvenv/bin/afsmon')
|
|
assert f.exists
|
|
|
|
f = host.file('/etc/afsmon.cfg')
|
|
assert f.exists
|
|
|
|
# reprepro
|
|
|
|
def test_repro_general_conf(host):
|
|
package = host.package('reprepro')
|
|
assert package.is_installed
|
|
|
|
f = host.file('/etc/reprepro')
|
|
assert f.exists
|
|
assert f.is_directory
|
|
|
|
f = host.file('/var/log/reprepro')
|
|
assert f.exists
|
|
assert f.is_directory
|
|
|
|
f = host.file('/usr/local/bin/reprepro-mirror-update')
|
|
assert f.exists
|
|
|
|
f = host.file('/etc/logrotate.d/reprepro')
|
|
assert f.exists
|
|
|
|
def test_reprepro_configs(host):
|
|
|
|
dirs = ('apt-puppetlabs',
|
|
'debian',
|
|
'debian-security',
|
|
'debian-ceph-octopus',
|
|
'debian-ceph-nautilus',
|
|
'debian-ceph-quincy',
|
|
'debian-ceph-reef',
|
|
'debian-docker-xenial',
|
|
'debian-docker-bionic',
|
|
'debian-docker-focal',
|
|
'ubuntu',
|
|
'ubuntu-cloud-archive',
|
|
'ubuntu-ports')
|
|
|
|
for d in dirs:
|
|
for config in ('distributions', 'options', 'updates'):
|
|
f = host.file('/etc/reprepro/%s/%s' % (d, config))
|
|
assert f.exists
|