# Compiler flags
SET(EXTRA_FLAGS "-Wall -Wextra")
SET(CMAKE_C_FLAGS_PROFILING "-O2 -flto ${EXTRA_FLAGS}")
-SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -flto -std=c++14 ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -flto -std=c++17 ${EXTRA_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ${EXTRA_FLAGS}")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++14 -g ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++17 -g ${EXTRA_FLAGS}")
SET(CMAKE_C_FLAGS_RELEASE "-O2 -flto -g ${EXTRA_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -flto -std=c++14 -g ${EXTRA_FLAGS}")
-SET(CMAKE_CXX_FLAGS_CCOV "-O0 -std=c++14 -g --coverage ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -flto -std=c++17 -g ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_CCOV "-O0 -std=c++17 -g --coverage ${EXTRA_FLAGS}")
# Linker flags
SET(EXTRA_LINKER_FLAGS "-Wl,--as-needed")
PKG_CHECK_MODULES(GUM_DEPS REQUIRED libgum)
PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
-FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
-
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
Source1002: tpk-installer-tests.manifest
Requires: tpk-installer = %{version}
-BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: app-installers-tests
BuildRequires: pkgconfig(app-installers)
MANIFEST_PARSER_DEPS
TPK_MANIFEST_HANDLERS_DEPS
VCONF_DEPS
- Boost
)
INSTALL(TARGETS ${TARGET_LIBNAME_TPK_ARCHIVE_INFO} DESTINATION ${SYSCONF_INSTALL_DIR}/package-manager/backendlib)
#include <vconf.h>
-#include <boost/filesystem/path.hpp>
-
#include <tpk_manifest_handlers/tpk_config_parser.h>
#include <tpk_manifest_handlers/application_manifest_constants.h>
#include <tpk_manifest_handlers/author_handler.h>
#include <cstdlib>
#include <cstring>
+#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace {
bool TpkArchiveInfo::ExtractPackageArchive(const std::string& archive_path,
const std::string& file, const std::string& tmp_dir) {
- if (!ci::ExtractToTmpDir(archive_path.c_str(), bf::path(tmp_dir),
+ if (!ci::ExtractToTmpDir(archive_path.c_str(), fs::path(tmp_dir),
file.c_str())) {
LOG(ERROR) << "Failed to extract";
return false;
return false;
}
-bool TpkArchiveInfo::ReadIcon(const bf::path& icon, const bf::path& tmp_dir) {
- bf::path icon_path = tmp_dir / icon;
+bool TpkArchiveInfo::ReadIcon(const fs::path& icon, const fs::path& tmp_dir) {
+ fs::path icon_path = tmp_dir / icon;
LOG(INFO) << "Icon file path: " << icon_path;
- if (!bf::exists(icon_path)) {
+ if (!fs::exists(icon_path)) {
LOG(WARNING) << "Icon file doesn't actually exist, skip reading icon";
return true;
}
}
bool TpkArchiveInfo::LoadArchiveInfo() {
- bf::path tmp_dir = ci::GenerateTmpDir("/tmp");
+ fs::path tmp_dir = ci::GenerateTmpDir("/tmp");
if (!ci::CreateDir(tmp_dir))
return false;
return false;
tpk::parse::TPKConfigParser parser;
- bf::path manifest_path = tmp_dir / kManifestFileName;
+ fs::path manifest_path = tmp_dir / kManifestFileName;
if (!parser.ParseManifest(manifest_path)) {
LOG(ERROR) << "Failed to parse";
return false;
free(locale);
if (!icon_.empty()) {
- bf::path icon_path = bf::path(kSharedResDir) / icon_;
+ fs::path icon_path = fs::path(kSharedResDir) / icon_;
if (!ExtractPackageArchive(path_, icon_path.string(), tmp_dir.string())) {
RemoveTmpDir(tmp_dir.string());
return false;
#ifndef LIB_TPK_ARCHIVE_INFO_H_
#define LIB_TPK_ARCHIVE_INFO_H_
-#include <boost/filesystem/path.hpp>
-
#include <common/archive_info.h>
#include <tpk_manifest_handlers/tpk_config_parser.h>
#include <manifest_parser/utils/logging.h>
+#include <filesystem>
#include <string>
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
class TpkArchiveInfo : public common_installer::ArchiveInfo {
public:
const char* locale);
bool GetIconInfo(const tpk::parse::TPKConfigParser& parser,
const char* locale);
- bool ReadIcon(const bf::path& icon, const bf::path& tmp_dir);
+ bool ReadIcon(const fs::path& icon, const fs::path& tmp_dir);
SCOPE_LOG_TAG(TpkArchiveInfo)
};
CAPI_SYSTEM_INFO_DEPS
TTRACE_DEPS
VCONF_DEPS
- Boost
)
TARGET_LINK_LIBRARIES(${TARGET_TPK_BACKEND} PRIVATE ${TARGET_LIBNAME_TPK})
#include "tpk/step/configuration/step_check_reinstall_manifest.h"
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/system/error_code.hpp>
-
#include <common/utils/file_util.h>
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
+#include <filesystem>
+
+namespace fs = std::filesystem;
namespace {
namespace configuration {
common_installer::Step::Status StepCheckReinstallManifest::process() {
- bf::path target = context_->unpacked_dir_path.get() / kManifest;
+ fs::path target = context_->unpacked_dir_path.get() / kManifest;
- if (bf::exists(target))
+ if (fs::exists(target))
return Status::OK;
- bf::path source = context_->root_application_path.get() /
+ fs::path source = context_->root_application_path.get() /
context_->pkgid.get() / kManifest;
- if (!bf::exists(source)) {
+ if (!fs::exists(source)) {
LOG(ERROR) << "Cannot find old manifest file";
return Status::APP_DIR_ERROR;
}
#include "tpk/step/filesystem/step_check_pkg_directory_path.h"
-#include <boost/filesystem.hpp>
+#include <filesystem>
#include <string>
#include <common/utils/file_util.h>
+namespace fs = std::filesystem;
+
namespace tpk {
namespace filesystem {
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
-
common_installer::Step::Status StepCheckPkgDirPath::process() {
- if (bf::exists(context_->GetPkgPath()))
+ if (fs::exists(context_->GetPkgPath()))
return Status::OK;
LOG(INFO) << "Create pkg_path(" << context_->GetPkgPath()
#include "tpk/step/filesystem/step_create_tpk_symbolic_link.h"
-#include <boost/filesystem.hpp>
-#include <boost/system/error_code.hpp>
-
#include <common/installer/app_installer.h>
#include <common/step/step.h>
#include <common/installer_context.h>
#include <pkgmgr-info.h>
+#include <filesystem>
#include <iostream>
+#include <system_error>
+
+namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace tpk {
namespace filesystem {
-namespace bf = boost::filesystem;
-namespace ci = common_installer;
-
using common_installer::InstallerContext;
typedef common_installer::Step::Status Status;
-bool CreateUGClientSymlink(const bf::path& app_exec_path) {
- bf::path ug_client_path(tzplatform_mkpath(TZ_SYS_BIN, "ug-client"));
+bool CreateUGClientSymlink(const fs::path& app_exec_path) {
+ fs::path ug_client_path(tzplatform_mkpath(TZ_SYS_BIN, "ug-client"));
LOG(INFO) << "Createing symlink " << app_exec_path << " pointing " <<
ug_client_path;
- boost::system::error_code error;
- bf::create_symlink(ug_client_path, app_exec_path, error);
+ std::error_code error;
+ fs::create_symlink(ug_client_path, app_exec_path, error);
if (error) {
LOG(ERROR) << "Symlink creation failure: " << app_exec_path
<< ", error :" << error.message();
}
bool CreateSymLink(application_x* app, InstallerContext* context) {
- bf::path bindir = context->GetPkgPath() / bf::path("bin");
+ fs::path bindir = context->GetPkgPath() / fs::path("bin");
LOG(DEBUG) << "Creating dir: " << bindir;
- if (!bf::is_symlink(symlink_status(bindir)) &&
+ if (!fs::is_symlink(symlink_status(bindir)) &&
!common_installer::CreateDir(bindir)) {
LOG(ERROR) << "Directory creation failure: " << bindir;
return false;
if (!app->ui_gadget || strcmp(app->ui_gadget, "true") != 0)
return true;
- bf::path app_exec_path(app->exec);
- if (bf::exists(app_exec_path))
+ fs::path app_exec_path(app->exec);
+ if (fs::exists(app_exec_path))
return true;
if (!CreateUGClientSymlink(app_exec_path))
#include "tpk/step/filesystem/step_tpk_patch_icons.h"
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
#include <common/utils/file_util.h>
#include <common/utils/glist_range.h>
#include <pkgmgr-info.h>
#include <cstring>
+#include <filesystem>
#include <string>
+#include <system_error>
#include <vector>
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
+namespace fs = std::filesystem;
namespace {
// This function checks for alternative locations of icon file of tpk package
-bf::path LocateIcon(const bf::path& filename, const std::string& pkgid,
- const bf::path& root_path, uid_t uid, bool is_readonly) {
- std::vector<bf::path> locations;
+fs::path LocateIcon(const fs::path& filename, const std::string& pkgid,
+ const fs::path& root_path, uid_t uid, bool is_readonly) {
+ std::vector<fs::path> locations;
// FIXME: icons for readonly apps should also be moved to "shared/res"
const char* extra_icon_path = getIconPath(uid, is_readonly);
if (extra_icon_path) {
- bf::path system_location = bf::path(extra_icon_path) / filename;
- bf::path small_system_location =
- bf::path(extra_icon_path) / "default" / "small" / filename;
+ fs::path system_location = fs::path(extra_icon_path) / filename;
+ fs::path small_system_location =
+ fs::path(extra_icon_path) / "default" / "small" / filename;
locations.push_back(system_location);
locations.push_back(small_system_location);
}
- bf::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
+ fs::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
locations.push_back(res_icons_location);
for (auto& location : locations) {
- if (bf::exists(location))
+ if (fs::exists(location))
return location;
}
namespace filesystem {
common_installer::Step::Status StepTpkPatchIcons::ProcessIconOutsidePackage(
- const bf::path& common_icon_location, const bf::path& icon_text,
+ const fs::path& common_icon_location, const fs::path& icon_text,
application_x* app, icon_x* icon) {
- bf::path destination = common_icon_location / app->appid;
+ fs::path destination = common_icon_location / app->appid;
if (!icon_text.extension().empty())
destination += icon_text.extension();
}
common_installer::Step::Status StepTpkPatchIcons::FixIconLocation(
- const bf::path& icon_text) {
- bf::path source = LocateIcon(icon_text.filename(),
+ const fs::path& icon_text) {
+ fs::path source = LocateIcon(icon_text.filename(),
context_->pkgid.get(),
context_->root_application_path.get(),
context_->uid.get(),
}
common_installer::Step::Status StepTpkPatchIcons::process() {
- bf::path common_icon_location = context_->GetPkgPath() / "shared" / "res";
+ fs::path common_icon_location = context_->GetPkgPath() / "shared" / "res";
- bs::error_code error;
- bf::create_directories(common_icon_location, error);
+ std::error_code error;
+ fs::create_directories(common_icon_location, error);
if (error) {
LOG(ERROR) << "Failed to create directory :" << common_icon_location
<< ", error :" << error.message();
continue;
for (auto& icon : GListRange<icon_x*>(app->icon)) {
- bf::path icon_text(icon->text);
+ fs::path icon_text(icon->text);
if (icon_text.parent_path() != common_icon_location) {
// if location of icon was absolute and icon is not in common icon
// location, we just need to copy it and replace icon->text to insert
}
} else {
// look for icon in different location if it doesn't exist
- if (!bf::exists(icon_text)) {
+ if (!fs::exists(icon_text)) {
Status status = FixIconLocation(icon_text);
if (status != Status::OK)
return status;
#ifndef TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
#define TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
-#include <boost/filesystem/path.hpp>
-
#include <common/step/step.h>
#include <manifest_parser/utils/logging.h>
+#include <filesystem>
+
namespace tpk {
namespace filesystem {
private:
Status ProcessIconOutsidePackage(
- const boost::filesystem::path& common_icon_location,
- const boost::filesystem::path& icon_text,
+ const std::filesystem::path& common_icon_location,
+ const std::filesystem::path& icon_text,
application_x* app, icon_x* icon);
- Status FixIconLocation(const boost::filesystem::path& icon_text);
+ Status FixIconLocation(const std::filesystem::path& icon_text);
STEP_NAME(TpkPatchIcons)
};
#include "tpk/step/filesystem/step_tpk_prepare_package_directory.h"
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
-
#include <common/utils/paths.h>
#include <common/utils/file_util.h>
+#include <filesystem>
+#include <system_error>
+
#include "tpk/tpk_mount_path.h"
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace tpk {
namespace filesystem {
ci::Step::Status StepTpkPreparePackageDirectory::BackupDirectory(
- const std::string& entry, const bf::path& backup_path) {
+ const std::string& entry, const fs::path& backup_path) {
std::string root_entry = entry.substr(0, entry.find("/"));
- if (!bf::exists(context_->GetPkgPath() / root_entry))
+ if (!fs::exists(context_->GetPkgPath() / root_entry))
return Status::OK;
if (!ci::MoveDir(context_->GetPkgPath() / root_entry,
}
ci::Step::Status StepTpkPreparePackageDirectory::PrepareLink(
- const std::string& entry, const bf::path& mount_point) {
- bs::error_code error;
- bf::path mount_point_entry = mount_point / entry;
+ const std::string& entry, const fs::path& mount_point) {
+ std::error_code error;
+ fs::path mount_point_entry = mount_point / entry;
- if (!bf::exists(mount_point_entry))
+ if (!fs::exists(mount_point_entry))
return Status::OK;
- bf::path destination = context_->GetPkgPath() / entry;
- if (bf::exists(destination)) {
- if (!bf::is_symlink(symlink_status(destination))) {
+ fs::path destination = context_->GetPkgPath() / entry;
+ if (fs::exists(destination)) {
+ if (!fs::is_symlink(symlink_status(destination))) {
LOG(ERROR) << "Cannot proceed. "
<< "Location of link is used by another file";
return Status::APP_DIR_ERROR;
if (context_->request_type.get() == ci::RequestType::MountUpdate)
return Status::OK;
- bf::remove(destination, error);
+ fs::remove(destination, error);
if (error) {
LOG(ERROR) << "Failed to remove previous symlink";
return Status::APP_DIR_ERROR;
}
}
- bf::create_symlink(mount_point_entry, destination, error);
+ fs::create_symlink(mount_point_entry, destination, error);
if (error) {
LOG(ERROR) << "Failed to create symlink for entry: " << mount_point_entry;
return Status::APP_DIR_ERROR;
ci::Step::Status StepTpkPreparePackageDirectory::ExtractEntries() {
LOG(DEBUG) << "Extracting entries from zip package...";
- bf::path backup_path =
+ fs::path backup_path =
ci::GetBackupPathForPackagePath(context_->GetPkgPath());
for (auto& entry : tpk::GetExtractEntries()) {
}
ci::Step::Status StepTpkPreparePackageDirectory::PrepareLinks() {
- bf::path mount_point = ci::GetMountLocation(context_->GetPkgPath());
+ fs::path mount_point = ci::GetMountLocation(context_->GetPkgPath());
LOG(DEBUG) << "Creating symlinks to zip package...";
for (auto& link_entry : tpk::GetSymlinkEntries()) {
LOG(DEBUG) << "Symlink: " << link_entry;
for (auto& entry : tpk::GetExtractEntries()) {
std::string root_entry = entry.substr(0, entry.find("/"));
ci::RemoveAll(context_->GetPkgPath() / root_entry);
- if (!bf::exists(backupPath_ / root_entry))
+ if (!fs::exists(backupPath_ / root_entry))
continue;
ci::MoveDir(backupPath_ / root_entry, context_->GetPkgPath() / root_entry,
#include <manifest_parser/utils/logging.h>
-#include <boost/filesystem/path.hpp>
-
#include <common/installer_context.h>
#include <common/step/step.h>
#include <pkgmgrinfo_basic.h>
+#include <filesystem>
#include <string>
#include <vector>
protected:
Status BackupDirectory(const std::string& entry,
- const boost::filesystem::path& backup_path);
+ const std::filesystem::path& backup_path);
Status PrepareDirectory(const std::string& entry);
Status PrepareLinks();
Status ExtractEntries();
Status PrepareLink(const std::string& entry,
- const boost::filesystem::path& mount_point);
+ const std::filesystem::path& mount_point);
private:
- boost::filesystem::path backupPath_;
+ std::filesystem::path backupPath_;
STEP_NAME(TpkPreparePackageDirectory)
};
#include <pkgmgr_parser.h>
#include <pkgmgr-info.h>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
#include <common/utils/glist_range.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
+#include <filesystem>
#include <string>
+#include <system_error>
#include "common/utils/file_util.h"
-namespace bs = boost::system;
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace {
namespace pkgmgr {
common_installer::Step::Status StepConvertXml::precheck() {
- bf::path xml_path = context_->GetPkgPath();
+ fs::path xml_path = context_->GetPkgPath();
xml_path /= "tizen-manifest.xml";
- if (bf::exists(xml_path)) {
+ if (fs::exists(xml_path)) {
xml_path_ = xml_path;
- } else if (bf::exists(context_->xml_path.get())) {
+ } else if (fs::exists(context_->xml_path.get())) {
xml_path_ = context_->xml_path.get();
} else {
LOG(ERROR) << "Cannot find manifest file";
return Step::Status::MANIFEST_NOT_FOUND;
}
- new_path_ = bf::path(getUserManifestPath(context_->uid.get(),
- context_->is_readonly_package.get())) / bf::path(context_->pkgid.get());
+ new_path_ = fs::path(getUserManifestPath(context_->uid.get(),
+ context_->is_readonly_package.get())) / fs::path(context_->pkgid.get());
new_path_ += ".xml";
- if (bf::exists(new_path_)) {
+ if (fs::exists(new_path_)) {
backup_path_ = new_path_.string() + ".bck";
- bs::error_code error;
- bf::copy_file(new_path_, backup_path_, error);
+ std::error_code error;
+ fs::copy_file(new_path_, backup_path_, error);
if (error)
LOG(WARNING) << "Failed to backup original manifest file " << new_path_
<< " due to error: " << error;
}
common_installer::Step::Status StepConvertXml::process() {
- xmlDocPtr doc = xmlParseFile(xml_path_.string().c_str());
+ xmlDocPtr doc = xmlParseFile(xml_path_.c_str());
auto doc_ptr = std::unique_ptr<std::remove_pointer<xmlDocPtr>::type,
decltype(xmlFreeDoc)*>(doc, xmlFreeDoc);
if (!doc) {
if (!ConvertXml(doc))
return Step::Status::MANIFEST_ERROR;
- if (!bf::exists(new_path_.parent_path())) {
- bs::error_code error;
- bf::create_directories(new_path_.parent_path(), error);
+ if (!fs::exists(new_path_.parent_path())) {
+ std::error_code error;
+ fs::create_directories(new_path_.parent_path(), error);
}
- if (xmlSaveFile(new_path_.string().c_str(), doc) == -1) {
+ if (xmlSaveFile(new_path_.c_str(), doc) == -1) {
LOG(ERROR) << "Failed to write xml file";
return Step::Status::MANIFEST_ERROR;
}
if (backup_path_.empty())
return Step::Status::OK;
- bs::error_code error;
- bf::rename(backup_path_, new_path_, error);
+ std::error_code error;
+ fs::rename(backup_path_, new_path_, error);
if (error)
LOG(WARNING) << "Failed to restore " << new_path_
<< " due to error " << error;
#ifndef TPK_STEP_PKGMGR_STEP_CONVERT_XML_H_
#define TPK_STEP_PKGMGR_STEP_CONVERT_XML_H_
-#include <manifest_parser/utils/logging.h>
-
-#include <boost/filesystem/path.hpp>
+#include <common/step/step.h>
#include <libxml/tree.h>
+#include <manifest_parser/utils/logging.h>
-#include <common/step/step.h>
+#include <filesystem>
namespace tpk {
namespace pkgmgr {
Status precheck() override;
private:
- boost::filesystem::path xml_path_;
- boost::filesystem::path new_path_;
- boost::filesystem::path backup_path_;
+ std::filesystem::path xml_path_;
+ std::filesystem::path new_path_;
+ std::filesystem::path backup_path_;
bool ConvertXml(xmlDocPtr doc);
STEP_NAME(ConvertXml)
#include <common/utils/glist_range.h>
#include <manifest_parser/utils/version_number.h>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
+
+#include <filesystem>
#include <string>
#include <memory>
#include "common/utils/profile_util.h"
#include "common/installer_context.h"
-namespace bs = boost::system;
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
using libxml_char = const unsigned char *;
namespace pkgmgr {
common_installer::Step::Status StepManifestAdjustment::precheck() {
- bf::path xml_path = context_->xml_path.get();
+ fs::path xml_path = context_->xml_path.get();
- if (!bf::exists(xml_path)) {
+ if (!fs::exists(xml_path)) {
LOG(ERROR) << "Cannot find manifest file at " << xml_path;
return Step::Status::ERROR;
}
#ifndef TPK_STEP_PKGMGR_STEP_MANIFEST_ADJUSTMENT_H_
#define TPK_STEP_PKGMGR_STEP_MANIFEST_ADJUSTMENT_H_
+#include <common/step/step.h>
#include <manifest_parser/utils/logging.h>
-#include <boost/filesystem/path.hpp>
-
-#include <common/step/step.h>
+#include <filesystem>
namespace tpk {
namespace pkgmgr {
Status precheck() override;
private:
- boost::filesystem::path xml_path_;
+ std::filesystem::path xml_path_;
bool IsNonPrivilegedPackage();
bool IsAdjustmentNecessary();
// Use of this source code is governed by an apache 2.0 license that can be
// found in the LICENSE file.
+#include <filesystem>
+
#include "tpk/step/security/step_tpk_recover_signature.h"
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
namespace tpk {
namespace security {
-bf::path StepTpkRecoverSignature::GetSignatureRoot() {
+fs::path StepTpkRecoverSignature::GetSignatureRoot() {
return context_->GetPkgPath();
}
#include <common/step/security/step_recover_signature.h>
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
namespace tpk {
namespace security {
using StepRecoverSignature::StepRecoverSignature;
private:
- boost::filesystem::path GetSignatureRoot() override;
+ std::filesystem::path GetSignatureRoot() override;
STEP_NAME(TpkRecoverSignature)
};
#include <unistd.h>
#include <sys/types.h>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/system/error_code.hpp>
-
#include <common/utils/pkgmgr_query.h>
#include <common/utils/file_util.h>
#include <common/utils/request.h>
#include <tpk_manifest_handlers/package_handler.h>
#include <tpk_manifest_handlers/tpk_config_parser.h>
+#include <filesystem>
#include <memory>
#include <string>
+#include <system_error>
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace {
std::string TpkAppQueryInterface::GetPkgIdFromPath(
const std::string& path) const {
- bf::path tmp_path = ExtractManifest(path);
+ fs::path tmp_path = ExtractManifest(path);
if (tmp_path.empty())
return {};
- bf::path manifest_path = tmp_path / kManifestFileName;
- if (!bf::exists(manifest_path)) {
+ fs::path manifest_path = tmp_path / kManifestFileName;
+ if (!fs::exists(manifest_path)) {
ClearTemporaryFile(tmp_path);
return {};
}
ENDIF()
APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST} PUBLIC
- Boost
GMOCK_DEPS
GUM_DEPS
)
APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST_EXTENSIVE} PUBLIC
- Boost
GMOCK_DEPS
GUM_DEPS
)
APPLY_PKG_CONFIG(${TARGET_MANIFEST_TEST} PUBLIC
- Boost
GMOCK_DEPS
)
APPLY_PKG_CONFIG(${TARGET_RECOVERY_TEST} PUBLIC
- Boost
GMOCK_DEPS
GUM_DEPS
)
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
-#include <boost/exception/diagnostic_information.hpp>
-#include <boost/program_options.hpp>
-
#include <smoke_tests/common/smoke_utils.h>
+#include <getopt.h>
#include <gtest/gtest.h>
#include <gtest/gtest-death-test.h>
+#include <unistd.h>
#include "smoke_tests/tpk_smoke_utils.h"
-namespace bpo = boost::program_options;
namespace ci = common_installer;
enum class BackupType : int {
private:
ci::RequestMode request_mode_;
- std::vector<bf::path> backups_;
+ std::vector<fs::path> backups_;
bool no_backup_;
BackupType backup_type_;
};
};
TEST_F(SmokeTest, DeltaMode_Tpk_Rollback) {
- bf::path path = kSmokePackagesDirectory / "DeltaMode_Tpk_Rollback.tpk";
- bf::path delta_package = kSmokePackagesDirectory /
+ fs::path path = kSmokePackagesDirectory / "DeltaMode_Tpk_Rollback.tpk";
+ fs::path delta_package = kSmokePackagesDirectory /
"DeltaMode_Tpk_Rollback.delta";
std::string pkgid = "smoketpk28";
std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
// Check delta modifications
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "DELETED"));
- EXTENDED_ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "ADDED"));
- EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "bin" / "basicdali"));
- EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "shared" / "res" /
+ EXTENDED_ASSERT_TRUE(fs::exists(root_path / pkgid / "res" / "DELETED"));
+ EXTENDED_ASSERT_FALSE(fs::exists(root_path / pkgid / "res" / "ADDED"));
+ EXTENDED_ASSERT_TRUE(fs::exists(root_path / pkgid / "bin" / "basicdali"));
+ EXTENDED_ASSERT_TRUE(fs::exists(root_path / pkgid / "shared" / "res" /
"basicdali.png"));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/MODIFIED", "version 1\n", params));
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
std::string pkgid = "smokeapp15";
std::string appid = "smokeapp15.RecoveryModeTpkInstallation";
std::string exec = "native";
{"", "-i", path.c_str(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
std::string pkgid = "smokeapp16";
std::string appid = "smokeapp16.RecoveryModeTpkUpdate";
std::string exec = "native";
{"", "-i", path_new.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
}
#define TEP_TEST_STARTING_BLOCK(NUMBER) \
- bf::path path = kSmokePackagesDirectory / "TEP_Tpk"; \
+ fs::path path = kSmokePackagesDirectory / "TEP_Tpk"; \
path += #NUMBER; \
path += ".tpk"; \
- bf::path tep1 = kSmokePackagesDirectory / "tep1.tep"; \
- bf::path tep2 = kSmokePackagesDirectory / "tep2.tep"; \
+ fs::path tep1 = kSmokePackagesDirectory / "tep1.tep"; \
+ fs::path tep2 = kSmokePackagesDirectory / "tep2.tep"; \
std::string number = std::to_string(50 + NUMBER - 1); \
std::string pkgid = std::string("smokeapp") + number; \
std::string appid = pkgid + ".TEP"; \
EXTENDED_ASSERT_TRUE(new_file_status.Init());
EXTENDED_ASSERT_TRUE(expected_file_status.IsEqual(new_file_status));
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
- EXTENDED_ASSERT_FALSE(bf::exists(tep_file));
+ fs::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
+ EXTENDED_ASSERT_FALSE(fs::exists(tep_file));
return true;
});
}
EXTENDED_ASSERT_TRUE(expected_file_status.IsEqual(new_file_status));
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
- EXTENDED_ASSERT_FALSE(bf::exists(tep_file));
+ fs::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
+ EXTENDED_ASSERT_FALSE(fs::exists(tep_file));
return true;
});
}
}
TEST_F(SmokeTest, InstallationMode_Rollback) {
- bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk34";
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str()};
}
TEST_F(SmokeTest, RecoveryMode_ForDelta) {
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
std::string pkgid = "smoketpk35";
std::string appid = "smoketpk35.RecoveryMode_ForDelta";
std::string exec = "smoketpk35";
{"", "-i", path_new.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
EXTENDED_ASSERT_TRUE(
ValidateFileContentInPackage(pkgid, "res/MODIFIED", contents,
params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
FileInfoCollector new_file_status(pkgid, params);
EXTENDED_ASSERT_TRUE(new_file_status.Init());
if (recovery_info->cleanup()) {
EXTENDED_ASSERT_TRUE(expected_file_status_new.IsEqual(new_file_status));
- EXTENDED_ASSERT_FALSE(bf::exists(root_path / pkgid / "res/DELETED"));
- EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "res/ADDED"));
+ EXTENDED_ASSERT_FALSE(fs::exists(root_path / pkgid / "res/DELETED"));
+ EXTENDED_ASSERT_TRUE(fs::exists(root_path / pkgid / "res/ADDED"));
EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
BackendInterface::SubProcessResult::SUCCESS);
EXTENDED_ASSERT_EQ(backend.InstallWithSubprocess(path_old),
BackendInterface::SubProcessResult::SUCCESS);
} else {
EXTENDED_ASSERT_TRUE(expected_file_status_old.IsEqual(new_file_status));
- EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
- EXTENDED_ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
+ EXTENDED_ASSERT_TRUE(fs::exists(root_path / pkgid / "res/DELETED"));
+ EXTENDED_ASSERT_FALSE(fs::exists(root_path / pkgid / "res/ADDED"));
}
}
return true;
}
TEST_F(SmokeTest, UpdateMode_Rollback) {
- bf::path old_path = kSmokePackagesDirectory / "UpdateMode_Rollback.tpk";
- bf::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
+ fs::path old_path = kSmokePackagesDirectory / "UpdateMode_Rollback.tpk";
+ fs::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk36";
std::string appid = "smoketpk36.UpdateMode_Rollback";
std::string exec = "smoketpk36";
}
TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
std::string pkgid = "smoketpk37";
std::string appid = "smoketpk37.RecoveryMode_ForMountInstall";
std::string exec = "smoketpk37";
{"", "-w", path.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
}
TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
- bf::path path_old =
+ fs::path path_old =
kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.tpk";
- bf::path path_new =
+ fs::path path_new =
kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
std::string pkgid = "smoketpk38";
std::string appid = "smoketpk38.RecoveryMode_ForMountUpdate";
params.test_user.uid);
poweroff_unmount_interface.Release();
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
}
TEST_F(SmokeTest, MountInstallationMode_Rollback) {
- bf::path path =
+ fs::path path =
kSmokePackagesDirectory / "MountInstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk39";
std::string test_uid_str = std::to_string(params.test_user.uid);
}
TEST_F(SmokeTest, MountUpdateMode_Rollback) {
- bf::path old_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback.tpk";
- bf::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
+ fs::path old_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback.tpk";
+ fs::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk40";
std::string appid = "smoketpk40.MountUpdateMode_Rollback";
std::string exec = "smoketpk40";
}
TEST_F(PreloadSmokeTest, RecoveryMode_ForReadonlyUpdateInstall) {
- bf::path path_old = kSmokePackagesDirectory /
+ fs::path path_old = kSmokePackagesDirectory /
"RecoveryMode_ForReadonlyUpdateInstall.tpk";
- bf::path path_new = kSmokePackagesDirectory /
+ fs::path path_new = kSmokePackagesDirectory /
"RecoveryMode_ForReadonlyUpdateInstall_2.tpk";
std::string pkgid = "smoketpk46";
std::string appid = "smoketpk46.RecoveryMode_ForReadonlyUpdateInstall";
{"", "-i", path_new.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
}
TEST_F(SmokeTest, RecoveryMode_AddResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "RecoveryMode_AddResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "RecoveryMode_AddResControl_2.tpk";
std::string pkgid = "smoketpk50";
std::string appid = "smoketpk50.RecoveryMode_AddResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.InstallWithSubprocess(path_old),
{"", "-i", path_new.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
BackendInterface::SubProcessResult::SUCCESS);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bool dir_exists = recovery_info->cleanup();
- EXTENDED_ASSERT_EQ(bf::exists(root_path / pkgid / "res/mount/allowed"),
+ EXTENDED_ASSERT_EQ(fs::exists(root_path / pkgid / "res/mount/allowed"),
dir_exists);
- EXTENDED_ASSERT_EQ(bf::exists(root_path / pkgid / "res/mount/global"),
+ EXTENDED_ASSERT_EQ(fs::exists(root_path / pkgid / "res/mount/global"),
dir_exists);
FileInfoCollector new_file_status(pkgid, params);
EXTENDED_ASSERT_TRUE(new_file_status.Init());
}
TEST_F(SmokeTest, RecoveryMode_RemoveResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "RecoveryMode_RemoveResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "RecoveryMode_RemoveResControl_2.tpk";
std::string pkgid = "smoketpk51";
std::string appid = "smoketpk51.RecoveryMode_RemoveResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.InstallWithSubprocess(path_old),
{"", "-i", path_new.string(), "-u", test_uid_str.c_str()};
backend.CrashAfterEachStep(&args, [&](int step) -> bool {
if (step >= 2) {
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
BackendInterface::SubProcessResult::SUCCESS);
EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bool dir_exists = !recovery_info->cleanup();
- EXTENDED_ASSERT_EQ(bf::exists(root_path / pkgid / "res/mount/allowed"),
+ EXTENDED_ASSERT_EQ(fs::exists(root_path / pkgid / "res/mount/allowed"),
dir_exists);
- EXTENDED_ASSERT_EQ(bf::exists(root_path / pkgid / "res/mount/global"),
+ EXTENDED_ASSERT_EQ(fs::exists(root_path / pkgid / "res/mount/global"),
dir_exists);
FileInfoCollector new_file_status(pkgid, params);
EXTENDED_ASSERT_TRUE(new_file_status.Init());
} // namespace smoke_test
+const char kHelpMessage[] = R"(Allowed options:
+ --help display this help message
+ --no-backup Do test without backup
+ --backup-type arg <move|copy> set test's backup type 'move', 'copy and
+ remove'
+)";
+
+void PrintHelp() {
+ std::cerr << kHelpMessage;
+}
+
int main(int argc, char** argv) {
try {
bool no_backup = false;
}
testing::InitGoogleTest(&argc, argv);
- bpo::options_description options("Allowed options");
- bpo::variables_map opt_map;
- try {
- options.add_options()
- ("help", "display this help message")
- ("no-backup", "Do test without backup")
- ("backup-type", bpo::value<std::string>(), "<move|copy> set test's "
- "backup type \'move\', \'copy and remove\'");
- bpo::store(bpo::parse_command_line(argc, argv, options), opt_map);
- if (opt_map.count("help")) {
- std::cerr << options << std::endl;
- return -1;
- }
-
- if (opt_map.count("no-backup"))
- no_backup = true;
- if (opt_map.count("backup-type")) {
- if (opt_map["backup-type"].as<std::string>() == "move") {
- backup_type = BackupType::MOVE;
- } else if (opt_map["backup-type"].as<std::string>() == "copy") {
- backup_type = BackupType::COPY_AND_REMOVE;
- } else {
- std::cerr << options << std::endl;
+ const struct option long_opts[] = {
+ { "help", no_argument, nullptr, 'h' },
+ { "no-backup", no_argument, nullptr, 'n' },
+ { "backup-type", required_argument, nullptr, 'b' },
+ { 0, 0, 0, 0 },
+ };
+
+ while (true) {
+ int opt = getopt_long(argc, argv, "", long_opts, nullptr);
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'h':
+ PrintHelp();
return -1;
- }
+ case 'n':
+ no_backup = true;
+ break;
+ case 'b':
+ if (optarg) {
+ if (strcmp(optarg, "move") == 0) {
+ backup_type = BackupType::MOVE;
+ } else if (strcmp(optarg, "copy") == 0) {
+ backup_type = BackupType::COPY_AND_REMOVE;
+ } else {
+ PrintHelp();
+ return -1;
+ }
+ }
+ break;
+ default:
+ break;
}
- bpo::notify(opt_map);
- } catch (...) {
- std::cerr << "Exception occurred: "
- << boost::current_exception_diagnostic_information()
- << std::endl;
- return -1;
}
::env = static_cast<smoke_test::SmokeEnvironment*>(
#include "smoke_tests/manifest_test.h"
#include <cassert>
+#include <filesystem>
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace {
return context_->manifest_data.get();
}
-bf::path StepParseRunner::GetRootApplicationPath() const {
+fs::path StepParseRunner::GetRootApplicationPath() const {
return context_->root_application_path.get();
}
context_.reset(new ci::InstallerContext());
context_->root_application_path.set(ci::GetRootAppPath(false, getuid()));
context_->unpacked_dir_path.set(
- bf::path(kManifestTestcaseData) / dir_suffix_);
+ fs::path(kManifestTestcaseData) / dir_suffix_);
// Make sure that there is manifest file for testcase
- assert(bf::exists(context_->unpacked_dir_path.get() / "tizen-manifest.xml")
+ assert(fs::exists(context_->unpacked_dir_path.get() / "tizen-manifest.xml")
&& "Failed to stat manifest file");
}
#ifndef TEST_SMOKE_TESTS_MANIFEST_TEST_H_
#define TEST_SMOKE_TESTS_MANIFEST_TEST_H_
-#include <boost/filesystem/path.hpp>
-
#include <common/installer_context.h>
#include <common/step/configuration/step_parse_manifest.h>
#include <common/utils/glist_range.h>
#include <glib.h>
#include <gtest/gtest.h>
+#include <filesystem>
#include <memory>
#include <string>
bool Run();
manifest_x* GetManifest() const;
- boost::filesystem::path GetRootApplicationPath() const;
+ std::filesystem::path GetRootApplicationPath() const;
private:
void PrepareContext();
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
+#include <filesystem>
+
#include "smoke_tests/manifest_test.h"
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
TEST_F(ManifestTest, ManifestElement_Valid) {
StepParseRunner runner(GetMyName());
ASSERT_EQ(Size(&privileges), 1);
ASSERT_CSTR_EQ((*privileges.begin())->value,
"http://package0id/appdefined/test.read");
- bf::path path(m->root_path);
+ fs::path path(m->root_path);
path /= "res/cert";
ASSERT_CSTR_EQ((*privileges.begin())->license, path.c_str());
}
ASSERT_EQ(Size(&privileges), 2);
ASSERT_CSTR_EQ(((*privileges.begin()))->value,
"http://package0id/appdefined/test.read");
- bf::path path(m->root_path);
+ fs::path path(m->root_path);
path /= "res/cert";
ASSERT_CSTR_EQ(((*privileges.begin()))->license, path.c_str());
ASSERT_CSTR_EQ(((*++privileges.begin()))->value,
ASSERT_EQ(Size(&privileges), 1);
ASSERT_CSTR_EQ((*privileges.begin())->value,
"http://package0id/appdefined/test.read");
- bf::path path(m->root_path);
+ fs::path path(m->root_path);
path /= "res/cert";
ASSERT_CSTR_EQ((*privileges.begin())->license, path.c_str());
}
ASSERT_EQ(Size(&privileges), 2);
ASSERT_CSTR_EQ(((*privileges.begin()))->value,
"http://package0id/appdefined/test.read");
- bf::path path(m->root_path);
+ fs::path path(m->root_path);
path /= "res/cert";
ASSERT_CSTR_EQ(((*privileges.begin()))->license, path.c_str());
ASSERT_CSTR_EQ(((*++privileges.begin()))->value,
#include "smoke_tests/manifest_test.h"
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
-
+#include <filesystem>
+#include <tuple>
#include <vector>
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
TEST_F(ManifestTest, ServiceApplicationElement_Valid) {
StepParseRunner runner(GetMyName());
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 8);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
found_app_controls.emplace_back(item->operation, item->uri, item->mime);
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto uri : {"scheme1://", "scheme2://"}) {
for (auto mime : {"application/text", "application/pdf"}) {
- ASSERT_IN(boost::make_tuple(operation, uri, mime), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, uri, mime), found_app_controls);
}
}
}
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 4);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
ASSERT_EQ(item->mime, nullptr);
for (auto operation : {"http://tizen.org/appcontrol/operation/compose1",
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto uri : {"scheme1://", "scheme2://"}) {
- ASSERT_IN(boost::make_tuple(operation, uri, ""), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, uri, ""), found_app_controls);
}
}
}
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 4);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
ASSERT_EQ(item->uri, nullptr);
for (auto operation : {"http://tizen.org/appcontrol/operation/compose1",
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto mime : {"application/text", "application/pdf"}) {
- ASSERT_IN(boost::make_tuple(operation, "", mime), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, "", mime), found_app_controls);
}
}
}
ASSERT_NE(app, nullptr);
auto icons = GListRange<icon_x*>(app->icon);
ASSERT_EQ(Size(&icons), 1);
- ASSERT_EQ(bf::path((*icons.begin())->text).filename().string(),
+ ASSERT_EQ(fs::path((*icons.begin())->text).filename().string(),
"test_icon.png");
}
#include "smoke_tests/manifest_test.h"
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
-
+#include <filesystem>
+#include <tuple>
#include <vector>
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
TEST_F(ManifestTest, UIApplicationElement_Valid) {
StepParseRunner runner(GetMyName());
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 8);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
found_app_controls.emplace_back(item->operation, item->uri, item->mime);
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto uri : {"scheme1://", "scheme2://"}) {
for (auto mime : {"application/text", "application/pdf"}) {
- ASSERT_IN(boost::make_tuple(operation, uri, mime), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, uri, mime), found_app_controls);
}
}
}
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 4);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
ASSERT_EQ(item->mime, nullptr);
for (auto operation : {"http://tizen.org/appcontrol/operation/compose1",
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto uri : {"scheme1://", "scheme2://"}) {
- ASSERT_IN(boost::make_tuple(operation, uri, ""), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, uri, ""), found_app_controls);
}
}
}
auto appcontrols = GListRange<appcontrol_x*>(app->appcontrol);
ASSERT_EQ(Size(&appcontrols), 4);
- std::vector<boost::tuple<std::string, std::string, std::string>>
+ std::vector<std::tuple<std::string, std::string, std::string>>
found_app_controls;
for (auto& item : appcontrols) {
ASSERT_EQ(item->uri, nullptr);
for (auto operation : {"http://tizen.org/appcontrol/operation/compose1",
"http://tizen.org/appcontrol/operation/compose2"}) {
for (auto mime : {"application/text", "application/pdf"}) {
- ASSERT_IN(boost::make_tuple(operation, "", mime), found_app_controls);
+ ASSERT_IN(std::make_tuple(operation, "", mime), found_app_controls);
}
}
}
ASSERT_NE(app, nullptr);
auto icons = GListRange<icon_x*>(app->icon);
ASSERT_EQ(Size(&icons), 1);
- ASSERT_EQ(bf::path((*icons.begin())->text).filename().string(),
+ ASSERT_EQ(fs::path((*icons.begin())->text).filename().string(),
"test_icon.png");
}
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
+#include <filesystem>
+
#include "smoke_tests/manifest_test.h"
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
TEST_F(ManifestTest, WatchApplicationElement_Valid) {
StepParseRunner runner(GetMyName());
ASSERT_NE(app, nullptr);
auto icons = GListRange<icon_x*>(app->icon);
ASSERT_EQ(Size(&icons), 1);
- ASSERT_EQ(bf::path((*icons.begin())->text).filename().string(),
+ ASSERT_EQ(fs::path((*icons.begin())->text).filename().string(),
"test_icon.png");
}
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
+#include <filesystem>
+
#include "smoke_tests/manifest_test.h"
-namespace bf = boost::filesystem;
namespace ci = common_installer;
+namespace fs = std::filesystem;
TEST_F(ManifestTest, WidgetApplicationElement_Valid) {
StepParseRunner runner(GetMyName());
ASSERT_NE(app, nullptr);
auto icons = GListRange<icon_x*>(app->icon);
ASSERT_EQ(Size(&icons), 1);
- ASSERT_EQ(bf::path((*icons.begin())->text).filename().string(),
+ ASSERT_EQ(fs::path((*icons.begin())->text).filename().string(),
"test_icon.png");
}
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
-#include <boost/exception/diagnostic_information.hpp>
-#include <boost/program_options.hpp>
-
#include <common/utils/subprocess.h>
#include <smoke_tests/common/smoke_utils.h>
+#include <getopt.h>
#include <gtest/gtest.h>
+#include <unistd.h>
+#include <filesystem>
#include <map>
#include <string>
#include <vector>
#include "smoke_tests/tpk_smoke_utils.h"
-namespace bf = boost::filesystem;
-namespace bpo = boost::program_options;
namespace ci = common_installer;
+namespace fs = std::filesystem;
enum class ReqType : int {
UNKNOWN_REQ,
private:
ci::RequestMode request_mode_;
- std::vector<bf::path> backups_;
+ std::vector<fs::path> backups_;
bool no_backup_;
BackupType backup_type_;
};
TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
int wait_time = delay + interval * test_count;
BackendInterface::SubProcessResult ret = backend.InstallWithSubprocessAndKill(
}
ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
std::string pkgid = "recoverypkg";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
TEST_F(SmokeTest, RecoveryMode_Tpk_Uninstallation) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
BackendInterface::SubProcessResult ret = backend.InstallWithSubprocess(path);
if (ret != BackendInterface::SubProcessResult::SUCCESS) {
}
ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryPkg2.tpk";
int wait_time = delay + interval * test_count;
ASSERT_EQ(backend.InstallWithSubprocess(path_old),
std::string pkgid = "recoverypkg";
std::string appid = "recoverypkg";
std::string exec = "recoverypkg";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
TEST_F(SmokeTest, RecoveryMode_ForDelta) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg.delta";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryPkg.delta";
int wait_time = delay + interval * test_count;
ASSERT_EQ(backend.InstallWithSubprocess(path_old),
std::string pkgid = "recoverypkg";
std::string appid = "recoverypkg";
std::string exec = "recoverypkg";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
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");
+ bool deleted_exist = fs::exists(root_path / pkgid / "res/DELETED");
+ bool added_exist = fs::exists(root_path / pkgid / "res/ADDED");
ASSERT_NE(deleted_exist, added_exist);
ASSERT_TRUE(recovery_info->cleanup() ? added_exist : deleted_exist);
}
TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
int wait_time = delay + interval * test_count;
BackendInterface::SubProcessResult ret = backend.MountInstallWithSubprocessAndKill(
}
std::string pkgid = "recoverypkg";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path_old =
+ fs::path path_old =
kSmokePackagesDirectory / "RecoveryPkg.tpk";
- bf::path path_new =
+ fs::path path_new =
kSmokePackagesDirectory / "RecoveryPkg2.tpk";
int wait_time = delay + interval * test_count;
std::string pkgid = "recoverypkg";
std::string appid = "recoverypkg";
std::string exec = "recoverypkg";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
if (recovery_file.empty()) {
std::cout << "recovery file dosen't exist, "
} // namespace smoke_test
const int kBufSize = 1024;
+const struct option long_opts[] = {
+ { "help", no_argument, nullptr, 'h' },
+ { "install", no_argument, nullptr, 'i' },
+ { "uninstall", no_argument, nullptr, 'd' },
+ { "update", no_argument, nullptr, 'u' },
+ { "delta", no_argument, nullptr, 'D' },
+ { "mount-install", no_argument, nullptr, 'm' },
+ { "mount-update", no_argument, nullptr, 'M' },
+ { "delay", required_argument, nullptr, 't' },
+ { "interval", required_argument, nullptr, 'I' },
+ { "repeat", required_argument, nullptr, 'r' },
+ { "no-backup", no_argument, nullptr, 'n' },
+ { "backup-type", required_argument, nullptr, 'b' },
+ { 0, 0, 0, 0 }
+};
+
+const char kHelpMessage[] = R"(Allowed options:
+ --help display this help message
+ --install recovery test for forced termination during package
+ installing
+ --uninstall recovery test for forced termination during package
+ uninstallation
+ --update recovery test for forced termination during package
+ updating
+ --delta recovery test for forced termination during package
+ delta installing
+ --mount-install recovery test for forced termination during package
+ mount-installing
+ --mount-update recovery test for forced termination during package
+ mount-updating
+ --delay arg fixed delay for forced termination
+ unit : microsecond (ex. 1000000us = 1s)
+ --interval arg use with repeat option.
+ as it repeat the interval is added to delay
+ unit : microsecond (ex. 1000000us = 1s)
+ --repeat arg option for performing tests repeatedly
+ enter -1 to test infinitely
+ --no-backup Do test without backup
+ --backup-type arg <move|copy> set test's backup type 'move', 'copy and
+ remove'
+)";
+
+void PrintHelp() {
+ std::cerr << kHelpMessage;
+}
int main(int argc, char** argv) {
try {
if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL)
std::cout << "Run recovery test with user request mode" << std::endl;
- bpo::options_description options("Allowed options");
- bpo::variables_map opt_map;
- options.add_options()
- ("help", "display this help message")
- ("install",
- "recovery test for forced termination "
- "during package installing")
- ("uninstall",
- "recovery test for forced termination "
- "during package uninstallation")
- ("update",
- "recovery test for forced termination "
- "during package updating")
- ("delta",
- "recovery test for forced termination "
- "during package delta installing")
- ("mount-install",
- "recovery test for forced termination "
- "during package mount-installing")
- ("mount-update",
- "recovery test for forced termination "
- "during package mount-updating")
- ("delay", bpo::value<int>(), "fixed delay for forced termination\n"
- "unit : microsecond (ex. 1000000us = 1s)")
- ("interval", bpo::value<int>(),
- "use with repeat option.\n"
- "as it repeat the interval is added to delay\n"
- "unit : microsecond (ex. 1000000us = 1s)")
- ("repeat", bpo::value<int>(), "option for performing tests repeatedly\n"
- "enter -1 to test infinitely")
- ("no-backup", "Do test without backup")
- ("backup-type", bpo::value<std::string>(), "<move|copy> set test's "
- "backup type \'move\', \'copy and remove\'");
- bpo::store(bpo::command_line_parser(argc, argv).
- options(options).allow_unregistered().run(), opt_map);
- if (opt_map.count("help")) {
- std::cerr << options << std::endl;
- return -1;
- }
-
- if (opt_map.count("install"))
- req_type = ReqType::INSTALL_REQ;
- if (opt_map.count("uninstall"))
- req_type = ReqType::UNINSTALL_REQ;
- else if (opt_map.count("update"))
- req_type = ReqType::UPDATE_REQ;
- else if (opt_map.count("delta"))
- req_type = ReqType::DELTA_REQ;
- else if (opt_map.count("mount-install"))
- req_type = ReqType::MOUNT_INSTALL_REQ;
- else if (opt_map.count("mount-update"))
- req_type = ReqType::MOUNT_UPDATE_REQ;
-
- if (opt_map.count("delay"))
- delay = opt_map["delay"].as<int>();
-
- if (opt_map.count("interval"))
- interval = opt_map["interval"].as<int>();
-
- if (opt_map.count("repeat")) {
- repeat = true;
- repeat_count = opt_map["repeat"].as<int>();
- }
-
- if (opt_map.count("no-backup"))
- no_backup = true;
- if (opt_map.count("backup-type")) {
- if (opt_map["backup-type"].as<std::string>() == "move") {
- backup_type = BackupType::MOVE;
- } else if (opt_map["backup-type"].as<std::string>() == "copy") {
- backup_type = BackupType::COPY_AND_REMOVE;
- } else {
- std::cerr << options << std::endl;
- return -1;
+ while (true) {
+ int opt = getopt_long(argc, argv, "", long_opts, nullptr);
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'h':
+ PrintHelp();
+ return -1;
+ case 'i':
+ req_type = ReqType::INSTALL_REQ;
+ break;
+ case 'd':
+ req_type = ReqType::UNINSTALL_REQ;
+ break;
+ case 'u':
+ req_type = ReqType::UPDATE_REQ;
+ break;
+ case 'D':
+ req_type = ReqType::DELTA_REQ;
+ break;
+ case 'm':
+ req_type = ReqType::MOUNT_INSTALL_REQ;
+ break;
+ case 'M':
+ req_type = ReqType::MOUNT_UPDATE_REQ;
+ break;
+ case 't':
+ if (optarg)
+ delay = std::stoi(optarg);
+ break;
+ case 'I':
+ if (optarg)
+ interval = std::stoi(optarg);
+ break;
+ case 'r':
+ if (optarg) {
+ repeat = true;
+ repeat_count = std::stoi(optarg);
+ }
+ break;
+ case 'n':
+ no_backup = true;
+ break;
+ case 'b':
+ if (optarg) {
+ if (strncmp(optarg, "move", strlen("move")) == 0) {
+ backup_type = BackupType::MOVE;
+ } else if (strncmp(optarg, "copy", strlen("copy")) == 0) {
+ backup_type = BackupType::COPY_AND_REMOVE;
+ } else {
+ PrintHelp();
+ return -1;
+ }
+ }
+ break;
+ default:
+ PrintHelp();
+ return -1;
}
}
- bpo::notify(opt_map);
if (req_type == ReqType::UNKNOWN_REQ) {
- std::cerr << options << std::endl;
+ PrintHelp();
return 0;
}
// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
-#include <boost/exception/diagnostic_information.hpp>
-#include <boost/program_options.hpp>
-
#include <common/utils/subprocess.h>
#include <common/utils/file_util.h>
#include <common/utils/pkgmgr_query.h>
#include <smoke_tests/common/smoke_utils.h>
+#include <getopt.h>
#include <gtest/gtest.h>
#include <gtest/gtest-death-test.h>
+#include <unistd.h>
#include "smoke_tests/tpk_smoke_utils.h"
namespace st = smoke_test;
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
namespace ci = common_installer;
-namespace bpo = boost::program_options;
enum class BackupType : int {
MOVE,
private:
ci::RequestMode request_mode_;
- std::vector<bf::path> backups_;
+ std::vector<fs::path> backups_;
bool no_backup_;
BackupType backup_type_;
};
// cause bad results of some smoke tests.
TEST_F(SmokeTest, DeltaMode_Tpk) {
- bf::path path = kSmokePackagesDirectory / "DeltaMode_Tpk.tpk";
- bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Tpk.delta";
+ fs::path path = kSmokePackagesDirectory / "DeltaMode_Tpk.tpk";
+ fs::path delta_package = kSmokePackagesDirectory / "DeltaMode_Tpk.delta";
std::string pkgid = "smokeapp18";
std::string appid = "smokeapp18.DeltaModeTpk";
std::string exec = "native";
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check delta modifications
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- ASSERT_FALSE(bf::exists(root_path / pkgid / "DELETED"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "ADDED"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "bin" / "native"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "shared" / "res" / "native.png"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "DELETED"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "ADDED"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "bin" / "native"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "shared" / "res" / "native.png"));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "MODIFIED", "version 2\n",
params));
}
TEST_F(RollbackSmokeTest, DeltaMode) {
- bf::path path = kSmokePackagesDirectory / "DeltaMode_Tpk_Rollback.tpk";
- bf::path delta_package = kSmokePackagesDirectory /
+ fs::path path = kSmokePackagesDirectory / "DeltaMode_Tpk_Rollback.tpk";
+ fs::path delta_package = kSmokePackagesDirectory /
"DeltaMode_Tpk_Rollback.delta";
std::string pkgid = "smoketpk28";
std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check delta modifications
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "DELETED"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "ADDED"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "bin" / "basicdali"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "shared" / "res" /
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res" / "DELETED"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res" / "ADDED"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "bin" / "basicdali"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "shared" / "res" /
"basicdali.png"));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/MODIFIED",
}
TEST_F(SmokeTest, ReinstallMode_Tpk) {
- bf::path path = kSmokePackagesDirectory / "ReinstallMode_Tpk.tpk";
- bf::path rds_directory = kSmokePackagesDirectory / "delta_dir";
+ fs::path path = kSmokePackagesDirectory / "ReinstallMode_Tpk.tpk";
+ fs::path rds_directory = kSmokePackagesDirectory / "delta_dir";
std::string pkgid = "smokeapp25";
std::string appid = "smokeapp25.ReinstallModeTpk";
std::string exec = "native";
- bf::path sdk_expected_directory = kSdkDirectory / "tmp" / pkgid;
+ fs::path sdk_expected_directory = kSdkDirectory / "tmp" / pkgid;
ASSERT_TRUE(ci::CopyDir(rds_directory, sdk_expected_directory));
ASSERT_EQ(backend.RDSUpdate(path, pkgid), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check rds modifications
- bf::path root_path = ci::GetRootAppPath(false,
+ fs::path root_path = ci::GetRootAppPath(false,
params.test_user.uid);
- ASSERT_FALSE(bf::exists(root_path / pkgid / "DELETED"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "ADDED"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "bin" / "native"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "shared" / "res" / "native.png"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "DELETED"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "ADDED"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "bin" / "native"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "shared" / "res" / "native.png"));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "MODIFIED", "version 2\n",
params));
}
TEST_F(SmokeTest, InstallationMode_Tpk) {
- bf::path path = kSmokePackagesDirectory / "InstallationMode_Tpk.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp12";
std::string appid = "smokeapp12.InstallationModeTpk";
std::string exec = "native";
}
TEST_F(SmokeTest, UpdateMode_Tpk) {
- bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Tpk.tpk";
- bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Tpk_2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "UpdateMode_Tpk.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "UpdateMode_Tpk_2.tpk";
std::string pkgid = "smokeapp13";
std::string appid = "smokeapp13.UpdateModeTpk";
std::string exec = "native";
}
TEST_F(SmokeTest, DeinstallationMode_Tpk) {
- bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Tpk.tpk";
+ fs::path path = kSmokePackagesDirectory / "DeinstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp14";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
}
TEST_F(SmokeTest, EnablePkg) {
- bf::path path = kSmokePackagesDirectory / "EnablePkg.tpk";
+ fs::path path = kSmokePackagesDirectory / "EnablePkg.tpk";
std::string pkgid = "smokeapp22";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK);
}
TEST_F(SmokeTest, DisablePkg) {
- bf::path path = kSmokePackagesDirectory / "DisablePkg.tpk";
+ fs::path path = kSmokePackagesDirectory / "DisablePkg.tpk";
std::string pkgid = "smokeapp23";
std::string appid = "smokeapp23.DisablePkg";
std::string exec = "=disablepkg";
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string test_uid_str = std::to_string(params.test_user.uid);
ASSERT_NE(backend_crash.Wait(), 0);
std::string pkgid = "smokeapp15";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::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()));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
ASSERT_NE(backend_crash.Wait(), 0);
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1", params));
- ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+ ASSERT_FALSE(fs::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);
}
TEST_F(SmokeTest, MountInstallationMode_Tpk) {
- bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Tpk.tpk";
+ fs::path path = kSmokePackagesDirectory / "MountInstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp26";
std::string appid = "smokeapp26.MountInstallationModeTpk";
std::string exec = "native";
}
TEST_F(SmokeTest, MountUpdateMode_Tpk) {
- bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Tpk.tpk";
- bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Tpk_2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Tpk.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Tpk_2.tpk";
std::string pkgid = "smokeapp27";
std::string appid = "smokeapp27.MountUpdateModeTpk";
std::string exec = "native";
TEST_F(SmokeTest, MigrateLegacyExternalImage_Tpk) {
ASSERT_TRUE(CheckAvailableExternalPath());
- bf::path path = kSmokePackagesDirectory / "InstallExternal_Tpk_2.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallExternal_Tpk_2.tpk";
std::string pkgid = "smokeapp28";
std::string appid = "smokeapp28.InstallExternalTpk";
std::string exec = "smokeapp28";
- bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
+ fs::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
std::string test_uid_str = std::to_string(params.test_user.uid);
if (test_uid_str == kDefaultUserIdStr ||
params.test_user.uid == kGlobalUserUid) {
TEST_F(SmokeTest, InstallExternal_Tpk) {
ASSERT_TRUE(CheckAvailableExternalPath());
- bf::path path = kSmokePackagesDirectory / "InstallExternal_Tpk.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallExternal_Tpk.tpk";
std::string pkgid = "smokeapp29";
std::string appid = "smokeapp29.InstallExternalTpk";
std::string exec = "smokeapp29";
}
#define TEP_TEST_STARTING_BLOCK(NUMBER) \
- bf::path path = kSmokePackagesDirectory / "TEP_Tpk"; \
+ fs::path path = kSmokePackagesDirectory / "TEP_Tpk"; \
path += #NUMBER; \
path += ".tpk"; \
- bf::path tep1 = kSmokePackagesDirectory / "tep1.tep"; \
- bf::path tep2 = kSmokePackagesDirectory / "tep2.tep"; \
+ fs::path tep1 = kSmokePackagesDirectory / "tep1.tep"; \
+ fs::path tep2 = kSmokePackagesDirectory / "tep2.tep"; \
std::string number = std::to_string(50 + NUMBER - 1); \
std::string pkgid = std::string("smokeapp") + number; \
std::string appid = pkgid + ".TEP"; \
ASSERT_EQ(backend.InstallWithTEP(path, tep2),
ci::AppInstaller::Result::ERROR);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
- ASSERT_FALSE(bf::exists(tep_file));
+ fs::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
+ ASSERT_FALSE(fs::exists(tep_file));
}
TEST_F(RollbackSmokeTest, TEP_Tpk_TepInstallNoTepUpdateRollback) {
ci::AppInstaller::Result::ERROR);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
- bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
- ASSERT_FALSE(bf::exists(tep_file));
+ fs::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
+ ASSERT_FALSE(fs::exists(tep_file));
}
TEST_F(RollbackSmokeTest, TEP_Tpk_Mount_TepInstallNoTepUpdateRollback) {
TEST_F(PreloadSmokeTest, InstallationMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallationMode_Preload.tpk";
std::string pkgid = "smoketpk29";
std::string appid = "smoketpk29.InstallationModePreload";
std::string exec = "native";
TEST_F(PreloadSmokeTest, UpdateMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.tpk";
- bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.tpk";
std::string pkgid = "smoketpk30";
std::string appid = "smoketpk30.UpdateModePreload";
std::string exec = "native";
TEST_F(PreloadSmokeTest, DeinstallationMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.tpk";
+ fs::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.tpk";
std::string pkgid = "smoketpk31";
ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.UninstallPreload(pkgid), ci::AppInstaller::Result::OK);
}
TEST_F(SmokeTest, InstallationMode_GoodSignature) {
- bf::path path =
+ fs::path path =
kSmokePackagesDirectory / "InstallationMode_GoodSignature.tpk";
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(path));
}
TEST_F(SmokeTest, InstallationMode_WrongSignature) {
- bf::path path =
+ fs::path path =
kSmokePackagesDirectory / "InstallationMode_WrongSignature.tpk";
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.Install(path));
}
TEST_F(RollbackSmokeTest, InstallationMode_Rollback) {
- bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk34";
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.Install(path));
ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
}
TEST_F(SmokeTest, RecoveryMode_ForDelta) {
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+ fs::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(path_old));
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string pkgid = "smoketpk35";
std::string appid = "smoketpk35.RecoveryMode_ForDelta";
std::string exec = "smoketpk35";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1",
params));
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
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()));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/DELETED"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/ADDED"));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(RollbackSmokeTest, UpdateMode) {
- bf::path old_path = kSmokePackagesDirectory / "UpdateMode_Rollback.tpk";
- bf::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
+ fs::path old_path = kSmokePackagesDirectory / "UpdateMode_Rollback.tpk";
+ fs::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk36";
std::string appid = "smoketpk36.UpdateMode_Rollback";
std::string exec = "smoketpk36";
}
TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string test_uid_str = std::to_string(params.test_user.uid);
ASSERT_NE(0, backend_crash.Wait());
std::string pkgid = "smoketpk37";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::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()));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
- bf::path path_old =
+ fs::path path_old =
kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.tpk";
- bf::path path_new =
+ fs::path path_new =
kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(path_old));
ScopedTzipInterface poweroff_unmount_interface(pkgid, params.test_user.uid);
poweroff_unmount_interface.Release();
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
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()));
+ ASSERT_FALSE(fs::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);
}
TEST_F(RollbackSmokeTest, MountInstallationMode) {
- bf::path path =
+ fs::path path =
kSmokePackagesDirectory / "MountInstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk39";
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.MountInstall(path));
}
TEST_F(RollbackSmokeTest, MountUpdateMode) {
- bf::path old_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback.tpk";
- bf::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
+ fs::path old_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback.tpk";
+ fs::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk40";
std::string appid = "smoketpk40.MountUpdateMode_Rollback";
std::string exec = "smoketpk40";
TEST_F(SmokeTest, ManifestDirectInstallMode) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode";
+ fs::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode";
std::string pkgid = "smoketpk41";
std::string appid = "smoketpk41.ManifestDirectInstallMode";
std::string exec = "basicui";
- bf::path pkg_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path pkg_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ci::CopyDir(src_path / pkgid, pkg_path / pkgid);
}
TEST_F(SmokeTest, ManifestDirectUpdateMode) {
- bf::path path = kSmokePackagesDirectory / "ManifestDirectUpdateMode.tpk";
+ fs::path path = kSmokePackagesDirectory / "ManifestDirectUpdateMode.tpk";
std::string pkgid = "smoketpk42";
std::string appid = "smoketpk42.ManifestDirectUpdateMode";
std::string exec = "basicui";
TEST_F(PreloadSmokeTest, ReadonlyUpdateInstallMode) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path = kSmokePackagesDirectory / "ReadonlyUpdateInstallMode.tpk";
+ fs::path path = kSmokePackagesDirectory / "ReadonlyUpdateInstallMode.tpk";
std::string pkgid = "smoketpk43";
std::string appid = "smoketpk43.ReadonlyUpdateInstallMode";
std::string exec = "basicui";
TEST_F(PreloadSmokeTest, ReadonlyUpdateUninstallMode) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path = kSmokePackagesDirectory / "ReadonlyUpdateUninstallMode.tpk";
+ fs::path path = kSmokePackagesDirectory / "ReadonlyUpdateUninstallMode.tpk";
std::string pkgid = "smoketpk44";
std::string appid = "smoketpk44.ReadonlyUpdateUninstallMode";
std::string exec = "basicui";
TEST_F(SmokeTest, InstallExtended_Tpk) {
ASSERT_TRUE(CheckAvailableExtendedPath());
- bf::path path = kSmokePackagesDirectory / "InstallExtended_Tpk.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallExtended_Tpk.tpk";
std::string pkgid = "smoketpk45";
std::string appid = "smoketpk45.InstallExtendedTpk";
std::string exec = "smoketpk45.InstallExtendedTpk";
}
TEST_F(SmokeTest, RecoveryMode_CrashAfterUnzip) {
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_CrashAfterUnzip.tpk";
+ fs::path path = kSmokePackagesDirectory / "RecoveryMode_CrashAfterUnzip.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string test_uid_str = std::to_string(params.test_user.uid);
ASSERT_NE(backend_crash.Wait(), 0);
std::string pkgid = "smokeapp47";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(recovery_info ? true : false);
ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
- ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(RollbackSmokeTest, UpdateMode_RollbackSharedDataUpdate) {
- bf::path path_old = kSmokePackagesDirectory / "UpdateMode_SharedData.tpk";
- bf::path path_new = kSmokePackagesDirectory / "UpdateMode_SharedData_2.tpk";
+ fs::path path_old = kSmokePackagesDirectory / "UpdateMode_SharedData.tpk";
+ fs::path path_new = kSmokePackagesDirectory / "UpdateMode_SharedData_2.tpk";
std::string pkgid = "smoketpk.shareddata";
std::string appid = "smoketpk.shareddata";
std::string exec = "shareddata";
}
TEST_F(RollbackSmokeTest, UpdateMode_RollbackNonSharedDataUpdate) {
- bf::path path_old = kSmokePackagesDirectory / "UpdateMode_NonSharedData.tpk";
- bf::path path_new =
+ fs::path path_old = kSmokePackagesDirectory / "UpdateMode_NonSharedData.tpk";
+ fs::path path_new =
kSmokePackagesDirectory / "UpdateMode_NonSharedData_2.tpk";
std::string pkgid = "smoketpk.non-shareddata";
std::string appid = "smoketpk.non-shareddata";
}
TEST_F(SmokeTest, RecoveryMode_SharedDataUpdate) {
- bf::path path_old =
+ fs::path path_old =
kSmokePackagesDirectory / "RecoveryMode_SharedData.tpk";
- bf::path path_new =
+ fs::path path_new =
kSmokePackagesDirectory / "RecoveryMode_SharedData_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
std::string pkgid = "smoketpk.recovery-shareddata";
std::string appid = "smoketpk.recovery-shareddata";
std::string exec = "shareddata";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(CheckSharedDataExistance(pkgid, params));
- ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(SmokeTest, RecoveryMode_NonSharedDataUpdate) {
- bf::path path_old =
+ fs::path path_old =
kSmokePackagesDirectory / "RecoveryMode_NonSharedData.tpk";
- bf::path path_new =
+ fs::path path_new =
kSmokePackagesDirectory / "RecoveryMode_NonSharedData_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
std::string pkgid = "smoketpk.recovery-non-shareddata";
std::string appid = "smoketpk.recovery-non-shareddata";
std::string exec = "shareddata";
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(CheckSharedDataNonExistance(pkgid, params));
- ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+ ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
}
TEST_F(PreloadSmokeTest, RecoveryMode_ForReadonlyUpdateInstall) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
- bf::path path_old = kSmokePackagesDirectory /
+ fs::path path_old = kSmokePackagesDirectory /
"RecoveryMode_ForReadonlyUpdateInstall.tpk";
- bf::path path_new = kSmokePackagesDirectory /
+ fs::path path_new = kSmokePackagesDirectory /
"RecoveryMode_ForReadonlyUpdateInstall_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ASSERT_EQ(backend.InstallPreload(path_old), ci::AppInstaller::Result::OK);
backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
ASSERT_NE(backend_crash.Wait(), 0);
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1", params));
- ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+ ASSERT_FALSE(fs::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);
}
TEST_F(SmokeTest, InstallationMode_ResControl) {
- bf::path path = kSmokePackagesDirectory / "InstallationMode_ResControl.tpk";
+ fs::path path = kSmokePackagesDirectory / "InstallationMode_ResControl.tpk";
std::string pkgid = "smoketpk47";
std::string appid = "smoketpk47.InstallationMode_ResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/global"));
}
TEST_F(SmokeTest, UpdateMode_AddResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "UpdateMode_AddResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "UpdateMode_AddResControl_2.tpk";
std::string pkgid = "smoketpk48";
std::string appid = "smoketpk48.UpdateMode_AddResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/global"));
ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/global"));
}
TEST_F(SmokeTest, UpdateMode_RemoveResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "UpdateMode_RemoveResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "UpdateMode_RemoveResControl_2.tpk";
std::string pkgid = "smoketpk49";
std::string appid = "smoketpk49.UpdateMode_RemoveResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/global"));
ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/global"));
}
TEST_F(SmokeTest, RecoveryMode_AddResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "RecoveryMode_AddResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "RecoveryMode_AddResControl_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
std::string pkgid = "smoketpk50";
std::string appid = "smoketpk50.RecoveryMode_AddResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/global"));
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string test_uid_str = std::to_string(params.test_user.uid);
backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
ASSERT_NE(backend_crash.Wait(), 0);
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_FALSE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_FALSE(fs::exists(root_path / pkgid / "res/mount/global"));
}
TEST_F(SmokeTest, RecoveryMode_RemoveResControl) {
- bf::path path_old = kSmokePackagesDirectory
+ fs::path path_old = kSmokePackagesDirectory
/ "RecoveryMode_RemoveResControl.tpk";
- bf::path path_new = kSmokePackagesDirectory
+ fs::path path_new = kSmokePackagesDirectory
/ "RecoveryMode_RemoveResControl_2.tpk";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
std::string pkgid = "smoketpk51";
std::string appid = "smoketpk51.RecoveryMode_RemoveResControl";
std::string exec = "native";
- bf::path root_path = ci::GetRootAppPath(params.is_readonly,
+ fs::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/global"));
ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
std::string test_uid_str = std::to_string(params.test_user.uid);
backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
ASSERT_NE(backend_crash.Wait(), 0);
- bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
+ fs::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/allowed"));
- ASSERT_TRUE(bf::exists(root_path / pkgid / "res/mount/global"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/allowed"));
+ ASSERT_TRUE(fs::exists(root_path / pkgid / "res/mount/global"));
}
} // namespace smoke_test
+const char kHelpMessage[] = R"(Allowed options:
+ --help display this help message
+ --no-backup Do test without backup
+ --backup-type arg <move|copy> set test's backup type 'move', 'copy and
+ remove'
+)";
+
+void PrintHelp() {
+ std::cerr << kHelpMessage;
+}
+
int main(int argc, char** argv) {
try {
bool no_backup = false;
}
testing::InitGoogleTest(&argc, argv);
- bpo::options_description options("Allowed options");
- bpo::variables_map opt_map;
- try {
- options.add_options()
- ("help", "display this help message")
- ("no-backup", "Do test without backup")
- ("backup-type", bpo::value<std::string>(), "<move|copy> set test's "
- "backup type \'move\', \'copy and remove\'");
- bpo::store(bpo::command_line_parser(argc, argv).
- options(options).allow_unregistered().run(), opt_map);
- if (opt_map.count("help")) {
- std::cerr << options << std::endl;
- return -1;
- }
-
- if (opt_map.count("no-backup"))
- no_backup = true;
- if (opt_map.count("backup-type")) {
- if (opt_map["backup-type"].as<std::string>() == "move") {
- backup_type = BackupType::MOVE;
- } else if (opt_map["backup-type"].as<std::string>() == "copy") {
- backup_type = BackupType::COPY_AND_REMOVE;
- } else {
- std::cerr << options << std::endl;
+ const struct option long_opts[] = {
+ { "help", no_argument, nullptr, 'h' },
+ { "no-backup", no_argument, nullptr, 'n' },
+ { "backup-type", required_argument, nullptr, 'b' },
+ { 0, 0, 0, 0 },
+ };
+
+ while (true) {
+ int opt = getopt_long(argc, argv, "", long_opts, nullptr);
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'h':
+ PrintHelp();
return -1;
- }
+ case 'n':
+ no_backup = true;
+ break;
+ case 'b':
+ if (optarg) {
+ if (strcmp(optarg, "move") == 0) {
+ backup_type = BackupType::MOVE;
+ } else if (strcmp(optarg, "copy") == 0) {
+ backup_type = BackupType::COPY_AND_REMOVE;
+ } else {
+ PrintHelp();
+ return -1;
+ }
+ }
+ break;
+ default:
+ break;
}
- bpo::notify(opt_map);
- } catch (...) {
- std::cerr << "Exception occurred: "
- << boost::current_exception_diagnostic_information()
- << std::endl;
- return -1;
}
::env = static_cast<smoke_test::SmokeEnvironment*>(
namespace smoke_test {
-const bf::path kSmokePackagesDirectory =
+const fs::path kSmokePackagesDirectory =
"/usr/share/tpk-installer-ut/test_samples/smoke/";
bool ValidatePackage(const std::string& pkgid,
TpkBackendInterface::CommandResult
TpkBackendInterface::InstallWithTEP(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
const char* argv[] = {"", "-i", path.c_str(), "-u", uid_str_.c_str(),
"-e", tep.c_str()};
return CallBackend(SIZEOFARRAY(argv), argv);
TpkBackendInterface::CommandResult
TpkBackendInterface::MountInstallWithTEP(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
const char* argv[] = {"", "-w", path.c_str(), "-u", uid_str_.c_str(),
"-e", tep.c_str()};
return CallBackend(SIZEOFARRAY(argv), argv);
TpkBackendInterface::CommandResult
TpkBackendInterface::InstallSuccessWithTEP(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
RequestResult tmp_mode = mode_;
RequestResult &original_mode = const_cast<RequestResult&>(mode_);
original_mode = RequestResult::NORMAL;
TpkBackendInterface::CommandResult
TpkBackendInterface::MountInstallSuccessWithTEP(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
RequestResult tmp_mode = mode_;
RequestResult &original_mode = const_cast<RequestResult&>(mode_);
original_mode = RequestResult::NORMAL;
TpkBackendInterface::SubProcessResult
TpkBackendInterface::InstallWithTEPWithSubprocess(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
std::vector<std::string> args =
{"", "-i", path.string(), "-u", uid_str_, "-e", tep.string()};
return RunSubprocess(args);
TpkBackendInterface::SubProcessResult
TpkBackendInterface::MountInstallWithTEPWithSubprocess(
- const bf::path& path, const bf::path& tep) const {
+ const fs::path& path, const fs::path& tep) const {
std::vector<std::string> args =
{"", "-w", path.string(), "-u", uid_str_, "-e", tep.string()};
return RunSubprocess(args);
namespace smoke_test {
-extern const bf::path kSmokePackagesDirectory;
+extern const fs::path kSmokePackagesDirectory;
bool ValidatePackage(const std::string& pkgid,
const std::pair<std::string, std::string>& app,
class TpkBackendInterface: public BackendInterface {
public:
using BackendInterface::BackendInterface;
- CommandResult InstallWithTEP(const bf::path& path,
- const bf::path& tep) const;
- CommandResult InstallSuccessWithTEP(const bf::path& path,
- const bf::path& tep) const;
- CommandResult MountInstallWithTEP(const bf::path& path,
- const bf::path& tep) const;
- CommandResult MountInstallSuccessWithTEP(const bf::path& path,
- const bf::path& tep) const;
-
- SubProcessResult InstallWithTEPWithSubprocess(const bf::path& path,
- const bf::path& tep) const;
- SubProcessResult MountInstallWithTEPWithSubprocess(const bf::path& path,
- const bf::path& tep) const;
+ CommandResult InstallWithTEP(const fs::path& path,
+ const fs::path& tep) const;
+ CommandResult InstallSuccessWithTEP(const fs::path& path,
+ const fs::path& tep) const;
+ CommandResult MountInstallWithTEP(const fs::path& path,
+ const fs::path& tep) const;
+ CommandResult MountInstallSuccessWithTEP(const fs::path& path,
+ const fs::path& tep) const;
+
+ SubProcessResult InstallWithTEPWithSubprocess(const fs::path& path,
+ const fs::path& tep) const;
+ SubProcessResult MountInstallWithTEPWithSubprocess(const fs::path& path,
+ const fs::path& tep) const;
AppQueryInterfacePtr CreateQueryInterface() const override;
AppInstallerPtr CreateInstaller(