Fix broken Btrfs end-to-end test (#1054).

This commit is contained in:
Dan Helfman
2025-12-19 23:10:33 -08:00
parent c0d4489c25
commit 9428a92297
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -33,6 +33,9 @@ def path_is_a_subvolume(path):
As a performance optimization, multiple calls to this function with the same path are cached.
'''
if path == os.environ.get('BTRFS_TEST_SUBVOLUME_PATH'): # pragma: no cover
return True
try:
return os.stat(path).st_ino == BTRFS_SUBVOLUME_INODE_NUMBER
except FileNotFoundError:
@@ -18,6 +18,7 @@ def generate_configuration(config_path, repository_path):
.replace('ssh://user@backupserver/./sourcehostname.borg', repository_path)
.replace('- path: /e2e/mnt/backup', '')
.replace('label: local', '')
.replace('- /home/user/path with spaces', '')
.replace('- /home', f'- {config_path}')
.replace('- /etc', '- /e2e/mnt/subvolume/subdir')
.replace('- /var/log/syslog*', '')
@@ -43,7 +44,10 @@ def test_btrfs_create_and_list():
)
# Run a create action to exercise Btrfs snapshotting and backup.
subprocess.check_call(f'borgmatic --config {config_path} create'.split(' '))
subprocess.check_call(
f'borgmatic -v 2 --config {config_path} create'.split(' '),
env=dict(os.environ, **{'BTRFS_TEST_SUBVOLUME_PATH': '/e2e/mnt/subvolume'}),
)
# List the resulting archive and assert that the snapshotted files are there.
output = subprocess.check_output(