#include <common/step/configuration/step_parse_preload.h>
#include <common/step/filesystem/step_acquire_external_storage.h>
#include <common/step/filesystem/step_optional_acquire_external_storage.h>
-#include <common/step/filesystem/step_clear_data.h>
#include <common/step/filesystem/step_change_ownership_and_permission.h>
#include <common/step/filesystem/step_copy.h>
#include <common/step/filesystem/step_copy_storage_directories.h>
AddStep<ci::filesystem::StepRecoverChangeOwner>();
AddStep<ci::security::StepRecoverSecurity>();
break;
- case ci::RequestType::Clear:
- AddStep<ci::configuration::StepConfigure>(pkgmgr_);
- AddStep<ci::configuration::StepParseManifest>(
- ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
- ci::configuration::StepParseManifest::StoreLocation::NORMAL);
- AddStep<ci::filesystem::StepClearData>();
- break;
case ci::RequestType::MountInstall:
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::mount::StepMountUnpacked>();
return Install(delta_package, type);
}
-ci::AppInstaller::Result Clear(const std::string& pkgid,
- PackageType type,
- RequestResult mode = RequestResult::NORMAL) {
- const char* argv[] = {"", "-c", pkgid.c_str(), "-u", kTestUserIdStr.c_str()};
- return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
-}
-
ci::AppInstaller::Result EnablePackage(const std::string& pkgid,
PackageType type,
RequestResult mode = RequestResult::NORMAL) {
ValidatePackageFS(pkgid, {appid});
}
-TEST_F(SmokeTest, ClearMode) {
- bf::path path = kSmokePackagesDirectory / "ClearMode.wgt";
- std::string pkgid = "smokeapp20";
- std::string appid = "smokeapp20.ClearMode";
- ASSERT_EQ(Install(path, PackageType::WGT),
- ci::AppInstaller::Result::OK);
- bs::error_code error;
- bf::create_directory(GetPackageRoot(pkgid) / "data" / "dir", error);
- ASSERT_FALSE(error);
- ASSERT_TRUE(TouchFile(GetPackageRoot(pkgid) / "data" / "dir" / "file"));
- ASSERT_TRUE(TouchFile(GetPackageRoot(pkgid) / "data" / "file"));
- ASSERT_EQ(Clear(pkgid, PackageType::WGT), ci::AppInstaller::Result::OK);
- ValidatePackage(pkgid, {appid});
- ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid) / "data" / "dir" / "file"));
- ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid) / "res" / "file"));
-}
-
TEST_F(SmokeTest, DeltaMode) {
bf::path path = kSmokePackagesDirectory / "DeltaMode.wgt";
bf::path delta_package = kSmokePackagesDirectory / "DeltaMode.delta";
#include <common/step/filesystem/step_acquire_external_storage.h>
#include <common/step/filesystem/step_optional_acquire_external_storage.h>
#include <common/step/filesystem/step_change_ownership_and_permission.h>
-#include <common/step/filesystem/step_clear_data.h>
#include <common/step/filesystem/step_copy.h>
#include <common/step/filesystem/step_copy_storage_directories.h>
#include <common/step/filesystem/step_copy_tep.h>
AddStep<ci::security::StepRecoverSecurity>();
break;
}
- case ci::RequestType::Clear: {
- AddStep<ci::configuration::StepConfigure>(pkgmgr_);
- AddStep<ci::configuration::StepParseManifest>(
- ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
- ci::configuration::StepParseManifest::StoreLocation::NORMAL);
- AddStep<ci::filesystem::StepClearData>();
- break;
- }
case ci::RequestType::MountInstall: {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::mount::StepMountUnpacked>();