diff --git a/tests/test_backup.py b/tests/test_backup.py
index 7497a8cb083797e6f626f0c024054c8c6e5a04a8..e2b5de490763125060a6aad2ce81a83ce882b646 100755
--- a/tests/test_backup.py
+++ b/tests/test_backup.py
@@ -67,7 +67,7 @@ def test_backup_space(server):
         return False
 
 
-def check_local_backup(path):
+def check_local_backup(path, descend=True):
     all_ok = True
     for d in os.listdir(path):
         subd = os.path.join(path, d)
@@ -85,10 +85,11 @@ def check_local_backup(path):
                 else:
                     print('Backup %s is fine' % subd)
             else:
-                for dd in os.listdir(subd):
-                    subsubd = os.path.join(subd, dd)
-                    if os.path.isdir(subsubd):
-                        all_ok = min(all_ok, check_local_backup(subsubd))
+                if descend:
+                    for dd in os.listdir(subd):
+                        subsubd = os.path.join(subd, dd)
+                        if os.path.isdir(subsubd):
+                            all_ok = min(all_ok, check_local_backup(subsubd, descend=False))
     return all_ok