Execute installer as subprocess in extensive smoke test 69/283269/1
authorIlho Kim <ilho159.kim@samsung.com>
Thu, 13 Oct 2022 10:32:27 +0000 (19:32 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Fri, 21 Oct 2022 06:48:15 +0000 (15:48 +0900)
In the extensive smoke test, a large number of installers are executed
because a crash or failure occurs between each step
for this reason, a large amount of memory can be used during testing

Change-Id: I966f5c11a86ebb21ef0e4624186e1aa82eb3b6e2
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
test/smoke_tests/extensive_smoke_test.cc
test/smoke_tests/recovery_test.cc
test/smoke_tests/tpk_smoke_utils.cc
test/smoke_tests/tpk_smoke_utils.h

index b9e4150f4b22c97f3fab109eeb350f3d64b5ad32..3eb8e85987d2e7b5fb7b96eda2a1a2a3a21ccf68 100644 (file)
@@ -119,7 +119,8 @@ TEST_F(SmokeTest, DeltaMode_Tpk_Rollback) {
   std::string pkgid = "smoketpk28";
   std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
   std::string exec = "basicdali";
-  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithSubprocess(path),
+      BackendInterface::SubProcessResult::SUCCESS);
   std::string test_uid_str = std::to_string(params.test_user.uid);
   const char* argv[] =
       {"", "-i", delta_package.c_str(), "-u", test_uid_str.c_str()};
@@ -159,12 +160,12 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       if (recovery_info->cleanup()) {
         EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
       } else {
         EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
       }
@@ -178,7 +179,8 @@ 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";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+      BackendInterface::SubProcessResult::SUCCESS);
 
   std::string test_uid_str = std::to_string(params.test_user.uid);
   std::vector<std::string> args =
@@ -193,17 +195,20 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(
+          backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
       std::string version = recovery_info->cleanup() ? "2" : "1";
       EXTENDED_ASSERT_TRUE(
           ValidateFileContentInPackage(pkgid, "res/VERSION", version, params));
       if (recovery_info->cleanup()) {
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
-        EXTENDED_ASSERT_EQ(backend.Install(path_old),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(
+            backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
+        EXTENDED_ASSERT_EQ(
+            backend.InstallWithSubprocess(path_old),
+            BackendInterface::SubProcessResult::SUCCESS);
       }
     }
     return true;
@@ -224,7 +229,8 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
 
 TEST_F(SmokeTest, TEP_Tpk_TepInstallTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(5)
-  ASSERT_EQ(backend.InstallWithTEP(path, tep1), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithTEPWithSubprocess(path, tep1),
+      BackendInterface::SubProcessResult::SUCCESS);
   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(),
                         "-e", tep1.c_str()};
@@ -238,7 +244,8 @@ TEST_F(SmokeTest, TEP_Tpk_TepInstallTepUpdateRollback) {
 
 TEST_F(SmokeTest, TEP_Tpk_NoTepInstallTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(6)
-  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithSubprocess(path),
+      BackendInterface::SubProcessResult::SUCCESS);
   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(),
                         "-e", tep1.c_str()};
@@ -254,7 +261,8 @@ TEST_F(SmokeTest, TEP_Tpk_NoTepInstallTepUpdateRollback) {
 
 TEST_F(SmokeTest, TEP_Tpk_TepInstallNoTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(7)
-  ASSERT_EQ(backend.InstallWithTEP(path, tep1), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithTEPWithSubprocess(path, tep1),
+      BackendInterface::SubProcessResult::SUCCESS);
   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()};
   backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
@@ -267,8 +275,8 @@ TEST_F(SmokeTest, TEP_Tpk_TepInstallNoTepUpdateRollback) {
 
 TEST_F(SmokeTest, TEP_Tpk_Mount_TepInstallTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(12)
-  ASSERT_EQ(backend.MountInstallWithTEP(path, tep1),
-      ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.MountInstallWithTEPWithSubprocess(path, tep1),
+      BackendInterface::SubProcessResult::SUCCESS);
   std::string test_uid_str = std::to_string(params.test_user.uid);
   const char* argv[] = {"", "-w", path.c_str(), "-u", test_uid_str.c_str(),
                         "-e", tep2.c_str()};
@@ -283,7 +291,8 @@ TEST_F(SmokeTest, TEP_Tpk_Mount_TepInstallTepUpdateRollback) {
 
 TEST_F(SmokeTest, TEP_Tpk_Mount_NoTepInstallTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(13)
-  ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.MountInstallWithSubprocess(path),
+      BackendInterface::SubProcessResult::SUCCESS);
   std::string test_uid_str = std::to_string(params.test_user.uid);
   const char* argv[] = {"", "-w", path.c_str(), "-u", test_uid_str.c_str(),
                         "-e", tep1.c_str()};
@@ -300,8 +309,8 @@ TEST_F(SmokeTest, TEP_Tpk_Mount_NoTepInstallTepUpdateRollback) {
 
 TEST_F(SmokeTest, TEP_Tpk_Mount_TepInstallNoTepUpdateRollback) {
   TEP_TEST_STARTING_BLOCK(14)
-  ASSERT_EQ(backend.MountInstallWithTEP(path, tep1),
-      ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.MountInstallWithTEPWithSubprocess(path, tep1),
+      BackendInterface::SubProcessResult::SUCCESS);
   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()};
   backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
@@ -329,7 +338,8 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
   bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(path_old));
+  ASSERT_EQ(BackendInterface::SubProcessResult::SUCCESS,
+      backend.InstallWithSubprocess(path_old));
 
   std::string test_uid_str = std::to_string(params.test_user.uid);
   std::vector<std::string> args =
@@ -344,8 +354,8 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
       std::string contents = recovery_info->cleanup() ?
           "version 2" : "version 1";
@@ -358,10 +368,10 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
       if (recovery_info->cleanup()) {
         EXTENDED_ASSERT_FALSE(bf::exists(root_path / pkgid / "res/DELETED"));
         EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "res/ADDED"));
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
-        EXTENDED_ASSERT_EQ(backend.Install(path_old),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
+        EXTENDED_ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+            BackendInterface::SubProcessResult::SUCCESS);
       } else {
         EXTENDED_ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
         EXTENDED_ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
@@ -377,7 +387,8 @@ TEST_F(SmokeTest, UpdateMode_Rollback) {
   std::string pkgid = "smoketpk36";
   std::string appid = "smoketpk36.UpdateMode_Rollback";
   std::string exec = "smoketpk36";
-  ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(old_path));
+  ASSERT_EQ(BackendInterface::SubProcessResult::SUCCESS,
+      backend.InstallWithSubprocess(old_path));
 
   std::string test_uid_str = std::to_string(params.test_user.uid);
   const char* argv[] =
@@ -407,13 +418,13 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       ScopedTzipInterface interface(pkgid, params.test_user.uid);
       if (recovery_info->cleanup()) {
         EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
       } else {
         EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
       }
@@ -428,7 +439,8 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
   bf::path path_new =
       kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(path_old));
+  ASSERT_EQ(BackendInterface::SubProcessResult::SUCCESS,
+      backend.MountInstallWithSubprocess(path_old));
 
   std::string test_uid_str = std::to_string(params.test_user.uid);
   std::vector<std::string> args =
@@ -449,8 +461,8 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       ScopedTzipInterface interface(pkgid, params.test_user.uid);
       EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
       std::string version = recovery_info->cleanup() ? "2" : "1";
@@ -459,10 +471,10 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
         "res/VERSION", version, params));
       if (recovery_info->cleanup()) {
         interface.Release();
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
-        EXTENDED_ASSERT_EQ(backend.MountInstall(path_old),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
+        EXTENDED_ASSERT_EQ(backend.MountInstallWithSubprocess(path_old),
+            BackendInterface::SubProcessResult::SUCCESS);
       }
     }
     return true;
@@ -489,7 +501,8 @@ TEST_F(SmokeTest, MountUpdateMode_Rollback) {
   std::string pkgid = "smoketpk40";
   std::string appid = "smoketpk40.MountUpdateMode_Rollback";
   std::string exec = "smoketpk40";
-  ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(old_path));
+  ASSERT_EQ(BackendInterface::SubProcessResult::SUCCESS,
+      backend.MountInstallWithSubprocess(old_path));
   std::string test_uid_str = std::to_string(params.test_user.uid);
   const char* argv[] =
     {"", "-w", new_path.c_str(), "-u", test_uid_str.c_str()};
@@ -509,7 +522,8 @@ TEST_F(PreloadSmokeTest, RecoveryMode_ForReadonlyUpdateInstall) {
   bf::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);
+  ASSERT_EQ(backend.InstallPreloadWithSubprocess(path_old),
+      BackendInterface::SubProcessResult::SUCCESS);
 
   std::string test_uid_str = std::to_string(params.test_user.uid);
   std::vector<std::string> args =
@@ -524,8 +538,8 @@ TEST_F(PreloadSmokeTest, RecoveryMode_ForReadonlyUpdateInstall) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          BackendInterface::SubProcessResult::SUCCESS);
       if (recovery_info->cleanup())
         params.is_readonly = false;
       EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
@@ -533,8 +547,8 @@ TEST_F(PreloadSmokeTest, RecoveryMode_ForReadonlyUpdateInstall) {
       EXTENDED_ASSERT_TRUE(
           ValidateFileContentInPackage(pkgid, "res/VERSION", version, params));
       if (recovery_info->cleanup()) {
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
       }
     }
     return true;
@@ -547,7 +561,8 @@ TEST_F(SmokeTest, RecoveryMode_AddResControl) {
   bf::path path_new = kSmokePackagesDirectory
       / "RecoveryMode_AddResControl_2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+      BackendInterface::SubProcessResult::SUCCESS);
 
   std::string pkgid = "smoketpk50";
   std::string appid = "smoketpk50.RecoveryMode_AddResControl";
@@ -565,8 +580,8 @@ TEST_F(SmokeTest, RecoveryMode_AddResControl) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          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"),
@@ -575,10 +590,10 @@ TEST_F(SmokeTest, RecoveryMode_AddResControl) {
           dir_exists);
 
       if (recovery_info->cleanup()) {
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
-        EXTENDED_ASSERT_EQ(backend.Install(path_old),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
+        EXTENDED_ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+            BackendInterface::SubProcessResult::SUCCESS);
       }
     }
     return true;
@@ -591,7 +606,8 @@ TEST_F(SmokeTest, RecoveryMode_RemoveResControl) {
   bf::path path_new = kSmokePackagesDirectory
       / "RecoveryMode_RemoveResControl_2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+      BackendInterface::SubProcessResult::SUCCESS);
 
   std::string pkgid = "smoketpk51";
   std::string appid = "smoketpk51.RecoveryMode_RemoveResControl";
@@ -609,8 +625,8 @@ TEST_F(SmokeTest, RecoveryMode_RemoveResControl) {
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
           GetRecoverFileInfo(recovery_file);
-      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
-          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
+          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"),
@@ -619,10 +635,10 @@ TEST_F(SmokeTest, RecoveryMode_RemoveResControl) {
           dir_exists);
 
       if (recovery_info->cleanup()) {
-        EXTENDED_ASSERT_EQ(backend.Uninstall(pkgid),
-            ci::AppInstaller::Result::OK);
-        EXTENDED_ASSERT_EQ(backend.Install(path_old),
-            ci::AppInstaller::Result::OK);
+        EXTENDED_ASSERT_EQ(backend.UninstallWithSubprocess(pkgid),
+            BackendInterface::SubProcessResult::SUCCESS);
+        EXTENDED_ASSERT_EQ(backend.InstallWithSubprocess(path_old),
+            BackendInterface::SubProcessResult::SUCCESS);
       }
     }
     return true;
index 66414acbdcf1f32f5bb5ee01602b68d470ec767e..9c8dafcfd2ee14476cb57649e5f1ffdea122cdf7 100644 (file)
@@ -160,7 +160,7 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
                  "this test is skipped" << std::endl;
     return;
   }
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
   ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
 }
@@ -191,7 +191,7 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Uninstallation) {
                  "this test is skipped" << std::endl;
     return;
   }
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
   ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
 }
@@ -227,7 +227,7 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
 
   std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
       GetRecoverFileInfo(recovery_file);
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
   ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
   ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION",
@@ -267,7 +267,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
 
   std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
       GetRecoverFileInfo(recovery_file);
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
   ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
   ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION",
@@ -299,7 +299,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
                  "this test is skipped" << std::endl;
     return;
   }
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
 
   ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
@@ -339,7 +339,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
   ScopedTzipInterface poweroff_unmount_interface(pkgid, params.test_user.uid);
   poweroff_unmount_interface.Release();
 
-  ASSERT_EQ(backend.RecoveryWithSubprocess(recovery_file),
+  ASSERT_EQ(backend.RecoverWithSubprocess(recovery_file),
       BackendInterface::SubProcessResult::SUCCESS);
 
   ScopedTzipInterface interface(pkgid, params.test_user.uid);
index 89765969dcfce413f02bb547e52d4a9d64a47bd1..47588c4d61594ca84b670ded289bffc39d13021a 100644 (file)
@@ -103,4 +103,20 @@ TpkBackendInterface::MountInstallSuccessWithTEP(
   return BackendInterface::CommandResult::OK;
 }
 
+TpkBackendInterface::SubProcessResult
+TpkBackendInterface::InstallWithTEPWithSubprocess(
+    const bf::path& path, const bf::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 {
+  std::vector<std::string> args =
+      {"", "-w", path.string(), "-u", uid_str_, "-e", tep.string()};
+  return RunSubprocess(args);
+}
+
 }  // namespace smoke_test
index f2fd74b6307d77f331e937a18e084035f74c9fee..941ad4d39fc630fc17fb255ad2250ecfd8a2e221 100644 (file)
@@ -45,6 +45,11 @@ class TpkBackendInterface: public BackendInterface {
   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;
+
   AppQueryInterfacePtr CreateQueryInterface() const override;
   AppInstallerPtr CreateInstaller(
       common_installer::PkgMgrPtr pkgmgr) const override;