mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-07 00:23:20 +02:00
Fix broken Btrfs end-to-end test (#1054).
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user