From: Tomasz Iwanek Date: Tue, 30 Aug 2016 14:17:57 +0000 (+0200) Subject: Smoke test for delta recovery X-Git-Tag: accepted/tizen/common/20160909.115059~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F86136%2F2;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Smoke test for delta recovery To verify, run new smoke test. Requires: - https://review.tizen.org/gerrit/#/c/86119/ Change-Id: I612a4cf568646787463e05dc874f77af7f5c55e5 --- diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index c56ebbd..75c0fa3 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -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 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 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 index 0000000..080dada Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt differ