bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
- EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+ if (recovery_info->cleanup()) {
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+ EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
+ ci::AppInstaller::Result::OK);
+ } else {
+ EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+ }
}
return true;
}, params.pkg_type);
bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+ std::string version = recovery_info->cleanup() ? "2\n" :"1\n";
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
- "res/wgt/VERSION", "1\n", params));
+ "res/wgt/VERSION", version, params));
EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+
+ if (recovery_info->cleanup()) {
+ EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
+ ci::AppInstaller::Result::OK);
+ EXTENDED_ASSERT_EQ(backend.Install(path_old),
+ ci::AppInstaller::Result::OK);
+ AddDataFiles(pkgid, params.test_user.uid);
+ }
}
return true;
}, params.pkg_type);
bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+ std::string contents = recovery_info->cleanup() ? "2\n" : "1\n";
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
- "res/wgt/VERSION", "1\n", params));
+ "res/wgt/VERSION", contents, params));
EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+
+ if (recovery_info->cleanup()) {
+ EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
+ ci::AppInstaller::Result::OK);
+ EXTENDED_ASSERT_EQ(backend.Install(path_old),
+ ci::AppInstaller::Result::OK);
+ AddDataFiles(pkgid, params.test_user.uid);
+ }
}
return true;
}, params.pkg_type);
bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
- EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+ ScopedTzipInterface interface(pkgid, params.test_user.uid);
+ if (recovery_info->cleanup()) {
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+ EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
+ ci::AppInstaller::Result::OK);
+ } else {
+ EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+ }
}
return true;
}, params.pkg_type);
bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
+ std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+ GetRecoverFileInfo(recovery_file);
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
ScopedTzipInterface interface(pkgid, params.test_user.uid);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+ std::string version = recovery_info->cleanup() ? "2\n" : "1\n";
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(
- pkgid, "res/wgt/VERSION", "1\n", params));
+ pkgid, "res/wgt/VERSION", version, params));
EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+ if (recovery_info->cleanup()) {
+ interface.Release();
+ EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
+ ci::AppInstaller::Result::OK);
+ EXTENDED_ASSERT_EQ(backend.MountInstall(path_old),
+ ci::AppInstaller::Result::OK);
+ AddDataFiles(pkgid, params.test_user.uid);
+ }
}
return true;
}, params.pkg_type);