Change packages used in recovery test 71/216471/5
authorIlho Kim <ilho159.kim@samsung.com>
Fri, 25 Oct 2019 08:45:59 +0000 (17:45 +0900)
committerilho kim <ilho159.kim@samsung.com>
Mon, 4 Nov 2019 08:54:57 +0000 (08:54 +0000)
Increase the package size

Change-Id: Ie3723b4e431a9e0abce29669a0d4a60c9d1df0b4
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/unit_tests/recovery_test.cc
src/unit_tests/test_samples/smoke/RecoveryPkg.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryPkg.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryPkg2.tpk [new file with mode: 0644]

index acde109917578c028ded69b97ded12a4b3d0b3fd..54ca0fa5960af075807d77e9028c38ded383c3a8 100644 (file)
@@ -110,7 +110,7 @@ class SmokeTest : public testing::Test {
 TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
 
-  bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
+  bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
   ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
   std::string test_uid_str = std::to_string(params.test_user.uid);
 
@@ -119,7 +119,7 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
   tpk_backend.Kill();
 
   if (tpk_backend.Wait() == 9) {
-    std::string pkgid = "smokeapp15";
+    std::string pkgid = "recoverypkg";
     bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
         params.test_user.uid);
 
@@ -132,13 +132,13 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
 }
 
 TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
-  std::string pkgid = "smokeapp16";
+  std::string pkgid = "recoverypkg";
 
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
 
-  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
-  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg2.tpk";
   ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
   ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
   std::string test_uid_str = std::to_string(params.test_user.uid);
@@ -148,28 +148,28 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
   tpk_backend.Kill();
 
   if (tpk_backend.Wait() == 9) {
-    std::string appid = "smokeapp16.RecoveryModeTpkUpdate";
-    std::string exec = "native";
+    std::string appid = "recoverypkg";
+    std::string exec = "recoverypkg";
     bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
         params.test_user.uid);
 
     ASSERT_FALSE(recovery_file.empty());
     ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
     ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
-    ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "1\n", params));
+    ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n", params));
   } else {
     std::cout << "update finished before process killed" << std::endl;
   }
 }
 
 TEST_F(SmokeTest, RecoveryMode_ForDelta) {
-  std::string pkgid = "smoketpk35";
+  std::string pkgid = "recoverypkg";
 
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
 
-  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
-  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg.delta";
   ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
   ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
   std::string test_uid_str = std::to_string(params.test_user.uid);
@@ -179,8 +179,8 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   tpk_backend.Kill();
 
   if (tpk_backend.Wait() == 9) {
-    std::string appid = "smoketpk35.RecoveryMode_ForDelta";
-    std::string exec = "smoketpk35";
+    std::string appid = "recoverypkg";
+    std::string exec = "recoverypkg";
     bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
         params.test_user.uid);
     bf::path root_path = ci::GetRootAppPath(params.is_readonly,
@@ -189,7 +189,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
     ASSERT_FALSE(recovery_file.empty());
     ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Recover(recovery_file));
     ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
-    ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1",
+    ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n",
         params));
     ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
     ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
@@ -201,7 +201,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
 TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
 
-  bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
+  bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
   ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
   std::string test_uid_str = std::to_string(params.test_user.uid);
 
@@ -210,7 +210,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
   tpk_backend.Kill();
 
   if (tpk_backend.Wait() == 9) {
-    std::string pkgid = "smoketpk37";
+    std::string pkgid = "recoverypkg";
     bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
         params.test_user.uid);
 
@@ -223,14 +223,14 @@ TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
 }
 
 TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
-  std::string pkgid = "smoketpk38";
+  std::string pkgid = "recoverypkg";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
 
   bf::path path_old =
-      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.tpk";
+      kSmokePackagesDirectory / "RecoveryPkg.tpk";
   bf::path path_new =
-      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
+      kSmokePackagesDirectory / "RecoveryPkg2.tpk";
   ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(path_old));
   ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
   std::string test_uid_str = std::to_string(params.test_user.uid);
@@ -240,8 +240,8 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
   tpk_backend.Kill();
 
   if (tpk_backend.Wait() == 9) {
-    std::string appid = "smoketpk38.RecoveryMode_ForMountUpdate";
-    std::string exec = "smoketpk38";
+    std::string appid = "recoverypkg";
+    std::string exec = "recoverypkg";
     bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
         params.test_user.uid);
 
@@ -254,7 +254,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
     ScopedTzipInterface interface(pkgid, params.test_user.uid);
     ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
     ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
-        "res/VERSION", "1", params));
+        "res/VERSION", "1\n", params));
   } else {
     std::cout << "mount update finished before process killed" << std::endl;
   }
@@ -372,6 +372,8 @@ int main(int argc,  char** argv) {
       snprintf(buf[gtest_argv.size()], kBufSize,
           "--gtest_repeat=%d", repeat_count);
       gtest_argv.push_back(buf[gtest_argv.size()]);
+      snprintf(buf[gtest_argv.size()], kBufSize, "--gtest_break_on_failure");
+      gtest_argv.push_back(buf[gtest_argv.size()]);
     }
     gtest_argv.push_back(nullptr);
     int gtest_argc = gtest_argv.size();
diff --git a/src/unit_tests/test_samples/smoke/RecoveryPkg.delta b/src/unit_tests/test_samples/smoke/RecoveryPkg.delta
new file mode 100644 (file)
index 0000000..bcdf006
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryPkg.delta differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryPkg.tpk b/src/unit_tests/test_samples/smoke/RecoveryPkg.tpk
new file mode 100644 (file)
index 0000000..aa35c55
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryPkg.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryPkg2.tpk b/src/unit_tests/test_samples/smoke/RecoveryPkg2.tpk
new file mode 100644 (file)
index 0000000..2828101
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryPkg2.tpk differ