diff --git a/tests/test_backup.py b/tests/test_backup.py index 06222029f6604dd810b441ba5a8c01933453537c..97fc679f299188470ec315493518f9e7148418bb 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -8,6 +8,7 @@ Checks that the server backups are not older than a day. from datetime import datetime import imp import os +import socket import subprocess import sys @@ -29,8 +30,9 @@ def test_ssh(ip): return True -def test_last_backup_is_recent(server, client): - path = '/backup/%s/current' % client +def test_last_backup_is_recent(server): + client = socket.gethostname() + path = '/backup/%s/home/current' % client cmd = 'ssh -o StrictHostKeyChecking=no %s ls -l %s | grep current' % (server, path) status, out = subprocess.getstatusoutput(cmd) if status == 0: @@ -53,13 +55,12 @@ if os.path.isfile('../utils.py'): es_utils = imp.load_source('es_utils', '../utils.py') conf = es_utils.load_conf() BURP_SERVER = conf.get('BURP_SERVER') - BURP_CLIENT_NAME = conf.get('BURP_CLIENT_NAME') or 'localhost' if BURP_SERVER: if not test_ssh(BURP_SERVER): print('Failed to ssh into backup server') sys.exit(1) else: - if not test_last_backup_is_recent(BURP_SERVER, BURP_CLIENT_NAME): + if not test_last_backup_is_recent(BURP_SERVER): sys.exit(1) else: sys.exit(0)