bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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(CheckPackageNonExistance(pkgid, params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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", params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
ci::PkgQueryInterface pkg_query2(pkgid, params.test_user.uid, true);
std::string version_recovered = pkg_query2.Version();
ASSERT_TRUE(version_old == version_recovered);
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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));
params.test_user.uid);
ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
}
TEST_F(RollbackSmokeTest, UpdateMode) {
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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(CheckPackageNonExistance(pkgid, params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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));
ScopedTzipInterface interface(pkgid, params.test_user.uid);
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1", params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "shared/res/VERSION", "1",
params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
ci::PkgQueryInterface pkg_query2(pkgid, params.test_user.uid, true);
std::string version_recovered = pkg_query2.Version();
ASSERT_TRUE(version_old == version_recovered);
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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(CheckSharedDataExistance(pkgid, params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_NonSharedDataUpdate) {
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
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(CheckSharedDataNonExistance(pkgid, params));
+ ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
}
} // namespace smoke_test