params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(
- ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n", params));
+ ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION",
+ recovery_info->cleanup() ? "2\n" : "1\n", params));
} else {
std::cout << "update finished before process killed" << std::endl;
}
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Recover(recovery_file));
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n",
- params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
+ ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION",
+ recovery_info->cleanup() ? "2\n" : "1\n", params));
+ bool deleted_exist = bf::exists(root_path / pkgid / "res/DELETED");
+ bool added_exist = bf::exists(root_path / pkgid / "res/ADDED");
+ ASSERT_NE(deleted_exist, added_exist);
+ ASSERT_TRUE(recovery_info->cleanup() ? added_exist : deleted_exist);
} else {
std::cout << "delta finished before process killed" << std::endl;
}