system-config-run-borg-backup: rename hosts to distro

Rename the testing hosts to be clearer that they are different
distros.

Change-Id: Ic4b2b4a1b1fa8bc9a9eb62dc2ccba529958f19cd
This commit is contained in:
Ian Wienand 2022-08-10 10:11:50 +10:00
parent 1c9dfc1fee
commit 55654851bc
3 changed files with 20 additions and 20 deletions

View File

@ -18,9 +18,9 @@ groups:
- borg-backup01.region.provider.opendev.org
borg-backup:
- borg-backup-test01.opendev.org
- borg-backup-test02.opendev.org
- borg-backup-test03.opendev.org
- borg-backup-bionic.opendev.org
- borg-backup-focal.opendev.org
- borg-backup-jammy.opendev.org
kerberos-kdc:
- kdc-primary.opendev.org

View File

@ -16,9 +16,9 @@ import os.path
import pytest
testinfra_hosts = ['borg-backup01.region.provider.opendev.org',
'borg-backup-test01.opendev.org',
'borg-backup-test02.opendev.org',
'borg-backup-test03.opendev.org']
'borg-backup-bionic.opendev.org',
'borg-backup-focal.opendev.org',
'borg-backup-jammy.opendev.org']
def test_borg_installed(host):
@ -33,12 +33,12 @@ def test_borg_installed(host):
def test_borg_server_users(host):
hostname = host.backend.get_hostname()
if hostname.startswith('borg-backup-test'):
if hostname != 'borg-backup01.region.provider.opendev.org':
pytest.skip()
for username in ('borg-borg-backup-test01',
'borg-borg-backup-test02',
'borg-borg-backup-test03'):
for username in ('borg-borg-backup-bionic',
'borg-borg-backup-focal',
'borg-borg-backup-jammy'):
homedir = os.path.join('/opt/backups/', username)
borg_repo = os.path.join(homedir, 'backup')
authorized_keys = os.path.join(homedir, '.ssh', 'authorized_keys')
@ -85,8 +85,8 @@ def test_borg_backup(host):
cmd = host.run('ls /opt/backups')
# this directory should now have a directory
# borg-backup-test0X-YYYY-MM-DDT...
assert 'borg-backup-test' in cmd.stdout
# borg-backup-<distro>-YYYY-MM-DDT...
assert hostname.split('.')[0] in cmd.stdout
# unmount it for sanity
cmd = host.run('umount /opt/backups')
@ -94,7 +94,7 @@ def test_borg_backup(host):
def test_borg_server_prune(host):
hostname = host.backend.get_hostname()
if hostname.startswith('borg-backup-test'):
if hostname != 'borg-backup01.region.provider.opendev.org':
pytest.skip()
cmd = host.run('echo "prune" | /usr/local/bin/prune-borg-backups &> /var/log/prune-borg-backups.log')
@ -102,7 +102,7 @@ def test_borg_server_prune(host):
def test_borg_server_verify(host):
hostname = host.backend.get_hostname()
if hostname.startswith('borg-backup-test'):
if hostname != 'borg-backup01.region.provider.opendev.org':
pytest.skip()
cmd = host.run('/usr/local/bin/verify-borg-backups &> /var/log/verify-borg-backups.log')

View File

@ -378,11 +378,11 @@
label: ubuntu-bionic
- name: borg-backup01.region.provider.opendev.org
label: ubuntu-focal
- name: borg-backup-test01.opendev.org
- name: borg-backup-focal.opendev.org
label: ubuntu-focal
- name: borg-backup-test02.opendev.org
- name: borg-backup-bionic.opendev.org
label: ubuntu-bionic
- name: borg-backup-test03.opendev.org
- name: borg-backup-jammy.opendev.org
label: ubuntu-jammy
vars:
run_playbooks:
@ -401,13 +401,13 @@
host_copy_output:
'/var/log/prune-borg-backups.log': logs
'/var/log/verify-borg-backups.log': logs
borg-backup-test01.opendev.org:
borg-backup-bionic.opendev.org:
host_copy_output:
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
borg-backup-test02.opendev.org:
borg-backup-focal.opendev.org:
host_copy_output:
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
borg-backup-test03.opendev.org:
borg-backup-jammy.opendev.org:
host_copy_output:
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs