Remove boost dependency 21/303721/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 4 Jan 2024 00:42:42 +0000 (09:42 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 4 Jan 2024 08:49:11 +0000 (17:49 +0900)
Requires:
 - https://review.tizen.org/gerrit/c/platform/core/appfw/app-installers/+/303330
 - https://review.tizen.org/gerrit/c/platform/core/appfw/tpk-backend/+/303650
 - https://review.tizen.org/gerrit/c/platform/core/appfw/wgt-backend/+/303665
 - https://review.tizen.org/gerrit/c/platform/core/appfw/rpk-installer/+/303720

Change-Id: I6f4fb71744abcd89f1a990c93d5756fe20d94889
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
CMakeLists.txt
packaging/unified-backend.spec
src/unified/unified_backend.cc
src/unified/unified_installer_factory.cc
test/smoke_test/CMakeLists.txt
test/smoke_test/dependency_checker_test.cc
test/smoke_test/smoke_test.cc
test/smoke_test/smoke_utils.cc
test/smoke_test/smoke_utils.h
test/smoke_test/unified_recovery_test.cc

index d75d385..07b8743 100644 (file)
@@ -58,7 +58,5 @@ PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
 PKG_CHECK_MODULES(RPK_INSTALLER_DEPS REQUIRED rpk-installer)
 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
 
-FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
-
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(test)
index 86c2bbf..261a4e1 100644 (file)
@@ -11,7 +11,6 @@ Source1001:    unified-installer.manifest
 Source1002:    unified-installer-tests.manifest
 
 BuildRequires: app-installers-tests
-BuildRequires: boost-devel
 BuildRequires: cmake
 BuildRequires: tpk-installer-tests
 BuildRequires: wgt-installer-tests
index 14ecacc..7a5d9cf 100644 (file)
@@ -5,19 +5,35 @@
 #include <common/installer/app_installer.h>
 #include <common/installer_factory.h>
 #include <common/installer_runner.h>
+#include <manifest_parser/utils/logging.h>
 
 #include "unified/unified_installer_factory.h"
 
 namespace ci = common_installer;
 
+void WriteLog(ci::PkgMgrPtr pkgmgr, const char *msg) {
+    for (int i = 0; i  < pkgmgr->GetRequestInfoCount(); i++) {
+      LOG(ERROR) << "Installer(" << i << ") " << msg << ": ["
+                 << ci::GetRequestTypeString(pkgmgr->GetRequestType(i)) << "] "
+                 << pkgmgr->GetRequestInfo(i);
+    }
+}
+
 int main(int argc, char** argv) {
   ci::PkgmgrInstaller installer;
   try {
     auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &installer);
 
+
     ci::InstallerRunner runner(
         std::make_unique<ci::UnifiedInstallerFactory>(), pkgmgr);
+
+    WriteLog(pkgmgr, "Start");
+
     ci::AppInstaller::Result result = runner.Run();
+
+    WriteLog(pkgmgr, "Finish");
+
     return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
   } catch(...) {
     LOG(ERROR) << "Exception occured";
index 627d8b9..c8bffe9 100644 (file)
@@ -7,8 +7,6 @@
 #include <libxml/xmlreader.h>
 #include <unzip.h>
 
-#include <boost/filesystem/path.hpp>
-
 #include <manifest_parser/utils/logging.h>
 #include <hybrid/hybrid_installer.h>
 #include <tpk/tpk_app_query_interface.h>
@@ -18,6 +16,7 @@
 #include <wgt/utils/wgt_app_query_interface.h>
 #include <wgt/wgt_installer.h>
 
+#include <filesystem>
 #include <map>
 #include <memory>
 #include <string>
@@ -25,6 +24,8 @@
 #include "common/pkgmgr_interface.h"
 #include "common/utils/pkgmgr_query.h"
 
+namespace fs = std::filesystem;
+
 namespace {
 
 std::map<const char*, const char*> kTypeMap = {
@@ -55,7 +56,7 @@ std::string GetPkgTypeFromPkgid(const std::string& pkgid, uid_t uid) {
 std::string GetPkgTypeFromPath(const std::string& path) {
   std::string type;
 
-  if (boost::filesystem::extension(path) == ".rpk")
+  if (fs::path(path).extension() == ".rpk")
     return "rpk";
 
   unzFile uf = unzOpen(path.c_str());
@@ -77,7 +78,7 @@ std::string GetPkgTypeFromPath(const std::string& path) {
   return ValidatePkgType(type);
 }
 
-std::string GetPkgTypeFromFilename(const boost::filesystem::path& name) {
+std::string GetPkgTypeFromFilename(const fs::path& name) {
   std::string filename = name.string();
   std::string token;
   std::stringstream ss(filename);
@@ -119,12 +120,12 @@ int MoveToChildElement(xmlTextReaderPtr reader, int depth) {
 
 std::string GetPkgTypeFromXml(const std::string& info, uid_t uid,
     bool is_preload) {
-  boost::filesystem::path xml_path =
-      boost::filesystem::path(getUserManifestPath(uid, is_preload))
-      / boost::filesystem::path(info);
+  fs::path xml_path =
+      fs::path(getUserManifestPath(uid, is_preload))
+      / fs::path(info);
   xml_path += ".xml";
 
-  if (!boost::filesystem::exists(xml_path)) {
+  if (!fs::exists(xml_path)) {
     LOG(ERROR) << "xml path [" << xml_path << "] is not exist";
     return "";
   }
@@ -185,7 +186,7 @@ std::string UnifiedInstallerFactory::GetPkgType(
 
   if (type.empty()) {
     std::string file_name =
-        (boost::filesystem::path(info).filename()).string();
+        (fs::path(info).filename()).string();
     type = GetPkgTypeFromFilename(file_name);
     if (type == file_name)
       type.clear();
index 3fe2523..c3ca95f 100644 (file)
@@ -36,23 +36,16 @@ TARGET_INCLUDE_DIRECTORIES(${TARGET_RECOVERY_TEST} PUBLIC ${CMAKE_CURRENT_SOURCE
 INSTALL(DIRECTORY test_samples/ DESTINATION ${SHAREDIR}/${DESTINATION_DIR}/test_samples)
 
 APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST} PUBLIC
-  Boost
   GMOCK_DEPS
   GUM_DEPS
 )
 
 APPLY_PKG_CONFIG(${TARGET_RECOVERY_TEST} PUBLIC
-  Boost
   GMOCK_DEPS
   GUM_DEPS
 )
 
-APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST_HELPER} PUBLIC
-  Boost
-)
-
 APPLY_PKG_CONFIG(${TARGET_DEPENDENCY_CHECKER_TEST} PUBLIC
-  Boost
   GMOCK_DEPS
 )
 
index 2a2bb3b..4b33f1e 100644 (file)
@@ -8,9 +8,12 @@
 
 #include <gtest/gtest.h>
 
+#include <filesystem>
+
 #include "smoke_test/smoke_utils.h"
 
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace smoke_test {
 
@@ -40,7 +43,7 @@ class SmokeEnvironment : public testing::Environment {
   ci::RequestMode request_mode_;
 
  private:
-  std::vector<bf::path> backups_;
+  std::vector<fs::path> backups_;
 };
 
 }  // namespace smoke_test
@@ -133,7 +136,7 @@ class DependencyValidator {
   std::list<AppInstallerPtr> installer_list_;
 };
 
-const bf::path kUnifiedSmokePackagesDirectory =
+const fs::path kUnifiedSmokePackagesDirectory =
     "/usr/share/unified-installer-ut/test_samples/smoke/";
 
 class DependencyCheckerTest : public testing::Test {
@@ -167,9 +170,9 @@ class DependencyCheckerTest : public testing::Test {
 };
 
 TEST_F(DependencyCheckerTest, CircularDependency) {
-  bf::path path1 = kUnifiedSmokePackagesDirectory / "smokedep01.tpk";
-  bf::path path2 = kUnifiedSmokePackagesDirectory / "smokedep02.tpk";
-  bf::path path3 = kUnifiedSmokePackagesDirectory / "smokedep03.tpk";
+  fs::path path1 = kUnifiedSmokePackagesDirectory / "smokedep01.tpk";
+  fs::path path2 = kUnifiedSmokePackagesDirectory / "smokedep02.tpk";
+  fs::path path3 = kUnifiedSmokePackagesDirectory / "smokedep03.tpk";
 
   std::vector<std::string> pkgmgr_args =
       {"", "-i", path1.string(), path2.string(), path3.string()};
@@ -188,11 +191,11 @@ TEST_F(DependencyCheckerTest, CircularDependency) {
 }
 
 TEST_F(DependencyCheckerTest, SortInstallRequest) {
-  bf::path path4 = kUnifiedSmokePackagesDirectory / "smokedep04.tpk";
-  bf::path path5 = kUnifiedSmokePackagesDirectory / "smokedep05.tpk";
-  bf::path path6 = kUnifiedSmokePackagesDirectory / "smokedep06.tpk";
-  bf::path path7 = kUnifiedSmokePackagesDirectory / "smokedep07.tpk";
-  bf::path path8 = kUnifiedSmokePackagesDirectory / "smokedep08.tpk";
+  fs::path path4 = kUnifiedSmokePackagesDirectory / "smokedep04.tpk";
+  fs::path path5 = kUnifiedSmokePackagesDirectory / "smokedep05.tpk";
+  fs::path path6 = kUnifiedSmokePackagesDirectory / "smokedep06.tpk";
+  fs::path path7 = kUnifiedSmokePackagesDirectory / "smokedep07.tpk";
+  fs::path path8 = kUnifiedSmokePackagesDirectory / "smokedep08.tpk";
 
   std::vector<std::string> pkgmgr_args = {"", "-i", path4.string(),
       path5.string(), path6.string(), path7.string(), path8.string()};
@@ -213,11 +216,11 @@ TEST_F(DependencyCheckerTest, SortInstallRequest) {
 }
 
 TEST_F(DependencyCheckerTest, SortUninstallRequest) {
-  bf::path path4 = kUnifiedSmokePackagesDirectory / "smokedep04.tpk";
-  bf::path path5 = kUnifiedSmokePackagesDirectory / "smokedep05.tpk";
-  bf::path path6 = kUnifiedSmokePackagesDirectory / "smokedep06.tpk";
-  bf::path path7 = kUnifiedSmokePackagesDirectory / "smokedep07.tpk";
-  bf::path path8 = kUnifiedSmokePackagesDirectory / "smokedep08.tpk";
+  fs::path path4 = kUnifiedSmokePackagesDirectory / "smokedep04.tpk";
+  fs::path path5 = kUnifiedSmokePackagesDirectory / "smokedep05.tpk";
+  fs::path path6 = kUnifiedSmokePackagesDirectory / "smokedep06.tpk";
+  fs::path path7 = kUnifiedSmokePackagesDirectory / "smokedep07.tpk";
+  fs::path path8 = kUnifiedSmokePackagesDirectory / "smokedep08.tpk";
 
   std::string pkg4 = "smokedep04";
   std::string pkg5 = "smokedep05";
@@ -225,7 +228,7 @@ TEST_F(DependencyCheckerTest, SortUninstallRequest) {
   std::string pkg7 = "smokedep07";
   std::string pkg8 = "smokedep08";
 
-  std::vector<bf::path> install_args = {path4, path5, path6, path7, path8};
+  std::vector<fs::path> install_args = {path4, path5, path6, path7, path8};
   ASSERT_EQ(backend.Install(install_args), ci::AppInstaller::Result::OK);
 
   std::vector<std::string> pkgmgr_args = {"", "-d", "smokedep04",
@@ -247,7 +250,7 @@ TEST_F(DependencyCheckerTest, SortUninstallRequest) {
 }
 
 TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgNotExist) {
-  bf::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
+  fs::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
 
   std::vector<std::string> pkgmgr_args = {"", "-i", path9.string()};
   TestPkgmgrInstaller pkgmgr_installer;
@@ -260,8 +263,8 @@ TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgNotExist) {
 }
 
 TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionLow) {
-  bf::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
-  bf::path path10 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
+  fs::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
+  fs::path path10 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
 
   ASSERT_EQ(backend.Install(path10), ci::AppInstaller::Result::OK);
 
@@ -276,11 +279,11 @@ TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionLow) {
 }
 
 TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionDown_1) {
-  bf::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
-  bf::path path10_1 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
-  bf::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
+  fs::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
+  fs::path path10_1 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
+  fs::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
 
-  ASSERT_EQ(backend.Install(std::vector<bf::path>({path9, path10_2})),
+  ASSERT_EQ(backend.Install(std::vector<fs::path>({path9, path10_2})),
       ci::AppInstaller::Result::OK);
 
   std::vector<std::string> pkgmgr_args = {"", "-i", path10_1.string()};
@@ -294,13 +297,13 @@ TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionDown_1) {
 }
 
 TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionDown_2) {
-  bf::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
-  bf::path path10_1 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
-  bf::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
+  fs::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
+  fs::path path10_1 = kUnifiedSmokePackagesDirectory / "smokedep10-1.0.0.tpk";
+  fs::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
   std::string pkgid10 = "smokedep10";
 
   ASSERT_EQ(backend.InstallPreload(path10_1), ci::AppInstaller::Result::OK);
-  ASSERT_EQ(backend.Install(std::vector<bf::path>({path9, path10_2})),
+  ASSERT_EQ(backend.Install(std::vector<fs::path>({path9, path10_2})),
       ci::AppInstaller::Result::OK);
 
   std::vector<std::string> pkgmgr_args = {"", "-d", pkgid10};
@@ -314,11 +317,11 @@ TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgVersionDown_2) {
 }
 
 TEST_F(DependencyCheckerTest, InvalidDependency_RequiredPkgUninstall) {
-  bf::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
-  bf::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
+  fs::path path9 = kUnifiedSmokePackagesDirectory / "smokedep09.tpk";
+  fs::path path10_2 = kUnifiedSmokePackagesDirectory / "smokedep10-2.0.0.tpk";
   std::string pkgid10 = "smokedep10";
 
-  ASSERT_EQ(backend.Install(std::vector<bf::path>({path9, path10_2})),
+  ASSERT_EQ(backend.Install(std::vector<fs::path>({path9, path10_2})),
       ci::AppInstaller::Result::OK);
 
   std::vector<std::string> pkgmgr_args = {"", "-d", pkgid10};
index 6dc0be6..3036709 100644 (file)
@@ -7,9 +7,12 @@
 #include <gtest/gtest.h>
 #include <gtest/gtest-death-test.h>
 
+#include <filesystem>
+
 #include "smoke_test/smoke_utils.h"
 
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace smoke_test {
 
@@ -44,7 +47,7 @@ class SmokeEnvironment : public testing::Environment {
 
  private:
   ci::RequestMode request_mode_;
-  std::vector<bf::path> backups_;
+  std::vector<fs::path> backups_;
 };
 
 }  // namespace smoke_test
@@ -65,7 +68,7 @@ void signalHandler(int signum) {
 
 namespace smoke_test {
 
-const bf::path kUnifiedSmokePackagesDirectory =
+const fs::path kUnifiedSmokePackagesDirectory =
     "/usr/share/unified-installer-ut/test_samples/smoke/";
 
 class SmokeTest : public testing::Test {
@@ -84,31 +87,31 @@ class SmokeTest : public testing::Test {
 };
 
 TEST_F(SmokeTest, Install_Single) {
-  bf::path path =
+  fs::path path =
       kUnifiedSmokePackagesDirectory / "Install_SingleTpk.tpk";
   std::string pkgid = "smokeuni01";
   std::string appid = "smokeuni01.InstallSingleTpk";
   std::string exec = "smokeunified";
 
-  std::vector<bf::path> paths = { path };
+  std::vector<fs::path> paths = { path };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
 }
 
 TEST_F(SmokeTest, Install_Double) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Install_DoubleTpk.tpk";
   std::string pkgid1 = "smokeuni02";
   std::string appid1 = "smokeuni02.InstallDoubleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Install_DoubleWgt.wgt";
   std::string pkgid2 = "smokeuni03";
   std::string appid2 = "smokeuni03.InstallDoubleWgt";
   std::string exec2 = "smokeuni03.InstallDoubleWgt";
 
-  std::vector<bf::path> paths = { path1, path2 };
+  std::vector<fs::path> paths = { path1, path2 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -117,23 +120,23 @@ TEST_F(SmokeTest, Install_Double) {
 }
 
 TEST_F(SmokeTest, Install_Triple) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Install_TripleTpk.tpk";
   std::string pkgid1 = "smokeuni04";
   std::string appid1 = "smokeuni04.InstallTripleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Install_TripleWgt.wgt";
   std::string pkgid2 = "smokeuni05";
   std::string appid2 = "smokeuni05.InstallTripleWgt";
   std::string exec2 = "smokeuni05.InstallTripleWgt";
-  bf::path path3 =
+  fs::path path3 =
       kUnifiedSmokePackagesDirectory / "Install_TripleHybrid.wgt";
   std::string pkgid3 = "smokeuni06";
   std::string appid3 = "smokeuni06.InstallTripleHybrid";
   std::string exec3 = "smokeuni06.InstallTripleHybrid";
 
-  std::vector<bf::path> paths = { path1, path2, path3 };
+  std::vector<fs::path> paths = { path1, path2, path3 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -144,15 +147,15 @@ TEST_F(SmokeTest, Install_Triple) {
 }
 
 TEST_F(SmokeTest, Update_Single) {
-  bf::path path_old =
+  fs::path path_old =
       kUnifiedSmokePackagesDirectory / "Update_SingleTpk.tpk";
-  bf::path path_new =
+  fs::path path_new =
       kUnifiedSmokePackagesDirectory / "Update_SingleTpk_2.tpk";
   std::string pkgid = "smokeuni07";
   std::string appid = "smokeuni07.UpdateSingleTpk";
   std::string exec = "smokeunified";
 
-  std::vector<bf::path> paths = { path_old };
+  std::vector<fs::path> paths = { path_old };
 //  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   paths = { path_new };
@@ -164,22 +167,22 @@ TEST_F(SmokeTest, Update_Single) {
 }
 
 TEST_F(SmokeTest, Update_Double) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "Update_DoubleTpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "Update_DoubleTpk_2.tpk";
   std::string pkgid1 = "smokeuni08";
   std::string appid1 = "smokeuni08.UpdateDoubleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "Update_DoubleWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "Update_DoubleWgt_2.wgt";
   std::string pkgid2 = "smokeuni09";
   std::string appid2 = "smokeuni09.UpdateDoubleWgt";
   std::string exec2 = "smokeuni09.UpdateDoubleWgt";
 
-  std::vector<bf::path> paths = { path1_old, path2_old };
+  std::vector<fs::path> paths = { path1_old, path2_old };
 //  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   paths = { path1_new, path2_new };
@@ -195,29 +198,29 @@ TEST_F(SmokeTest, Update_Double) {
 }
 
 TEST_F(SmokeTest, Update_Triple) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "Update_TripleTpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "Update_TripleTpk_2.tpk";
   std::string pkgid1 = "smokeuni10";
   std::string appid1 = "smokeuni10.UpdateTripleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "Update_TripleWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "Update_TripleWgt_2.wgt";
   std::string pkgid2 = "smokeuni11";
   std::string appid2 = "smokeuni11.UpdateTripleWgt";
   std::string exec2 = "smokeuni11.UpdateTripleWgt";
-  bf::path path3_old =
+  fs::path path3_old =
       kUnifiedSmokePackagesDirectory / "Update_TripleHybrid.wgt";
-  bf::path path3_new =
+  fs::path path3_new =
       kUnifiedSmokePackagesDirectory / "Update_TripleHybrid_2.wgt";
   std::string pkgid3 = "smokeuni12";
   std::string appid3 = "smokeuni12.UpdateTripleHybrid";
   std::string exec3 = "smokeuni12.UpdateTripleHybrid";
 
-  std::vector<bf::path> paths = { path1_old, path2_old, path3_old };
+  std::vector<fs::path> paths = { path1_old, path2_old, path3_old };
 //  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   paths = { path1_new, path2_new, path3_new };
@@ -237,21 +240,21 @@ TEST_F(SmokeTest, Update_Triple) {
 }
 
 TEST_F(SmokeTest, InstallAndUpdate) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Tpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Tpk_2.tpk";
   std::string pkgid1 = "smokeuni13";
   std::string appid1 = "smokeuni13.InstallAndUpdateModeTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Wgt.wgt";
   std::string pkgid2 = "smokeuni14";
   std::string appid2 = "smokeuni14.InstallAndUpdateWgt";
   std::string exec2 = "smokeuni14.InstallAndUpdateWgt";
 
   // install tpk version 1
-  std::vector<bf::path> paths = { path1_old };
+  std::vector<fs::path> paths = { path1_old };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   // update tpk version 2, install wgt version 1
   paths = { path1_new, path2 };
@@ -265,14 +268,14 @@ TEST_F(SmokeTest, InstallAndUpdate) {
 }
 
 TEST_F(SmokeTest, InstallAndROUpdate) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_Tpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_Tpk_2.tpk";
   std::string pkgid1 = "smokeuni25";
   std::string appid1 = "smokeuni25.InstallAndROUpdateModeTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_Wgt.wgt";
   std::string pkgid2 = "smokeuni26";
   std::string appid2 = "smokeuni26.InstallAndROUpdateWgt";
@@ -281,7 +284,7 @@ TEST_F(SmokeTest, InstallAndROUpdate) {
   // install tpk version 1
   ASSERT_EQ(backend.InstallPreload(path1_old), ci::AppInstaller::Result::OK);
   // update tpk version 2, install wgt version 1
-  std::vector<bf::path> paths = { path1_new, path2 };
+  std::vector<fs::path> paths = { path1_new, path2 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -292,13 +295,13 @@ TEST_F(SmokeTest, InstallAndROUpdate) {
 }
 
 TEST_F(SmokeTest, Uninstall_Single) {
-  bf::path path =
+  fs::path path =
       kUnifiedSmokePackagesDirectory / "Uninstall_SingleTpk.tpk";
   std::string pkgid = "smokeuni29";
   std::string appid = "smokeuni29.UninstallSingleTpk";
   std::string exec = "smokeunified";
 
-  std::vector<bf::path> paths = { path };
+  std::vector<fs::path> paths = { path };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
@@ -308,18 +311,18 @@ TEST_F(SmokeTest, Uninstall_Single) {
 }
 
 TEST_F(SmokeTest, Uninstall_Double) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Uninstall_DoubleTpk.tpk";
   std::string pkgid1 = "smokeuni30";
   std::string appid1 = "smokeuni30.UninstallDoubleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Uninstall_DoubleWgt.wgt";
   std::string pkgid2 = "smokeuni31";
   std::string appid2 = "smokeuni31.UninstallDoubleWgt";
   std::string exec2 = "smokeuni31.UninstallDoubleWgt";
 
-  std::vector<bf::path> paths = { path1, path2 };
+  std::vector<fs::path> paths = { path1, path2 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -332,23 +335,23 @@ TEST_F(SmokeTest, Uninstall_Double) {
 }
 
 TEST_F(SmokeTest, Uninstall_Triple) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Uninstall_TripleTpk.tpk";
   std::string pkgid1 = "smokeuni32";
   std::string appid1 = "smokeuni32.UninstallTripleTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Uninstall_TripleWgt.wgt";
   std::string pkgid2 = "smokeuni33";
   std::string appid2 = "smokeuni33.UninstallTripleWgt";
   std::string exec2 = "smokeuni33.UninstallTripleWgt";
-  bf::path path3 =
+  fs::path path3 =
       kUnifiedSmokePackagesDirectory / "Uninstall_TripleHybrid.wgt";
   std::string pkgid3 = "smokeuni34";
   std::string appid3 = "smokeuni34.UninstallTripleHybrid";
   std::string exec3 = "smokeuni34.UninstallTripleHybrid";
 
-  std::vector<bf::path> paths = { path1, path2, path3 };
+  std::vector<fs::path> paths = { path1, path2, path3 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -364,15 +367,15 @@ TEST_F(SmokeTest, Uninstall_Triple) {
 }
 
 TEST_F(SmokeTest, UninstallAndROUpdateUninstall) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "UninstallAndROUpdateUninstall_Tpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory /
       "UninstallAndROUpdateUninstall_Tpk_2.tpk";
   std::string pkgid1 = "smokeuni35";
   std::string appid1 = "smokeuni35.UninstallAndROUpdateUninstallTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "UninstallAndROUpdateUninstall_Wgt.wgt";
   std::string pkgid2 = "smokeuni36";
   std::string appid2 = "smokeuni36.UninstallAndROUpdateUninstallWgt";
@@ -383,7 +386,7 @@ TEST_F(SmokeTest, UninstallAndROUpdateUninstall) {
   ci::PkgQueryInterface pkg_query1(pkgid1, params.test_user.uid);
   PackageAttributes original(pkg_query1);
   // update tpk version 2, install wgt version 1
-  std::vector<bf::path> paths = { path1_new, path2 };
+  std::vector<fs::path> paths = { path1_new, path2 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
@@ -422,18 +425,18 @@ class RollbackSmokeTest : public testing::Test {
 };
 
 TEST_F(RollbackSmokeTest, Install_Rollback) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Install_RollbackTpk.tpk";
   std::string pkgid1 = "smokeuni15";
   std::string appid1 = "smokeuni15.InstallRollbackTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Install_RollbackWgt.wgt";
   std::string pkgid2 = "smokeuni16";
   std::string appid2 = "smokeuni16.InstallRollbackWgt";
   std::string exec2 = "smokeuni16.InstallRollbackWgt";
 
-  std::vector<bf::path> paths = { path1, path2 };
+  std::vector<fs::path> paths = { path1, path2 };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
@@ -442,22 +445,22 @@ TEST_F(RollbackSmokeTest, Install_Rollback) {
 }
 
 TEST_F(RollbackSmokeTest, Update_Rollback) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "Update_RollbackTpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "Update_RollbackTpk_2.tpk";
   std::string pkgid1 = "smokeuni17";
   std::string appid1 = "smokeuni17.UpdateRollbackTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "Update_RollbackWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "Update_RollbackWgt_2.wgt";
   std::string pkgid2 = "smokeuni18";
   std::string appid2 = "smokeuni18.UpdateRollbackWgt";
   std::string exec2 = "smokeuni18.UpdateRollbackWgt";
 
-  std::vector<bf::path> paths = { path1_old, path2_old };
+  std::vector<fs::path> paths = { path1_old, path2_old };
   ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
   paths = { path1_new, path2_new };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
@@ -473,20 +476,20 @@ TEST_F(RollbackSmokeTest, Update_Rollback) {
 }
 
 TEST_F(RollbackSmokeTest, InstallAndUpdate_Rollback) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackTpk.tpk";
   std::string pkgid1 = "smokeuni19";
   std::string appid1 = "smokeuni19.InstallAndUpdateRollbackTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackWgt_2.wgt";
   std::string pkgid2 = "smokeuni20";
   std::string appid2 = "smokeuni20.InstallAndUpdateRollbackWgt";
   std::string exec2 = "smokeuni20.InstallAndUpdateRollbackWgt";
 
-  std::vector<bf::path> paths = { path2_old };
+  std::vector<fs::path> paths = { path2_old };
   ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
   // pkgid1: install, pkgid2: update
   paths = { path1, path2_new };
@@ -501,14 +504,14 @@ TEST_F(RollbackSmokeTest, InstallAndUpdate_Rollback) {
 }
 
 TEST_F(RollbackSmokeTest, InstallAndROUpdate_Rollback) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_RollbackTpk.tpk";
   std::string pkgid1 = "smokeuni27";
   std::string appid1 = "smokeuni27.InstallAndROUpdateRollbackTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_RollbackWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "InstallAndROUpdate_RollbackWgt_2.wgt";
   std::string pkgid2 = "smokeuni28";
   std::string appid2 = "smokeuni28.InstallAndROUpdateRollbackWgt";
@@ -517,7 +520,7 @@ TEST_F(RollbackSmokeTest, InstallAndROUpdate_Rollback) {
   ASSERT_EQ(backend.InstallPreloadSuccess(path2_old),
         ci::AppInstaller::Result::OK);
   // pkgid1: install, pkgid2: update
-  std::vector<bf::path> paths = { path1, path2_new };
+  std::vector<fs::path> paths = { path1, path2_new };
   ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
@@ -529,12 +532,12 @@ TEST_F(RollbackSmokeTest, InstallAndROUpdate_Rollback) {
 }
 
 TEST_F(SmokeTest, Recovery_Install) {
-  bf::path path1 =
+  fs::path path1 =
       kUnifiedSmokePackagesDirectory / "Recovery_InstallTpk.tpk";
   std::string pkgid1 = "smokeuni21";
   std::string appid1 = "smokeuni21.RecoveryInstallTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2 =
+  fs::path path2 =
       kUnifiedSmokePackagesDirectory / "Recovery_InstallWgt.wgt";
   std::string pkgid2 = "smokeuni22";
   std::string appid2 = "smokeuni22.RecoveryInstallWgt";
@@ -548,7 +551,7 @@ TEST_F(SmokeTest, Recovery_Install) {
   backend_crash.Run(argv);
   ASSERT_NE(backend_crash.Wait(), 0);
 
-  bf::path recovery_file =
+  fs::path recovery_file =
       FindRecoveryFile("/tpk-recovery", params.test_user.uid);
   ASSERT_FALSE(recovery_file.empty());
   std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
@@ -557,7 +560,7 @@ TEST_F(SmokeTest, Recovery_Install) {
   ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::TPK;
   ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
-  ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+  ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
 
   recovery_file =
       FindRecoveryFile("/wgt-recovery", params.test_user.uid);
@@ -568,26 +571,26 @@ TEST_F(SmokeTest, Recovery_Install) {
   ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
   params.pkg_type = PackageType::WGT;
   ASSERT_TRUE(CheckPackageNonExistance(pkgid2, params));
-  ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+  ASSERT_FALSE(fs::exists(recovery_info->unpacked_dir()));
 }
 
 TEST_F(SmokeTest, Recovery_Update) {
-  bf::path path1_old =
+  fs::path path1_old =
       kUnifiedSmokePackagesDirectory / "Recovery_UpdateTpk.tpk";
-  bf::path path1_new =
+  fs::path path1_new =
       kUnifiedSmokePackagesDirectory / "Recovery_UpdateTpk_2.tpk";
   std::string pkgid1 = "smokeuni23";
   std::string appid1 = "smokeuni23.RecoveryUpdateTpk";
   std::string exec1 = "smokeunified";
-  bf::path path2_old =
+  fs::path path2_old =
       kUnifiedSmokePackagesDirectory / "Recovery_UpdateWgt.wgt";
-  bf::path path2_new =
+  fs::path path2_new =
       kUnifiedSmokePackagesDirectory / "Recovery_UpdateWgt_2.wgt";
   std::string pkgid2 = "smokeuni24";
   std::string appid2 = "smokeuni24.RecoveryUpdateWgt";
   std::string exec2 = "smokeuni24.RecoveryUpdateWgt";
 
-  std::vector<bf::path> paths_old = { path1_old, path2_old };
+  std::vector<fs::path> paths_old = { path1_old, path2_old };
   ASSERT_EQ(backend.Install(paths_old), ci::AppInstaller::Result::OK);
 
   std::vector<std::string> paths = { path1_new.string(), path2_new.string() };
@@ -598,7 +601,7 @@ TEST_F(SmokeTest, Recovery_Update) {
   backend_crash.Run(argv);
   ASSERT_NE(backend_crash.Wait(), 0);
 
-  bf::path recovery_file =
+  fs::path recovery_file =
       FindRecoveryFile("/tpk-recovery", params.test_user.uid);
   ASSERT_FALSE(recovery_file.empty());
   std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
index 301911e..638351b 100644 (file)
@@ -9,12 +9,13 @@
 #include <smoke_tests/wgt_smoke_utils.h>
 #include <unzip.h>
 
+#include <filesystem>
 #include <map>
 #include <string>
 #include <vector>
 
-namespace bf = boost::filesystem;
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace {
 
@@ -52,7 +53,7 @@ std::string GetPkgTypeFromPath(const std::string& path) {
 }
 
 std::string GetPkgTypeFromRecoveryFile(const std::string& path) {
-  bf::path recovery_file = path;
+  fs::path recovery_file = path;
   if (recovery_file.filename().string().find("tpk") == 0)
     return "tpk";
   else if (recovery_file.filename().string().find("wgt") == 0)
@@ -157,7 +158,7 @@ common_installer::Subprocess UnifiedBackendInterface::CreateSubprocess() const {
       "/usr/bin/unified-installer-ut/smoke-test-helper");
 }
 
-UnifiedRecoveryInfo::UnifiedRecoveryInfo(bf::path path) : path_(path) {
+UnifiedRecoveryInfo::UnifiedRecoveryInfo(fs::path path) : path_(path) {
 }
 
 bool UnifiedRecoveryInfo::Init() {
@@ -176,7 +177,7 @@ bool UnifiedRecoveryInfo::Init() {
       break;
     }
 
-    if (!boost::filesystem::exists(line_data))
+    if (!fs::exists(line_data))
       continue;
 
     recovery_files_.emplace_back(line_data);
@@ -190,7 +191,7 @@ bool UnifiedRecoveryInfo::GetCleanUp() const {
   return clean_up_;
 }
 
-const std::vector<bf::path> UnifiedRecoveryInfo::GetRecoveryFiles() const {
+const std::vector<fs::path> UnifiedRecoveryInfo::GetRecoveryFiles() const {
   return recovery_files_;
 }
 
index bfdbc25..f8f6b3e 100644 (file)
 #include <smoke_tests/common/smoke_utils.h>
 #include <smoke_tests/tpk_smoke_utils.h>
 
+#include <filesystem>
 #include <string>
 #include <vector>
 
-#include <boost/filesystem/path.hpp>
-
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
 
 namespace smoke_test {
 
@@ -41,15 +40,15 @@ class UnifiedBackendInterface : public BackendInterface {
 
 class UnifiedRecoveryInfo {
  public:
-  explicit UnifiedRecoveryInfo(bf::path path);
+  explicit UnifiedRecoveryInfo(fs::path path);
 
   bool Init();
   bool GetCleanUp() const;
-  const std::vector<bf::path> GetRecoveryFiles() const;
+  const std::vector<fs::path> GetRecoveryFiles() const;
 
  private:
-  std::vector<bf::path> recovery_files_;
-  bf::path path_;
+  std::vector<fs::path> recovery_files_;
+  fs::path path_;
   bool clean_up_ = false;
 };
 
index defbd83..d4b49c5 100644 (file)
@@ -2,12 +2,10 @@
 // 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 <map>
@@ -16,9 +14,8 @@
 
 #include "smoke_test/smoke_utils.h"
 
-namespace bf = boost::filesystem;
-namespace bpo = boost::program_options;
 namespace ci = common_installer;
+namespace bf = std::filesystem;
 
 enum class ReqType : int {
   UNKNOWN_REQ,
@@ -92,7 +89,7 @@ class SmokeEnvironment : public testing::Environment {
 
  private:
   ci::RequestMode request_mode_;
-  std::vector<bf::path> backups_;
+  std::vector<fs::path> backups_;
   bool no_backup_;
   BackupType backup_type_;
 };
@@ -112,7 +109,7 @@ void signalHandler(int signum) {
 
 namespace smoke_test {
 
-const bf::path kUnifiedSmokePackagesDirectory =
+const fs::path kUnifiedSmokePackagesDirectory =
     "/usr/share/unified-installer-ut/test_samples/smoke/";
 
 class SmokeTest : public testing::Test {
@@ -133,7 +130,7 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Installation) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
 
-  std::vector<bf::path> paths = {
+  std::vector<fs::path> paths = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.wgt" };
@@ -157,7 +154,7 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Installation) {
   }
   ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
 
-  bf::path recovery_file = FindRecoveryFile("/unified-recovery",
+  fs::path recovery_file = FindRecoveryFile("/unified-recovery",
       params.test_user.uid);
   if (recovery_file.empty()) {
     std::cout << "recovery file dosen't exist, "
@@ -167,8 +164,8 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Installation) {
 
   UnifiedRecoveryInfo recovery_info(recovery_file);
   ASSERT_TRUE(recovery_info.Init());
-  bf::remove(recovery_file);
-  const std::vector<bf::path>& recovery_list = recovery_info.GetRecoveryFiles();
+  fs::remove(recovery_file);
+  const std::vector<fs::path>& recovery_list = recovery_info.GetRecoveryFiles();
   if (recovery_list.empty()) {
     std::cout << "installer recovery file is not created yet" << std::endl;
     return;
@@ -207,11 +204,11 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Update) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
 
-  std::vector<bf::path> paths_old = {
+  std::vector<fs::path> paths_old = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.wgt" };
-  std::vector<bf::path> paths_new = {
+  std::vector<fs::path> paths_new = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg2.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg2.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg2.wgt" };
@@ -238,7 +235,7 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Update) {
   }
   ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
 
-  bf::path recovery_file = FindRecoveryFile("/unified-recovery",
+  fs::path recovery_file = FindRecoveryFile("/unified-recovery",
       params.test_user.uid);
   if (recovery_file.empty()) {
     std::cout << "recovery file dosen't exist, "
@@ -248,8 +245,8 @@ TEST_F(SmokeTest, RecoveryMode_Multi_Update) {
 
   UnifiedRecoveryInfo recovery_info(recovery_file);
   ASSERT_TRUE(recovery_info.Init());
-  bf::remove(recovery_file);
-  const std::vector<bf::path>& recovery_list = recovery_info.GetRecoveryFiles();
+  fs::remove(recovery_file);
+  const std::vector<fs::path>& recovery_list = recovery_info.GetRecoveryFiles();
   if (recovery_list.empty()) {
     std::cout << "installer recovery file is not created yet" << std::endl;
     return;
@@ -301,11 +298,11 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
 
-  std::vector<bf::path> paths_old = {
+  std::vector<fs::path> paths_old = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.wgt" };
-  std::vector<bf::path> paths_new = {
+  std::vector<fs::path> paths_new = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.delta",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.delta",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.delta" };
@@ -332,7 +329,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   }
   ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
 
-  bf::path recovery_file = FindRecoveryFile("/unified-recovery",
+  fs::path recovery_file = FindRecoveryFile("/unified-recovery",
       params.test_user.uid);
   if (recovery_file.empty()) {
     std::cout << "recovery file dosen't exist, "
@@ -342,8 +339,8 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
 
   UnifiedRecoveryInfo recovery_info(recovery_file);
   ASSERT_TRUE(recovery_info.Init());
-  bf::remove(recovery_file);
-  const std::vector<bf::path>& recovery_list = recovery_info.GetRecoveryFiles();
+  fs::remove(recovery_file);
+  const std::vector<fs::path>& recovery_list = recovery_info.GetRecoveryFiles();
   if (recovery_list.empty()) {
     std::cout << "installer recovery file is not created yet" << std::endl;
     return;
@@ -395,7 +392,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
 
-  std::vector<bf::path> paths = {
+  std::vector<fs::path> paths = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.wgt" };
@@ -419,7 +416,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
   }
   ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
 
-  bf::path recovery_file = FindRecoveryFile("/unified-recovery",
+  fs::path recovery_file = FindRecoveryFile("/unified-recovery",
       params.test_user.uid);
   if (recovery_file.empty()) {
     std::cout << "recovery file dosen't exist, "
@@ -429,8 +426,8 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
 
   UnifiedRecoveryInfo recovery_info(recovery_file);
   ASSERT_TRUE(recovery_info.Init());
-  bf::remove(recovery_file);
-  const std::vector<bf::path>& recovery_list = recovery_info.GetRecoveryFiles();
+  fs::remove(recovery_file);
+  const std::vector<fs::path>& recovery_list = recovery_info.GetRecoveryFiles();
   if (recovery_list.empty()) {
     std::cout << "installer recovery file is not created yet" << std::endl;
     return;
@@ -469,11 +466,11 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
 
-  std::vector<bf::path> paths_old = {
+  std::vector<fs::path> paths_old = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg.wgt" };
-  std::vector<bf::path> paths_new = {
+  std::vector<fs::path> paths_new = {
       kUnifiedSmokePackagesDirectory / "RecoveryTpkPkg2.tpk",
       kUnifiedSmokePackagesDirectory / "RecoveryWgtPkg2.wgt",
       kUnifiedSmokePackagesDirectory / "RecoveryHybridPkg2.wgt" };
@@ -501,7 +498,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
   }
   ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
 
-  bf::path recovery_file = FindRecoveryFile("/unified-recovery",
+  fs::path recovery_file = FindRecoveryFile("/unified-recovery",
       params.test_user.uid);
   if (recovery_file.empty()) {
     std::cout << "recovery file dosen't exist, "
@@ -511,8 +508,8 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
 
   UnifiedRecoveryInfo recovery_info(recovery_file);
   ASSERT_TRUE(recovery_info.Init());
-  bf::remove(recovery_file);
-  const std::vector<bf::path>& recovery_list = recovery_info.GetRecoveryFiles();
+  fs::remove(recovery_file);
+  const std::vector<fs::path>& recovery_list = recovery_info.GetRecoveryFiles();
   if (recovery_list.empty()) {
     std::cout << "installer recovery file is not created yet" << std::endl;
     return;
@@ -574,6 +571,48 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
 }  // namespace smoke_test
 
 const int kBufSize = 1024;
+const struct option long_opts[] = {
+  { "help", no_argument, nullptr, 'h' },
+  { "install", no_argument, nullptr, 'i' },
+  { "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
+  --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 {
@@ -586,81 +625,66 @@ int main(int argc,  char** argv) {
     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")
-        ("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;
-    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 '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;
     }