Test exclude patterns
This commit is contained in:
parent
9397a87655
commit
d809496eb2
|
@ -109,9 +109,38 @@ class ResticBackupTests(unittest.TestCase):
|
|||
web_service = cnt.get_service('web')
|
||||
self.assertNotEqual(web_service, None, msg="Web service not found")
|
||||
|
||||
mounts = list(web_service.filter_mounts())
|
||||
mounts = web_service.filter_mounts()
|
||||
self.assertEqual(len(mounts), 1)
|
||||
self.assertEqual(mounts[0].source, '/srv/files/media')
|
||||
|
||||
def test_exclude(self):
|
||||
pass
|
||||
containers = self.createContainers()
|
||||
containers += [
|
||||
{
|
||||
'service': 'web',
|
||||
'labels': {
|
||||
'restic-volume-backup.exclude': 'stuff',
|
||||
},
|
||||
'mounts': [
|
||||
{
|
||||
'Source': '/srv/files/media',
|
||||
'Destination': '/srv/media',
|
||||
'Type': 'bind',
|
||||
},
|
||||
{
|
||||
'Source': '/srv/files/stuff',
|
||||
'Destination': '/srv/stuff',
|
||||
'Type': 'bind',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
with mock.patch(list_containers_func, fixtures.containers(containers=containers)):
|
||||
cnt = RunningContainers()
|
||||
|
||||
web_service = cnt.get_service('web')
|
||||
self.assertNotEqual(web_service, None, msg="Web service not found")
|
||||
|
||||
mounts = web_service.filter_mounts()
|
||||
self.assertEqual(len(mounts), 1)
|
||||
self.assertEqual(mounts[0].source, '/srv/files/media')
|
||||
|
|
Loading…
Reference in New Issue