Test detection of running bacup process container
This commit is contained in:
parent
33b81a52f0
commit
e9d4f3edce
|
@ -144,3 +144,21 @@ class ResticBackupTests(unittest.TestCase):
|
||||||
mounts = web_service.filter_mounts()
|
mounts = web_service.filter_mounts()
|
||||||
self.assertEqual(len(mounts), 1)
|
self.assertEqual(len(mounts), 1)
|
||||||
self.assertEqual(mounts[0].source, '/srv/files/media')
|
self.assertEqual(mounts[0].source, '/srv/files/media')
|
||||||
|
|
||||||
|
def test_find_running_backup_container(self):
|
||||||
|
containers = self.createContainers()
|
||||||
|
with mock.patch(list_containers_func, fixtures.containers(containers=containers)):
|
||||||
|
cnt = RunningContainers()
|
||||||
|
self.assertFalse(cnt.backup_process_running)
|
||||||
|
|
||||||
|
containers += [
|
||||||
|
{
|
||||||
|
'service': 'backup_runner',
|
||||||
|
'labels': {
|
||||||
|
'restic-volume-backup.runner': 'True',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
with mock.patch(list_containers_func, fixtures.containers(containers=containers)):
|
||||||
|
cnt = RunningContainers()
|
||||||
|
self.assertTrue(cnt.backup_process_running)
|
||||||
|
|
Loading…
Reference in New Issue