From e302e397bf271ee308f7ddd29c4f2886ebd0efe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <fthiery@gmail.com> Date: Wed, 8 Nov 2017 21:09:33 +0100 Subject: [PATCH] do not attempt to count resources, since it will be very slow and will be mediaserver specific, so unusable for generic backups, refs #23246 --- tests/test_backup.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index 6deec00e..4af6313d 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -11,7 +11,6 @@ import os import socket import subprocess import sys -import glob GREEN = '\033[92m' RED = '\033[91m' @@ -80,18 +79,14 @@ def test_backup_space(server=None, path="/backup"): def check_backup_is_incremental(path): + # incremental backups done with tmbackup mean that they will all at least contain links dirs = os.listdir(path) - dirs.sort() - for d in dirs: - num_folders = 0 + files_count = 0 folder_path = os.path.join(path, d) if os.path.isdir(folder_path): - media = glob.glob(os.path.join(path, d, "*/msinstance/media/resources/")) - for m in media: - num_folders += len(os.listdir(m)) - print('%s: %s' % (d, num_folders)) - if num_folders == 0: + files_count = len(os.listdir(folder_path)) + if files_count == 0: print('Folder %s is empty, this indicates non-incremental backups (we are expecting links)' % folder_path) os.rmdir(folder_path) print('Folder removed') -- GitLab