mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-17 16:09:14 +00:00
test(backup): total restore nocrash test
This commit is contained in:
parent
39312a0937
commit
4e1c8b6faa
|
@ -293,6 +293,7 @@ def catch_nixos_rebuild_calls(fp):
|
||||||
# A helper function to be used in tests of all systems that requires
|
# A helper function to be used in tests of all systems that requires
|
||||||
# rebuilds
|
# rebuilds
|
||||||
prepare_nixos_rebuild_calls(fp, API_REBUILD_SYSTEM_UNIT)
|
prepare_nixos_rebuild_calls(fp, API_REBUILD_SYSTEM_UNIT)
|
||||||
|
return fp
|
||||||
|
|
||||||
|
|
||||||
def assert_rebuild_was_made(fp, unit_name):
|
def assert_rebuild_was_made(fp, unit_name):
|
||||||
|
|
|
@ -831,17 +831,26 @@ def test_service_manager_backs_up_without_crashing(
|
||||||
Backups.restore_snapshot(snapshot)
|
Backups.restore_snapshot(snapshot)
|
||||||
|
|
||||||
|
|
||||||
# def test_backup_all_restore_all(backups, generic_userdata, dkim_file, only_dummy_service_and_api, catch_nixos_rebuild_calls):
|
def test_backup_all_restore_all(
|
||||||
# dummy_service = only_dummy_service_and_api
|
backups,
|
||||||
# fp = catch_nixos_rebuild_calls
|
generic_userdata,
|
||||||
# backup_job = add_total_backup_job()
|
dkim_file,
|
||||||
# total_backup(backup_job)
|
only_dummy_service_and_api,
|
||||||
# assert len(Backups.get_all_snapshots()) == 2
|
catch_nixos_rebuild_calls,
|
||||||
|
):
|
||||||
|
dummy_service = only_dummy_service_and_api
|
||||||
|
fp = catch_nixos_rebuild_calls
|
||||||
|
fp.pass_command(["restic", fp.any()])
|
||||||
|
fp.keep_last_process(True)
|
||||||
|
|
||||||
# restore_job = add_total_restore_job()
|
backup_job = add_total_backup_job()
|
||||||
|
total_backup(backup_job)
|
||||||
|
assert len(Backups.get_all_snapshots()) == 2
|
||||||
|
|
||||||
# do_full_restore(restore_job)
|
restore_job = add_total_restore_job()
|
||||||
|
|
||||||
# # TODO: maybe test integrity.
|
do_full_restore(restore_job)
|
||||||
# # since it is standard restore operations they would have failed if something went wrong
|
|
||||||
# # however, one still needs to check that all of the required restores have even started
|
# TODO: maybe test integrity.
|
||||||
|
# since it is standard restore operations they would have failed if something went wrong
|
||||||
|
# however, one still needs to check that all of the required restores have even started
|
||||||
|
|
Loading…
Reference in a new issue