Smoke test DeltaMode_Tpk_Rollback 81/111681/3
authorBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Mon, 23 Jan 2017 10:23:52 +0000 (11:23 +0100)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 6 Feb 2017 12:22:29 +0000 (04:22 -0800)
Verification:
 $ /usr/bin/tpk-backend-ut/smoke-tests
        --gtest_filter=SmokeTest.DeltaMode_Tpk_Rollback

Change-Id: Ie8d4dd72a857304c06178380c03199ab8ac65948

src/unit_tests/smoke_test.cc
src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback_2.tpk [new file with mode: 0644]

index 9715deb..e32e711 100644 (file)
@@ -632,6 +632,27 @@ TEST_F(SmokeTest, DeltaMode_Tpk) {
   ValidateFileContentInPackage(pkgid, "MODIFIED", "version 2\n");
 }
 
+TEST_F(SmokeTest, DeltaMode_Tpk_Rollback) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Tpk_Rollback.tpk";
+  bf::path delta_package = kSmokePackagesDirectory /
+      "DeltaMode_Tpk_Rollback.delta";
+  std::string pkgid = "smoketpk28";
+  std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
+  ASSERT_EQ(Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(Install(delta_package, RequestResult::FAIL),
+            ci::AppInstaller::Result::ERROR);
+  ValidatePackage(pkgid, appid);
+
+  // Check delta modifications
+  bf::path root_path = ci::GetRootAppPath(false, kTestUserId);
+  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" /
+                         "basicdali.png"));
+  ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1\n");
+}
+
 TEST_F(SmokeTest, ReinstallMode_Tpk) {
   bf::path path = kSmokePackagesDirectory / "ReinstallMode_Tpk.tpk";
   bf::path rds_directory = kSmokePackagesDirectory / "delta_dir";
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.delta b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.delta
new file mode 100644 (file)
index 0000000..7110a2e
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.delta differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.tpk b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.tpk
new file mode 100644 (file)
index 0000000..e1d0769
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback_2.tpk b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback_2.tpk
new file mode 100644 (file)
index 0000000..9dd3442
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Tpk_Rollback_2.tpk differ