Smoke test for delta recovery 36/86136/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 30 Aug 2016 14:17:57 +0000 (16:17 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 31 Aug 2016 08:13:30 +0000 (01:13 -0700)
To verify, run new smoke test.

Requires:
 - https://review.tizen.org/gerrit/#/c/86119/

Change-Id: I612a4cf568646787463e05dc874f77af7f5c55e5

src/unit_tests/smoke_test.cc
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta [new file with mode: 0755]
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt [new file with mode: 0644]

index c56ebbd..75c0fa3 100644 (file)
@@ -598,6 +598,26 @@ TEST_F(SmokeTest, RecoveryMode_ForUpdate) {
   ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n"));
 }
 
+TEST_F(SmokeTest, RecoveryMode_ForDelta) {
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+  RemoveAllRecoveryFiles();
+  ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK);
+  Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  backend_crash.Run("-i", path_new.string(), "-u", kTestUserIdStr.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  std::string pkgid = "smokeapp30";
+  std::string appid = "smokeapp30.RecoveryModeForDelta";
+  bf::path recovery_file = FindRecoveryFile();
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(Recover(recovery_file, PackageType::WGT),
+            ci::AppInstaller::Result::OK);
+  ValidatePackage(pkgid, {appid});
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n"));
+}
+
 TEST_F(SmokeTest, InstallationMode_GoodSignature) {
   bf::path path = kSmokePackagesDirectory / "InstallationMode_GoodSignature.wgt";  // NOLINT
   ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK);
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta
new file mode 100755 (executable)
index 0000000..7da64e4
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt
new file mode 100644 (file)
index 0000000..0349748
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt
new file mode 100644 (file)
index 0000000..080dada
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt differ