[SmokeTest] Fixes for smoke tests 47/131047/6
authorBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Wed, 24 May 2017 10:13:30 +0000 (12:13 +0200)
committerBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Wed, 14 Jun 2017 11:21:38 +0000 (13:21 +0200)
Add "System" exec label to extensive smoke test.
Small fixes for RecoveryMode_ForDelta and MigrateLegacyExternalImageMode.

Change-Id: I5e342a9e397e5c0ce72680037b1dcb667828c1e3

packaging/wgt-backend-tests.manifest
src/unit_tests/extensive_smoke_test.cc
src/unit_tests/smoke_test.cc
src/unit_tests/smoke_utils.cc

index 17bba51..8ea34c3 100644 (file)
@@ -5,5 +5,6 @@
         <assign>
                 <filesystem path="/usr/bin/wgt-backend-ut/smoke-test" exec_label="System" />
                 <filesystem path="/usr/bin/wgt-backend-ut/smoke-test-helper" exec_label="System" />
+                <filesystem path="/usr/bin/wgt-backend-ut/extensive-smoke-test" exec_label="System" />
         </assign>
 </manifest>
index 043c293..34104de 100644 (file)
@@ -107,12 +107,14 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
   std::string pkgid = "smokewgt30";
   std::string appid = "smokewgt30.RecoveryModeForDelta";
-  bf::path recovery_file = FindRecoveryFile();
   RemoveAllRecoveryFiles();
+  ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, kTestUserId);
   std::vector<std::string> args =
       {"", "-i", path_new.string(), "-u", kTestUserIdStr.c_str()};
   CrashAfterEachStep(args, [=](int step) -> bool {
     if (step >= 1) {
+      bf::path recovery_file = FindRecoveryFile();
       EXTENDED_ASSERT_FALSE(recovery_file.empty());
       EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT),
           ci::AppInstaller::Result::OK);
@@ -120,6 +122,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
 
       EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
           "res/wgt/VERSION", "1\n"));
+      EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId));
     }
     return true;
   });
index 35bdfbc..c3dad25 100644 (file)
@@ -583,9 +583,14 @@ TEST_F(SmokeTest, MigrateLegacyExternalImageMode) {
   std::string pkgid = "smokewgt36";
   std::string appid = "smokewgt36.web";
   bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
-  ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
-      PackageType::WGT), ci::AppInstaller::Result::OK);
-  ValidateExternalPackage(pkgid, {appid});
+  if (kTestUserIdStr == kDefaultUserIdStr || kTestUserId == kGlobalUserUid) {
+    ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
+        PackageType::WGT), ci::AppInstaller::Result::OK);
+    ValidateExternalPackage(pkgid, {appid});
+  } else {
+    ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
+        PackageType::WGT), ci::AppInstaller::Result::ERROR);
+  }
 }
 
 TEST_F(PreloadSmokeTest, InstallationMode_Preload) {
index 3721b48..08d617f 100644 (file)
@@ -660,7 +660,7 @@ ci::AppInstaller::Result MigrateLegacyExternalImage(const std::string& pkgid,
     return ci::AppInstaller::Result::ERROR;
   }
   const char* argv[] = {"", "--migrate-extimg", pkgid.c_str(),
-                       "-u", kDefaultUserIdStr.c_str()};
+                       "-u", kTestUserIdStr.c_str()};
   return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
 }