mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-26 05:51:29 +00:00
feature(backups): stop services before restores
This commit is contained in:
parent
40ad1b5ce4
commit
b001e198bf
|
@ -258,7 +258,8 @@ class Backups:
|
|||
|
||||
try:
|
||||
Backups._assert_restorable(snapshot)
|
||||
|
||||
with StoppedService(service):
|
||||
Backups.assert_dead(service)
|
||||
if strategy == RestoreStrategy.INPLACE:
|
||||
Backups._inplace_restore(service, snapshot, job)
|
||||
else: # verify_before_download is our default
|
||||
|
|
|
@ -379,7 +379,11 @@ def restore_strategy(request) -> RestoreStrategy:
|
|||
return RestoreStrategy.INPLACE
|
||||
|
||||
|
||||
def test_restore_snapshot_task(backups, dummy_service, restore_strategy):
|
||||
def test_restore_snapshot_task(
|
||||
backups, dummy_service, restore_strategy, simulated_service_stopping_delay
|
||||
):
|
||||
dummy_service.set_delay(simulated_service_stopping_delay)
|
||||
|
||||
Backups.back_up(dummy_service)
|
||||
snaps = Backups.get_snapshots(dummy_service)
|
||||
assert len(snaps) == 1
|
||||
|
|
Loading…
Reference in a new issue