diff --git a/tests/test_backup.py b/tests/test_backup.py index da5287b666558683ea91c886d749e6737f7844e4..388b1ad92be89b5d8b3b3cbb8d793d91198b5570 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -59,25 +59,6 @@ def test_last_backup_is_recent(server): return False -def test_backup_space(server=None, path="/backup"): - cmd = 'df -h %s | tail -n 1' % path - if server: - cmd = 'ssh -o StrictHostKeyChecking=no %s ' % server + cmd - status, out = subprocess.getstatusoutput(cmd) - if status == 0: - dev, total, used, free, used_perc, mount = out.strip().split() - used_perc = int(used_perc.replace('%', '')) - if used_perc > 80: - print('There is less than 20% of available space for backups') - return False - else: - print('There is %s%% of free space' % (100 - used_perc)) - return True - else: - print('Failed to check backup space') - return False - - def check_backup_is_incremental(path): # incremental backups done with tmbackup mean that they will all at least contain links dirs = os.listdir(path) @@ -130,7 +111,6 @@ def check_local_backups(paths): status, out = subprocess.getstatusoutput(cmd) for bf in out.split('\n'): all_ok = min(check_local_backup(bf), all_ok) - all_ok = min(test_backup_space(path=f), all_ok) return all_ok @@ -148,10 +128,7 @@ if os.path.isfile('../utils.py'): if not test_last_backup_is_recent(BACKUP_SERVER): sys.exit(1) else: - if not test_backup_space(server=BACKUP_SERVER): - sys.exit(1) - else: - sys.exit(0) + sys.exit(0) elif LOCAL_BACKUP_FOLDERS: sys.exit(not check_local_backups(LOCAL_BACKUP_FOLDERS)) else: