sql: do not reset our database if backup cannot be decrypted

This commit is contained in:
link2xt
2022-06-03 22:18:58 +00:00
parent ce47942ba3
commit 558850e68f
3 changed files with 27 additions and 6 deletions

View File

@@ -931,6 +931,17 @@ mod tests {
// import to context2
let backup = has_backup(&context2, backup_dir.path().as_ref()).await?;
// Import of unencrypted backup with incorrect "foobar" backup passphrase fails.
assert!(imex(
&context2,
ImexMode::ImportBackup,
backup.as_ref(),
Some("foobar".to_string())
)
.await
.is_err());
assert!(
imex(&context2, ImexMode::ImportBackup, backup.as_ref(), None)
.await