backups: Allow comments to be added to archives during backup

Tests performed:

- Schedules are able to store and retrieve comments properly. Information about
schedule backups stored in comments is extracted properly.

- Unit tests run.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2021-01-21 20:33:47 -05:00
1 parent d3f8e815c1
commit 01e00cdde4
6 files changed
+55 -11

No files matched your search

+11 -1
View File
@@ -63,11 +63,21 @@ def _get_test_app(name):
class TestBackupProcesses:
"""Test cases for backup processes"""
@staticmethod
def test_packet_init():
"""Test that packet is initialized properly."""
packet = api.Packet('backup', 'apps', '/', [])
assert packet.archive_comment is None
packet = api.Packet('backup', 'apps', '/', [],
archive_comment='test comment')
assert packet.archive_comment == 'test comment'
@staticmethod
def test_packet_collected_files_directories():
"""Test that directories/files are collected from manifests."""
components = [_get_backup_component('a'), _get_backup_component('b')]
packet = api.Packet('backup', 'apps', '/', components)
packet = api.Packet('backup', 'apps', '/', components,
archive_comment='test comment')
for component in components:
for section in ['config', 'data', 'secrets']:
for directory in getattr(component, section)['directories']: