From b0e4ad894443261c61a6611f5a62cc63e93caa23 Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Fri, 1 Sep 2017 09:29:54 +0900 Subject: [PATCH 01/16] Add step for privacy privilege Signed-off-by: Seungha Son Change-Id: I699da12a566354021361202c68b6567a162f78ec --- src/wgt/wgt_installer.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 1e09e65..3a8956b 100755 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -233,6 +234,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -281,6 +284,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -311,6 +316,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Uninstall); AddStep(); AddStep(); AddStep(); @@ -336,6 +343,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep(); AddStep(); @@ -385,6 +394,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -445,6 +456,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -490,6 +503,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -517,6 +532,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep(ci::Plugin::ActionType::Install); AddStep( @@ -548,6 +565,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -591,6 +610,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep(ci::Plugin::ActionType::Upgrade); AddStep(); @@ -620,6 +641,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep(); AddStep(ci::Plugin::ActionType::Upgrade); @@ -637,6 +660,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep(ci::Plugin::ActionType::Install); AddStep( @@ -660,6 +685,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -682,6 +709,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Uninstall); AddStep(); } -- 2.7.4 From 5dc947088c5f35dead54268b60226c51c72a8fbc Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Thu, 28 Sep 2017 13:46:37 +0900 Subject: [PATCH 02/16] Release version 0.7.2 Changes: - Add step for privacy privilege Signed-off-by: Seungha Son Change-Id: I1967ce52af6a2951f6a8aa728eb101bd4ed336be --- packaging/wgt-backend.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index fa09ad8..45e107b 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -1,6 +1,6 @@ Name: wgt-backend Summary: Application installer backend for WGT -Version: 0.7.1 +Version: 0.7.2 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 89e87396cc8312f2ac3e5bb08f6ab9f04841cb8c Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 10 Oct 2017 21:22:21 +0900 Subject: [PATCH 03/16] Fix appdefined privilege parsing Requires: - https://review.tizen.org/gerrit/154530 Change-Id: If9add359f17bc952b86498c06f5dd3525d3130a5 Signed-off-by: Sangyoon Jang --- .../config.xml | 4 +- .../config.xml | 4 +- .../config.xml | 4 +- .../config.xml | 4 +- .../config.xml | 6 +-- .../config.xml | 4 +- .../config.xml | 4 +- .../config.xml | 6 +-- .../config.xml | 4 +- src/wgt/step/configuration/step_parse.cc | 43 +++++++++++----------- 10 files changed, 32 insertions(+), 51 deletions(-) diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml index 78ca65a..948de8c 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml index 748f827..1fce6a4 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml index 68e32f7..cfdfa4a 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml index 201ebd7..8897072 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml index f01fb27..9eecba2 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml @@ -1,8 +1,6 @@ - - - - + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml index bb84800..1be2518 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml index 613eae7..64572e9 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml index 297cbdf..ad2ce75 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml @@ -1,8 +1,6 @@ - - - - + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml index 7d85238..7985282 100644 --- a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml @@ -1,7 +1,5 @@ - - - + diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index c339a8f..aa62f48 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -645,14 +646,13 @@ bool StepParse::FillPrivileges(manifest_x* manifest) { } bool StepParse::FillAppDefinedPrivileges(manifest_x* manifest) { - auto priv_info = - GetManifestDataForKey( + auto priv_info_list = + GetManifestDataForKey( app_keys::kTizenAppDefinedPrivilegeKey); - if (!priv_info) + if (!priv_info_list) return true; - const auto& privileges = priv_info->GetAppDefinedPrivilegeList(); - for (auto& priv : privileges) { + for (auto& priv : priv_info_list->appdefined_privileges) { appdefined_privilege_x* privilege = reinterpret_cast(calloc(1, sizeof(appdefined_privilege_x))); @@ -660,14 +660,14 @@ bool StepParse::FillAppDefinedPrivileges(manifest_x* manifest) { LOG(ERROR) << "Memory alloc failure"; return false; } - privilege->value = strdup(priv.privilege.c_str()); + privilege->value = strdup(priv.name().c_str()); privilege->type = strdup(common_installer::kWebPrivilegeType); - if (!priv.license.empty()) { - if (bf::path(priv.license).is_absolute()) - privilege->license = strdup(priv.license.c_str()); + if (!priv.license().empty()) { + if (bf::path(priv.license()).is_absolute()) + privilege->license = strdup(priv.license().c_str()); else privilege->license = strdup((context_->root_application_path.get() - / manifest->package / priv.license).c_str()); + / manifest->package / priv.license()).c_str()); } manifest->appdefined_privileges = g_list_append(manifest->appdefined_privileges, privilege); @@ -676,14 +676,13 @@ bool StepParse::FillAppDefinedPrivileges(manifest_x* manifest) { } bool StepParse::FillProvidesAppDefinedPrivileges(manifest_x* manifest) { - auto priv_info = - GetManifestDataForKey( - app_keys::kTizenProvidesAppDefinedPrivilegesKey); - if (!priv_info) + auto priv_info_list = + GetManifestDataForKey( + app_keys::kTizenProvidesAppDefinedPrivilegeKey); + if (!priv_info_list) return true; - const auto& privileges = priv_info->GetAppDefinedPrivilegeList(); - for (auto& priv : privileges) { + for (auto& priv : priv_info_list->appdefined_privileges) { appdefined_privilege_x* privilege = reinterpret_cast(calloc(1, sizeof(appdefined_privilege_x))); @@ -691,14 +690,14 @@ bool StepParse::FillProvidesAppDefinedPrivileges(manifest_x* manifest) { LOG(ERROR) << "Memory alloc failure"; return false; } - privilege->value = strdup(priv.privilege.c_str()); + privilege->value = strdup(priv.name().c_str()); privilege->type = strdup(common_installer::kWebPrivilegeType); - if (!priv.license.empty()) { - if (bf::path(priv.license).is_absolute()) - privilege->license = strdup(priv.license.c_str()); + if (!priv.license().empty()) { + if (bf::path(priv.license()).is_absolute()) + privilege->license = strdup(priv.license().c_str()); else privilege->license = strdup((context_->root_application_path.get() - / manifest->package / priv.license).c_str()); + / manifest->package / priv.license()).c_str()); } manifest->provides_appdefined_privileges = g_list_append(manifest->provides_appdefined_privileges, privilege); -- 2.7.4 From e21f1383ac2b2c2a787d0787a7b927b1f820eed9 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 10 Oct 2017 23:00:13 +0900 Subject: [PATCH 04/16] Fix smoke test We don't need to validate pkgid of appdefined-privilege for client. Change-Id: I5ee7f12398e682a1071d92c37091025573c12f2d Signed-off-by: Sangyoon Jang --- src/unit_tests/manifest_test.cc | 5 ----- .../config.xml | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 90c9ed6..051d2f3 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -223,11 +223,6 @@ TEST_F(ManifestTest, AppDefinedPrivilegeElement_Invalid_NotURI) { ASSERT_FALSE(runner.Run()); } -TEST_F(ManifestTest, AppDefinedPrivilegeElement_Invalid_NoPKGID) { - StepParseRunner runner(GetMyName()); - ASSERT_FALSE(runner.Run()); -} - TEST_F(ManifestTest, AppDefinedPrivilegeElement_Invalid_OverLength) { StepParseRunner runner(GetMyName()); ASSERT_FALSE(runner.Run()); diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml deleted file mode 100644 index 4cb239b..0000000 --- a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - -- 2.7.4 From ed442f20db110d4754826bd523026254bf35b72a Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Wed, 11 Oct 2017 21:34:21 +0900 Subject: [PATCH 05/16] Release version 0.7.3 Changes: - Fix appdefined privilege parsing - Fix smoke test Change-Id: Iebcf9a186cdd05a5955cce40cf76ffe20776a5af Signed-off-by: Sangyoon Jang --- packaging/wgt-backend.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index 45e107b..aaa8808 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -1,6 +1,6 @@ Name: wgt-backend Summary: Application installer backend for WGT -Version: 0.7.2 +Version: 0.7.3 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 8177294c286d2c288ad48855ee2057f833dd7da3 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 17 Oct 2017 11:40:02 +0900 Subject: [PATCH 06/16] Fix static analysis issue - Check if new operator has failed. Change-Id: I840874abdac89bb91f6e5aca26df2ac265a541ac Signed-off-by: Junghyun Yeon --- src/wgt/step/configuration/step_parse.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index aa62f48..0fe8083 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -200,7 +200,11 @@ bool StepParse::FillIconPaths(manifest_x* manifest) { GetManifestDataForKey( app_keys::kIconsKey); if (!icons_info) { - icons_info.reset(new wgt::parse::ApplicationIconsInfo()); + icons_info.reset(new(std::nothrow) wgt::parse::ApplicationIconsInfo()); + if (!icons_info) { + LOG(ERROR) << "Out of memory"; + return false; + } } wgt::parse::LocalizedApplicationIconsInfo localized_list = wgt::parse::GetLocalizedIconList(*icons_info, widget_path_); @@ -867,7 +871,11 @@ common_installer::Step::Status StepParse::process() { return common_installer::Step::Status::MANIFEST_NOT_FOUND; } - parser_.reset(new wgt::parse::WidgetConfigParser()); + parser_.reset(new(std::nothrow) wgt::parse::WidgetConfigParser()); + if (!parser_) { + LOG(ERROR) << "Out of memory"; + return common_installer::Step::Status::CONFIG_ERROR; + } if (!parser_->ParseManifest(widget_path_ / kConfigFileName)) { LOG(ERROR) << "[Parse] Parse failed. " << parser_->GetErrorMessage(); return common_installer::Step::Status::PARSE_ERROR; -- 2.7.4 From 4160fc656c905e15a179dc4c758b774a4a428c31 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Thu, 14 Sep 2017 10:31:17 +0900 Subject: [PATCH 07/16] Change behavior of trust anchor - Trust anchor certificate dir has fixed so it will not defined at manifest. - Remove get/set codes about certificate directory. - Enable trust-anchor on hybrid package. Please note that if both tpk and wgt package have trust-anchor node, wgt's setting will be appliced. Related changes: [pkgmgr-info] : https://review.tizen.org/gerrit/149784 [app-installers] : https://review.tizen.org/gerrit/149836 [tpk-manifest-handlers] : https://review.tizen.org/gerrit/150060 [wgt-manifest-handlers] : https://review.tizen.org/gerrit/150136 Change-Id: Ie110eb1b52695c985495f03b834c9bfd9e5bf960 Signed-off-by: Junghyun Yeon --- src/hybrid/hybrid_installer.cc | 22 +++++++++++++++++ src/hybrid/step/pkgmgr/step_generate_xml.cc | 1 + src/wgt/step/configuration/step_parse.cc | 4 ---- src/wgt/step/pkgmgr/step_generate_xml.cc | 6 +---- src/wgt/wgt_installer.cc | 37 +++++++++++++++++++---------- 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 5a6e342..2a28e39 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -70,6 +70,8 @@ #include #include #include +#include +#include #include #include @@ -148,6 +150,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -201,6 +205,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -229,6 +235,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -285,6 +292,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep(); AddStep(); AddStep( @@ -351,6 +360,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -403,6 +414,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -434,6 +447,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -468,6 +483,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -488,6 +505,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -513,6 +532,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -535,6 +556,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); break; } diff --git a/src/hybrid/step/pkgmgr/step_generate_xml.cc b/src/hybrid/step/pkgmgr/step_generate_xml.cc index 00e4e5d..89772c2 100644 --- a/src/hybrid/step/pkgmgr/step_generate_xml.cc +++ b/src/hybrid/step/pkgmgr/step_generate_xml.cc @@ -34,6 +34,7 @@ const std::vector kBlackListNodes = { {"profile"}, {"privileges"}, {"provides-appdefined-privileges"}, + {"trust-anchor"}, }; const std::vector kNeedMergeNodes = { {"manifest"}, diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 0fe8083..05a3b5d 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -592,10 +592,6 @@ bool StepParse::FillTrustAnchorInfo(manifest_x* manifest) { if (!trust_anchor) return true; - std::string certs_dir = trust_anchor->get_certs_dir(); - if (!certs_dir.empty()) - manifest->pkg_certs_dir = strdup(certs_dir.c_str()); - std::string use_system_certs = trust_anchor->get_use_system_certs(); if (!use_system_certs.empty()) manifest->use_system_certs = strdup(use_system_certs.c_str()); diff --git a/src/wgt/step/pkgmgr/step_generate_xml.cc b/src/wgt/step/pkgmgr/step_generate_xml.cc index 404b5c8..91d9f56 100644 --- a/src/wgt/step/pkgmgr/step_generate_xml.cc +++ b/src/wgt/step/pkgmgr/step_generate_xml.cc @@ -677,14 +677,10 @@ void StepGenerateXml::GenerateShortcuts(xmlTextWriterPtr writer) { } void StepGenerateXml::GenerateTrustAnchor(xmlTextWriterPtr writer) { - if (!context_->manifest_data.get()->pkg_certs_dir || - !context_->manifest_data.get()->use_system_certs) + if (!context_->manifest_data.get()->use_system_certs) return; xmlTextWriterStartElement(writer, BAD_CAST "trust-anchor"); - xmlTextWriterWriteAttribute(writer, BAD_CAST "pkg-certs-dir", - BAD_CAST context_->manifest_data.get()->pkg_certs_dir); - xmlTextWriterWriteAttribute(writer, BAD_CAST "use-system-certs", BAD_CAST context_->manifest_data.get()->use_system_certs); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 3a8956b..130c597 100755 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -80,7 +80,6 @@ #include #include #include -#include #include @@ -233,7 +232,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); @@ -283,7 +283,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -342,7 +343,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -393,7 +395,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -455,7 +458,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); @@ -502,7 +506,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -531,7 +536,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); @@ -564,7 +570,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -609,7 +616,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -640,7 +648,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); @@ -659,7 +668,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); @@ -684,7 +694,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep( + ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); -- 2.7.4 From bfbcb071cd2bfec45d1c83ebab42fd5225c6b104 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 13 Oct 2017 16:54:21 +0900 Subject: [PATCH 08/16] Add smoke test for extended storage installation Change-Id: I4a222b770cffe7a70b69143a4893beb7a38317e3 Signed-off-by: Sangyoon Jang --- src/unit_tests/smoke_test.cc | 12 +++++++- src/unit_tests/smoke_utils.cc | 31 +++++++++++++++++++-- src/unit_tests/smoke_utils.h | 11 +++++++- .../test_samples/smoke/InstallExtendedMode.wgt | Bin 0 -> 37975 bytes 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index b55392a..bf44401 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -571,7 +571,7 @@ TEST_F(SmokeTest, InstallExternalMode) { bf::path path = kSmokePackagesDirectory / "InstallExternalMode.wgt"; std::string pkgid = "smokewgt35"; std::string appid = "smokewgt35.web"; - ASSERT_EQ(InstallExternal(path, PackageType::WGT), + ASSERT_EQ(InstallWithStorage(path, PackageType::WGT, StorageType::EXTERNAL), ci::AppInstaller::Result::OK); ValidateExternalPackage(pkgid, {appid}); } @@ -794,6 +794,16 @@ TEST_F(SmokeTest, SharedRes30HybridDelta) { ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "SHARED-WGT-1")); // NOLINT } +TEST_F(SmokeTest, InstallExtendedMode) { + ASSERT_TRUE(CheckAvailableExtendedStorage()); + bf::path path = kSmokePackagesDirectory / "InstallExtendedMode.wgt"; + std::string pkgid = "smokewgt44"; + std::string appid = "smokewgt44.web"; + ASSERT_EQ(InstallWithStorage(path, PackageType::WGT, StorageType::EXTENDED), + ci::AppInstaller::Result::OK); + ValidatePackage(pkgid, {appid}); +} + } // namespace common_installer int main(int argc, char** argv) { diff --git a/src/unit_tests/smoke_utils.cc b/src/unit_tests/smoke_utils.cc index 41c777d..3730ad0 100644 --- a/src/unit_tests/smoke_utils.cc +++ b/src/unit_tests/smoke_utils.cc @@ -585,13 +585,37 @@ bool CheckAvailableExternalPath() { return true; } -ci::AppInstaller::Result InstallExternal(const bf::path& path, +bool CheckAvailableExtendedStorage() { + bf::path extended_path = bf::path(tzplatform_getenv(TZ_SYS_EXTENDEDSD)); + LOG(DEBUG) << "extended_path :" << extended_path; + // TODO(jeremy.jang): It should be checked by libstorage API. + if (!bf::exists(extended_path)) { + LOG(ERROR) << "Extended storage not exists!"; + return false; + } + return true; +} + +ci::AppInstaller::Result InstallWithStorage(const bf::path& path, PackageType type, + StorageType storage_type, RequestResult mode) { int default_storage = 0; + int storage = 0; + switch (storage_type) { + case StorageType::EXTERNAL: + storage = 1; + break; + case StorageType::EXTENDED: + storage = 2; + break; + default: + LOG(ERROR) << "Unknown storage type"; + break; + } vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, &default_storage); - vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, 1); + vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, storage); const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; ci::AppInstaller::Result result = @@ -607,7 +631,8 @@ ci::AppInstaller::Result MigrateLegacyExternalImage(const std::string& pkgid, const bf::path& legacy_path, PackageType type, RequestResult mode) { - if (InstallExternal(path, type) != ci::AppInstaller::Result::OK) { + if (InstallWithStorage(path, type, StorageType::EXTERNAL) != + ci::AppInstaller::Result::OK) { LOG(ERROR) << "Failed to install application. Cannot perform Migrate"; return ci::AppInstaller::Result::ERROR; } diff --git a/src/unit_tests/smoke_utils.h b/src/unit_tests/smoke_utils.h index b709b19..b87da34 100644 --- a/src/unit_tests/smoke_utils.h +++ b/src/unit_tests/smoke_utils.h @@ -143,6 +143,12 @@ enum class PackageType { HYBRID }; +enum class StorageType { + INTERNAL, + EXTERNAL, + EXTENDED +}; + ci::RequestMode ParseRequestMode(int argc, char** argv); bool TouchFile(const bf::path& path); @@ -226,8 +232,11 @@ ci::AppInstaller::Result InstallPreload(const bf::path& path, PackageType type, bool CheckAvailableExternalPath(); -ci::AppInstaller::Result InstallExternal(const bf::path& path, +bool CheckAvailableExtendedStorage(); + +ci::AppInstaller::Result InstallWithStorage(const bf::path& path, PackageType type, + StorageType storage = StorageType::INTERNAL, RequestResult mode = RequestResult::NORMAL); ci::AppInstaller::Result MigrateLegacyExternalImage(const std::string& pkgid, diff --git a/src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt b/src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt new file mode 100644 index 0000000000000000000000000000000000000000..677b33797466dc7939aa22384ece1e8f20a8ad2d GIT binary patch literal 37975 zcmaI7Q*b8C^EMpYHaFVX*;sdMCmY+gZEkGawr$&X?$~&r-`RKa|GH|XdTOQ*=Bl2q zo`!-nI0Oa=3=9lNoxQ9y$p42h{^Jc?oXzbV>76XhYz>@U98DP9ZLGUB)@wGo(0pFh zAz)9&C7L{~eu0+x)K?8Rw4?@9O>ewR>j^mi^ZKCl@$zI~+D3+w$lz5C8&;;fd-xLz z*Ls<`x1D4L_&ENmzO2|KF((+6Cx0%tCW8qvzzIa2W9hd$JRAIQ>-st7JL~+r&dccc zkPqcW`Av4VxrF?4Tl3hwlFyi8C> z=1UpZZs$1tRMLYX2N^$b>nsuEO-##I8FmYU{|o z+?-q3AXq>kf2LC90cq89^UZqo_UBrDgwtCx8}}9$zCR+?cA(IlBz8hlT)LEhS$p6x z)F|WV8nFy6mXC0)Nbaic*@zxc;N@13y?@}6@M|w1snZT?b?4sD&BlximDD`Aa*Lua z5_z_}gxM5iZL~6vZJS)6#W3_h5BD-Z=H{a-O!q6MMNe;CNMP~`5AAWS9NXVV7z_yh z^-wUKATaG=CJ7;y$+g`U$d47;GLS00!r`!bqum(cG{p(fuO4=t##`;q`S@J&fP?SL z+!380IQU}#JU4D&4(Fcv+k%2%UVeY{))5yRe{~) z$zIQHs{nD5(oWCy``;Lr@SL5;YeEp}QU8I*-Qc5qou3n4)r5~*zLt9s^k}p~b(#{w z1j-<45aB3LsTzRhH)=EV<+n?ARtkUdXZa_MHi1VvIQXx5!45!h+=XqOl~luUEXW&s z(zR3G!0u3RwMbsU8sxtCA8di^-+Ghy?5wT&#&USf$oB;)>!-ofL7guFGw2PP(+ZrJy4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Rm`@G(x#Xpf{bSxAr|aTO za{!{=3~R>u96h+sn_xz6g*}&v`D}nvPPD?Hj9Q{;%2#0(72g&%h8Gw;L{s667rC!| z2|ur29O@7*oLn1>o2OVckCdW&+VpA2$pbJyz)0%#;r@J#|L5Cbkne+8lak%d zuO=Mf_zFvGB*9LCu^jcpsgr`yimrX7^RXs$Vp}yrQe6X)uL|c_k6t~J+EHZYIUet3 zSrpuxI;VIvqt`O8z3T#g9V-%{?2`x-rg!HI9wbPjrA!m=NBH_qg`HZYcoGi-4R3a| z(OwwOV}0x-552)sE|5mOYoVtss76|>XJ!~tWvI*UnAE`a+DL(y3kg+o>B7!lIvfvP z#u5^lgdo~_0>vGMq7zVB4eZqn{dsOS?zpekdxf;^-Nw{dv0Q2w%8N*abD0PSs+d24 zKi6T8wsPKU*rS}VLA@Rq*eHbAh;^*DpRpt)P#1p!8Bn**pUjj5(p|XEmzVX{?rug! z&QE-^t<#GQIEvaCYX3paIV6#wULK_6W(jL>o$5#rJy`96IkL}d zp(nFqxz(^OQVBf^v{2_eULwAPtkPA_NV4#wkm~F6yW2rb({p z;0;VN3^EKnJUomFH!Y3z(2lZGbekT!jSS5;{%O|UUXHFFJpZO3*9_!$58aCfKY?f_ zbAo>UVEq4fA&!rMVe1NY0E7NN+;ulJ`T4`J|EmA2o}k^>dV2ExK2lhUOYR}T8m rflmGe{KfNs$Nl<0T{G0b%|7OLzN)K%bA2HI1|hn*p=URmbp7^!Uz}Wy literal 0 HcmV?d00001 -- 2.7.4 From b6b064851415758a249944812fbc31da76f55401 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 17 Oct 2017 15:56:44 +0900 Subject: [PATCH 09/16] Release version 0.7.4 Changes: - Fix static analysis issue - Change behavior of trust anchor - Add smoke test for extended storage installation Change-Id: I06e50d6cefbe861e59b70145a476dbbd48236f29 Signed-off-by: Junghyun Yeon --- packaging/wgt-backend.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index aaa8808..03eb167 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -1,6 +1,6 @@ Name: wgt-backend Summary: Application installer backend for WGT -Version: 0.7.3 +Version: 0.7.4 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From d89ab97f406c76b2e98542db1b8010d84f692e65 Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Mon, 23 Oct 2017 16:56:34 +0900 Subject: [PATCH 10/16] Add privacy privilege step for hybrid Signed-off-by: Seungha Son Change-Id: Ia90177a7fdcec552183b496e48436b42e947c747 --- src/hybrid/hybrid_installer.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 2a28e39..2df59cc 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -152,6 +153,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -207,6 +210,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -236,6 +241,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Uninstall); AddStep(); AddStep(); AddStep(); @@ -294,6 +301,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep(); AddStep( @@ -362,6 +371,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -416,6 +427,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -449,6 +462,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -485,6 +500,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -507,6 +524,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Install); AddStep(); AddStep( ci::Plugin::ActionType::Install); @@ -534,6 +553,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Update); AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); @@ -557,6 +578,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep( + ci::security::StepPrivacyPrivilege::ActionType::Uninstall); AddStep(); break; } -- 2.7.4 From 21c629b678bc7b10df62772870d4d2f95171a062 Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Tue, 24 Oct 2017 16:19:21 +0900 Subject: [PATCH 11/16] Release version 0.7.5 Changes: - Add privacy privilege step for hybrid Signed-off-by: Seungha Son Change-Id: I741802cbd47ad8c7abc77364c47e444a0504a71e --- packaging/wgt-backend.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index 03eb167..3ecc970 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -1,6 +1,6 @@ Name: wgt-backend Summary: Application installer backend for WGT -Version: 0.7.4 +Version: 0.7.5 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 00e96944e943a5605f28ef919b63006c70fe07bd Mon Sep 17 00:00:00 2001 From: Damian Pietruchowski Date: Wed, 23 Aug 2017 14:01:03 +0200 Subject: [PATCH 12/16] Apply new library for smoke utils Wgt-backend and tpk-backend have common util functions for smoke tests. They should be exported to lib in app-installers. Submit together: - https://review.tizen.org/gerrit/#/c/149136/ - https://review.tizen.org/gerrit/#/c/149601/ Change-Id: I405ee42332bc443fd9749e78008093280f9bbf57 Signed-off-by: Damian Pietruchowski --- packaging/wgt-backend.spec | 1 + src/unit_tests/CMakeLists.txt | 11 +- src/unit_tests/extensive_smoke_test.cc | 352 +++++++------ src/unit_tests/smoke_test.cc | 743 +++++++++++++++------------ src/unit_tests/smoke_utils.cc | 906 +-------------------------------- src/unit_tests/smoke_utils.h | 278 +--------- 6 files changed, 648 insertions(+), 1643 deletions(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index 3ecc970..5725634 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -12,6 +12,7 @@ Source1001: wgt-backend-tests.manifest BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gtest-devel +BuildRequires: app-installers-tests BuildRequires: pkgconfig(app-installers) BuildRequires: pkgconfig(manifest-parser) BuildRequires: pkgconfig(wgt-manifest-handlers) diff --git a/src/unit_tests/CMakeLists.txt b/src/unit_tests/CMakeLists.txt index 6b0aac1..37022f8 100644 --- a/src/unit_tests/CMakeLists.txt +++ b/src/unit_tests/CMakeLists.txt @@ -1,4 +1,5 @@ SET(DESTINATION_DIR wgt-backend-ut) +SET(TARGET_SMOKE_UTILS smoke-utils) # Executables ADD_EXECUTABLE(${TARGET_SMOKE_TEST} @@ -7,9 +8,9 @@ ADD_EXECUTABLE(${TARGET_SMOKE_TEST} smoke_utils.cc ) ADD_EXECUTABLE(${TARGET_SMOKE_TEST_EXTENSIVE} - extensive_smoke_test.cc - smoke_utils.h - smoke_utils.cc + extensive_smoke_test.cc + smoke_utils.h + smoke_utils.cc ) ADD_EXECUTABLE(${TARGET_SMOKE_TEST_HELPER} smoke_test_helper.cc @@ -43,8 +44,8 @@ APPLY_PKG_CONFIG(${TARGET_MANIFEST_TEST} PUBLIC # FindGTest module do not sets all needed libraries in GTEST_LIBRARIES and # GTest main libraries is still missing, so additional linking of # GTEST_MAIN_LIBRARIES is needed. -TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES}) -TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_EXTENSIVE} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES}) +TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES} ${TARGET_SMOKE_UTILS}) +TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_EXTENSIVE} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES} ${TARGET_SMOKE_UTILS}) TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_HELPER} PRIVATE ${TARGET_LIBNAME_WGT}) TARGET_LINK_LIBRARIES(${TARGET_MANIFEST_TEST} PRIVATE ${TARGET_LIBNAME_WGT} ${GTEST_MAIN_LIBRARIES}) diff --git a/src/unit_tests/extensive_smoke_test.cc b/src/unit_tests/extensive_smoke_test.cc index 34104de..ed51023 100644 --- a/src/unit_tests/extensive_smoke_test.cc +++ b/src/unit_tests/extensive_smoke_test.cc @@ -5,14 +5,16 @@ #include #include +#include #include #include #include "unit_tests/smoke_utils.h" +namespace ci = common_installer; -namespace common_installer { +namespace smoke_test { class SmokeEnvironment : public testing::Environment { public: @@ -20,40 +22,70 @@ class SmokeEnvironment : public testing::Environment { request_mode_ = mode; } void SetUp() override { - if (request_mode_ == ci::RequestMode::USER) { - ASSERT_TRUE(AddTestUser(kNormalUserName)); - } else { - kTestUserId = kGlobalUserUid; - kTestGroupId = kGlobalUserGid; - kTestUserIdStr = std::to_string(kTestUserId); - } - backups_ = SetupBackupDirectories(); + if (request_mode_ == ci::RequestMode::USER) + ASSERT_TRUE(AddTestUser(&test_user)); + backups_ = SetupBackupDirectories(test_user.uid); for (auto& path : backups_) - BackupPath(path); + ASSERT_TRUE(BackupPath(path)); } void TearDown() override { ASSERT_TRUE(request_mode_ == ci::RequestMode::GLOBAL || (request_mode_ == ci::RequestMode::USER && - kGlobalUserUid != kTestUserId)); - UninstallAllSmokeApps(request_mode_); + kGlobalUserUid != test_user.uid)); + WgtBackendInterface backend(std::to_string(test_user.uid)); + UninstallAllSmokeApps(request_mode_, test_user.uid, &backend); for (auto& path : backups_) - RestorePath(path); + ASSERT_TRUE(RestorePath(path)); if (request_mode_ == ci::RequestMode::USER) - ASSERT_TRUE(DeleteTestUser(kNormalUserName)); + ASSERT_TRUE(DeleteTestUser()); } + User test_user; private: ci::RequestMode request_mode_; std::vector backups_; }; +} // namespace smoke_test + +namespace { + +testing::Environment *env = nullptr; +void signalHandler(int signum) { + env->TearDown(); + exit(signum); +} + +smoke_test::SmokeEnvironment *dcast(testing::Environment* _env) { + return dynamic_cast(_env); +} + +} // namespace + +namespace smoke_test { + class SmokeTest : public testing::Test { + public: + SmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::WGT, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + WgtBackendInterface backend; + TestParameters params; }; -class PreloadSmokeTest : public testing::Test { - void SetUp() override { - ASSERT_EQ(kGlobalUserUid, kTestUserId); +class HybridSmokeTest : public testing::Test { + public: + HybridSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::HYBRID, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; } + protected: + HybridBackendInterface backend; + TestParameters params; }; TEST_F(SmokeTest, RecoveryMode_ForInstallation) { @@ -61,45 +93,49 @@ TEST_F(SmokeTest, RecoveryMode_ForInstallation) { std::string pkgid = "smokewgt09"; std::string appid = "smokewgt09.RecoveryModeForInstallation"; + std::string test_user_str = std::to_string(params.test_user.uid); std::vector args = - {"", "-i", path.string(), "-u", kTestUserIdStr.c_str()}; - CrashAfterEachStep(args, [=](int step) -> bool { + {"", "-i", path.string(), "-u", test_user_str.c_str()}; + backend.CrashAfterEachStep(&args, [&](int step) -> bool { if (step >= 1) { - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); EXTENDED_ASSERT_FALSE(recovery_file.empty()); - EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT), + EXTENDED_ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } return true; - }); + }, params.pkg_type); } TEST_F(SmokeTest, RecoveryMode_ForUpdate) { bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForUpdate.wgt"; bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForUpdate_2.wgt"; - RemoveAllRecoveryFiles(); - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK); std::string pkgid = "smokewgt10"; std::string appid = "smokewgt10.RecoveryModeForUpdate"; - AddDataFiles(pkgid, kTestUserId); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); std::vector args = - {"", "-i", path_new.string(), "-u", kTestUserIdStr.c_str()}; - CrashAfterEachStep(args, [=](int step) -> bool { + {"", "-i", path_new.string(), "-u", test_user_str.c_str()}; + backend.CrashAfterEachStep(&args, [&](int step) -> bool { if (step >= 1) { - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); EXTENDED_ASSERT_FALSE(recovery_file.empty()); - EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT), + EXTENDED_ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "res/wgt/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } return true; - }); + }, params.pkg_type); } TEST_F(SmokeTest, RecoveryMode_ForDelta) { @@ -107,44 +143,48 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) { bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta"; std::string pkgid = "smokewgt30"; std::string appid = "smokewgt30.RecoveryModeForDelta"; - RemoveAllRecoveryFiles(); - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); std::vector args = - {"", "-i", path_new.string(), "-u", kTestUserIdStr.c_str()}; - CrashAfterEachStep(args, [=](int step) -> bool { + {"", "-i", path_new.string(), "-u", test_user_str.c_str()}; + backend.CrashAfterEachStep(&args, [&](int step) -> bool { if (step >= 1) { - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); EXTENDED_ASSERT_FALSE(recovery_file.empty()); - EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT), + EXTENDED_ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "res/wgt/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } return true; - }); + }, params.pkg_type); } TEST_F(SmokeTest, RecoveryMode_ForMountInstall) { bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.wgt"; std::string pkgid = "smokewgt31"; std::string appid = "smokewgt31.RecoveryModeForMountInstall"; - RemoveAllRecoveryFiles(); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); std::vector args = - {"", "-w", path.string(), "-u", kTestUserIdStr.c_str()}; - CrashAfterEachStep(args, [=](int step) -> bool { + {"", "-w", path.string(), "-u", test_user_str.c_str()}; + backend.CrashAfterEachStep(&args, [&](int step) -> bool { if (step >= 1) { - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); EXTENDED_ASSERT_FALSE(recovery_file.empty()); - EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT), + EXTENDED_ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } return true; - }); + }, params.pkg_type); } TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) { @@ -154,31 +194,33 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) { kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate_2.wgt"; std::string pkgid = "smokewgt32"; std::string appid = "smokewgt32.RecoveryModeForMountUpdate"; - RemoveAllRecoveryFiles(); - ASSERT_EQ(MountInstall(path_old, PackageType::WGT), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.MountInstall(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); std::vector args = - {"", "-w", path_new.string(), "-u", kTestUserIdStr.c_str()}; - CrashAfterEachStep(args, [=](int step) -> bool { + {"", "-w", path_new.string(), "-u", test_user_str.c_str()}; + backend.CrashAfterEachStep(&args, [&](int step) -> bool { if (step >= 1) { // Filesystem may be mounted after crash - ScopedTzipInterface poweroff_unmount_interface(pkgid); + ScopedTzipInterface poweroff_unmount_interface(pkgid, + params.test_user.uid); poweroff_unmount_interface.Release(); - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); EXTENDED_ASSERT_FALSE(recovery_file.empty()); - EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT), + EXTENDED_ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage( - pkgid, "res/wgt/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + pkgid, "res/wgt/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } return true; - }); + }, params.pkg_type); } @@ -187,11 +229,10 @@ TEST_F(SmokeTest, InstallationMode_Rollback) { std::string pkgid = "smokewgt06"; std::string appid = "smokewgt06.InstallationModeRollback"; - const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_EQ(Install(path, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + std::string test_user_str = std::to_string(params.test_user.uid); + const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); return true; }); } @@ -201,18 +242,17 @@ TEST_F(SmokeTest, UpdateMode_Rollback) { bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_2.wgt"; std::string pkgid = "smokewgt07"; std::string appid = "smokewgt07.UpdateModeRollback"; - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); const char* argv[] = - {"", "-i", path_new.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_EQ(Install(path_new, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + {"", "-i", path_new.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "res/wgt/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); return true; }); } @@ -222,119 +262,123 @@ TEST_F(SmokeTest, DeltaMode_Rollback) { bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback.delta"; std::string pkgid = "smokewgt01"; std::string appid = "smokewgt01.DeltaMode"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); const char* argv[] = - {"", "-i", delta_package.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + {"", "-i", delta_package.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", - "version 1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); - EXTENDED_ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / - "res/wgt/DELETED")); - EXTENDED_ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / - "res/wgt/ADDED")); + "version 1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); + EXTENDED_ASSERT_TRUE(bf::exists(GetPackageRoot( + pkgid, params.test_user.uid) / "res/wgt/DELETED")); + EXTENDED_ASSERT_FALSE(bf::exists(GetPackageRoot( + pkgid, params.test_user.uid) / "res/wgt/ADDED")); return true; }); } -TEST_F(SmokeTest, InstallationMode_Rollback_Hybrid) { +TEST_F(HybridSmokeTest, InstallationMode_Rollback) { bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback_Hybrid.wgt"; std::string pkgid = "smokehyb07"; std::string appid1 = "smokehyb07.web"; - const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid1})); + std::string test_user_str = std::to_string(params.test_user.uid); + const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); return true; - }, PackageType::HYBRID); + }); } -TEST_F(SmokeTest, UpdateMode_Rollback_Hybrid) { +TEST_F(HybridSmokeTest, UpdateMode_Rollback) { bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Rollback_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_Hybrid_2.wgt"; std::string pkgid = "smokehyb08"; std::string appid1 = "smokehyb08.web"; - ASSERT_EQ(Install(path_old, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); const char* argv[] = - {"", "-i", path_new.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + {"", "-i", path_new.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); + "res/wgt/VERSION", "1\n", params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "lib/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "lib/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); return true; - }, PackageType::HYBRID); + }); } -TEST_F(SmokeTest, DeltaMode_Rollback_Hybrid) { +TEST_F(HybridSmokeTest, DeltaMode_Rollback_Hybrid) { bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.wgt"; bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.delta"; std::string pkgid = "smokehyb11"; std::string appid1 = "smokehyb11.web"; - ASSERT_EQ(Install(path, PackageType::HYBRID), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); + const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); // Check delta modifications - bf::path root_path = GetPackageRoot(pkgid, kTestUserId); + bf::path root_path = GetPackageRoot(pkgid, params.test_user.uid); EXTENDED_ASSERT_TRUE(bf::exists(root_path / "res" / "wgt" / "DELETED")); EXTENDED_ASSERT_FALSE(bf::exists(root_path / "res" / "wgt" / "ADDED")); EXTENDED_ASSERT_TRUE(bf::exists(root_path / "lib" / "DELETED")); EXTENDED_ASSERT_FALSE(bf::exists(root_path / "lib" / "ADDED")); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", - "version 1\n")); + "version 1\n", params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", - "version 1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "version 1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); return true; }); } -TEST_F(SmokeTest, MountInstallationMode_Rollback_Hybrid) { +TEST_F(HybridSmokeTest, MountInstallationMode_Rollback) { bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Rollback_Hybrid.wgt"; std::string pkgid = "smokehyb09"; std::string appid1 = "smokehyb09.web"; - const char* argv[] = {"", "-w", path.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - ScopedTzipInterface interface(pkgid); - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid1})); + std::string test_user_str = std::to_string(params.test_user.uid); + const char* argv[] = {"", "-w", path.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + ScopedTzipInterface interface(pkgid, params.test_user.uid); + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); return true; - }, PackageType::HYBRID); + }); } -TEST_F(SmokeTest, MountUpdateMode_Rollback_Hybrid) { +TEST_F(HybridSmokeTest, MountUpdateMode_Rollback) { bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Rollback_Hybrid_2.wgt"; std::string pkgid = "smokehyb10"; std::string appid1 = "smokehyb10.web"; - ASSERT_EQ(MountInstall(path_old, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + ASSERT_EQ(backend.MountInstall(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); const char* argv[] = - {"", "-w", path_new.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - ScopedTzipInterface interface(pkgid); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + {"", "-w", path_new.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + ScopedTzipInterface interface(pkgid, params.test_user.uid); + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); + "res/wgt/VERSION", "1\n", params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "lib/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "lib/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); return true; }); } @@ -344,10 +388,11 @@ TEST_F(SmokeTest, MountInstallationMode_Rollback) { kSmokePackagesDirectory / "MountInstallationMode_Rollback.wgt"; std::string pkgid = "smokewgt33"; std::string appid = "smokewgt33.web"; - const char* argv[] = {"", "-w", path.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - ScopedTzipInterface interface(pkgid); - EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + std::string test_user_str = std::to_string(params.test_user.uid); + const char* argv[] = {"", "-w", path.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { + ScopedTzipInterface interface(pkgid, params.test_user.uid); + EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); return true; }); } @@ -358,36 +403,35 @@ TEST_F(SmokeTest, MountUpdateMode_Rollback) { kSmokePackagesDirectory / "MountUpdateMode_Rollback_2.wgt"; std::string pkgid = "smokewgt34"; std::string appid = "smokewgt34.web"; - ASSERT_EQ(MountInstall(path_old, PackageType::WGT), + ASSERT_EQ(backend.MountInstall(path_old), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); + AddDataFiles(pkgid, params.test_user.uid); + std::string test_user_str = std::to_string(params.test_user.uid); const char* argv[] = - {"", "-w", path_new.c_str(), "-u", kTestUserIdStr.c_str()}; - TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool { - EXTENDED_ASSERT_EQ(MountInstall(path_new, PackageType::WGT, - RequestResult::FAIL), ci::AppInstaller::Result::ERROR); - ScopedTzipInterface interface(pkgid); - EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + {"", "-w", path_new.c_str(), "-u", test_user_str.c_str()}; + backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool { + ScopedTzipInterface interface(pkgid, params.test_user.uid); + EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, - "res/wgt/VERSION", "1\n")); - EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "res/wgt/VERSION", "1\n", params)); + EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); return true; }); } -} // namespace common_installer +} // namespace smoke_test int main(int argc, char** argv) { - ci::RequestMode request_mode = ParseRequestMode(argc, argv); + ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv); if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) { std::cout << "Skip tests for preload request" << std::endl; ::testing::GTEST_FLAG(filter) = "SmokeTest.*"; } testing::InitGoogleTest(&argc, argv); - env = testing::AddGlobalTestEnvironment( - new common_installer::SmokeEnvironment(request_mode)); - signal(SIGINT, signalHandler); - signal(SIGSEGV, signalHandler); + ::env = testing::AddGlobalTestEnvironment( + new smoke_test::SmokeEnvironment(request_mode)); + signal(SIGINT, ::signalHandler); + signal(SIGSEGV, ::signalHandler); return RUN_ALL_TESTS(); } diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index bf44401..a16c667 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -2,15 +2,24 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. +#include + #include #include +#include +#include -#include +#include #include "unit_tests/smoke_utils.h" +namespace st = smoke_test; +namespace bf = boost::filesystem; +namespace bs = boost::system; +namespace ci = common_installer; +namespace bo = boost::program_options; -namespace common_installer { +namespace smoke_test { class SmokeEnvironment : public testing::Environment { public: @@ -18,48 +27,126 @@ class SmokeEnvironment : public testing::Environment { request_mode_ = mode; } void SetUp() override { - if (request_mode_ == ci::RequestMode::USER) { - ASSERT_TRUE(AddTestUser(kNormalUserName)); - } else { - kTestUserId = kGlobalUserUid; - kTestGroupId = kGlobalUserGid; - kTestUserIdStr = std::to_string(kTestUserId); - } - backups_ = SetupBackupDirectories(); + if (request_mode_ == ci::RequestMode::USER) + ASSERT_TRUE(AddTestUser(&test_user)); + backups_ = SetupBackupDirectories(test_user.uid); for (auto& path : backups_) ASSERT_TRUE(BackupPath(path)); } void TearDown() override { ASSERT_TRUE(request_mode_ == ci::RequestMode::GLOBAL || (request_mode_ == ci::RequestMode::USER && - kGlobalUserUid != kTestUserId)); - UninstallAllSmokeApps(request_mode_); + kGlobalUserUid != test_user.uid)); + WgtBackendInterface backend(std::to_string(test_user.uid)); + UninstallAllSmokeApps(request_mode_, test_user.uid, &backend); for (auto& path : backups_) ASSERT_TRUE(RestorePath(path)); if (request_mode_ == ci::RequestMode::USER) - ASSERT_TRUE(DeleteTestUser(kNormalUserName)); + ASSERT_TRUE(DeleteTestUser()); } + User test_user; private: ci::RequestMode request_mode_; std::vector backups_; }; +} // namespace smoke_test + +namespace { + +testing::Environment *env = nullptr; +void signalHandler(int signum) { + env->TearDown(); + exit(signum); +} + +smoke_test::SmokeEnvironment *dcast(testing::Environment* _env) { + return dynamic_cast(_env); +} + +} // namespace + +namespace smoke_test { + class SmokeTest : public testing::Test { + public: + SmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::WGT, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + WgtBackendInterface backend; + TestParameters params; +}; + +class RollbackSmokeTest : public testing::Test { + public: + RollbackSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid), + RequestResult::FAIL), params{PackageType::WGT, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + WgtBackendInterface backend; + TestParameters params; +}; + +class HybridSmokeTest : public testing::Test { + public: + HybridSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::HYBRID, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + HybridBackendInterface backend; + TestParameters params; +}; + +class RollbackHybridSmokeTest : public testing::Test { + public: + RollbackHybridSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid), + RequestResult::FAIL), params{PackageType::HYBRID, false} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + HybridBackendInterface backend; + TestParameters params; }; class PreloadSmokeTest : public testing::Test { - void SetUp() override { - ASSERT_EQ(kGlobalUserUid, kTestUserId); + public: + PreloadSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::WGT, true} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; } + protected: + WgtBackendInterface backend; + TestParameters params; +}; + +class HybridPreloadSmokeTest : public testing::Test { + public: + HybridPreloadSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)), + params{PackageType::HYBRID, true} { + params.test_user.uid = dcast(env)->test_user.uid; + params.test_user.gid = dcast(env)->test_user.gid; + } + protected: + HybridBackendInterface backend; + TestParameters params; }; TEST_F(SmokeTest, InstallationMode) { bf::path path = kSmokePackagesDirectory / "InstallationMode.wgt"; std::string pkgid = "smokewgt03"; std::string appid = "smokewgt03.InstallationMode"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(SmokeTest, UpdateMode) { @@ -67,24 +154,23 @@ TEST_F(SmokeTest, UpdateMode) { bf::path path_new = kSmokePackagesDirectory / "UpdateMode_2.wgt"; std::string pkgid = "smokewgt04"; std::string appid = "smokewgt04.UpdateMode"; - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(path_new, PackageType::WGT), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } TEST_F(SmokeTest, DeinstallationMode) { bf::path path = kSmokePackagesDirectory / "DeinstallationMode.wgt"; std::string pkgid = "smokewgt05"; std::string appid = "smokewgt05.DeinstallationMode"; - ASSERT_EQ(Install(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(Uninstall(pkgid, PackageType::WGT, false), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } TEST_F(SmokeTest, RDSMode) { @@ -93,47 +179,43 @@ TEST_F(SmokeTest, RDSMode) { std::string appid = "smokewgt11.RDSMode"; bf::path delta_directory = kSmokePackagesDirectory / "delta_dir/"; bf::path sdk_expected_directory = - bf::path(ci::GetRootAppPath(false, kTestUserId)) / "tmp" / pkgid; + bf::path(ci::GetRootAppPath(false, params.test_user.uid)) / "tmp" / pkgid; bs::error_code error; bf::create_directories(sdk_expected_directory.parent_path(), error); ASSERT_FALSE(error); - ASSERT_TRUE(CopyDir(delta_directory, sdk_expected_directory)); - ASSERT_EQ(RDSUpdate(path, pkgid, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ci::CopyDir(delta_directory, sdk_expected_directory)); + ASSERT_EQ(backend.RDSUpdate(path, pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); // Check delta modifications - ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "DELETED")); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "ADDED")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "2\n")); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "2\n", + params)); } TEST_F(SmokeTest, EnablePkg) { bf::path path = kSmokePackagesDirectory / "EnablePkg.wgt"; std::string pkgid = "smokewgt22"; - ASSERT_EQ(Install(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(DisablePackage(pkgid, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(EnablePackage(pkgid, PackageType::WGT), - ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.EnablePackage(pkgid), ci::AppInstaller::Result::OK); - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - ASSERT_TRUE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId))); + ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid); + ASSERT_TRUE(pkg_query.IsPackageInstalled( + ci::GetRequestMode(params.test_user.uid))); } TEST_F(SmokeTest, DisablePkg) { bf::path path = kSmokePackagesDirectory / "DisablePkg.wgt"; std::string pkgid = "smokewgt21"; std::string appid = "smokewgt21.DisablePkg"; - ASSERT_EQ(Install(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(DisablePackage(pkgid, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ci::QueryIsDisabledPackage(pkgid, kTestUserId)); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ci::QueryIsDisabledPackage(pkgid, params.test_user.uid)); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(SmokeTest, DeltaMode) { @@ -141,96 +223,102 @@ TEST_F(SmokeTest, DeltaMode) { bf::path delta_package = kSmokePackagesDirectory / "DeltaMode.delta"; std::string pkgid = "smokewgt17"; std::string appid = "smokewgt17.DeltaMode"; - ASSERT_EQ(DeltaInstall(path, delta_package, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); // Check delta modifications - ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "DELETED")); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "ADDED")); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "css" / "style.css")); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "images" / "tizen_32.png")); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "js" / "main.js")); ASSERT_TRUE(ValidateFileContentInPackage( - pkgid, "res/wgt/MODIFIED", "version 2\n")); + pkgid, "res/wgt/MODIFIED", "version 2\n", params)); } TEST_F(SmokeTest, RecoveryMode_ForInstallation) { bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForInstallation.wgt"; - Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); - backend_crash.Run("-i", path.string(), "-u", kTestUserIdStr.c_str()); + ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); + std::string test_uid_str = std::to_string(params.test_user.uid); + backend_crash.Run("-i", path.string(), "-u", test_uid_str.c_str()); ASSERT_NE(backend_crash.Wait(), 0); std::string pkgid = "smokewgt09"; std::string appid = "smokewgt09.RecoveryModeForInstallation"; - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); ASSERT_FALSE(recovery_file.empty()); - ASSERT_EQ(Recover(recovery_file, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } TEST_F(SmokeTest, RecoveryMode_ForUpdate) { bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForUpdate.wgt"; bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForUpdate_2.wgt"; - RemoveAllRecoveryFiles(); - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); std::string pkgid = "smokewgt10"; std::string appid = "smokewgt10.RecoveryModeForUpdate"; - AddDataFiles(pkgid, kTestUserId); - Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); - backend_crash.Run("-i", path_new.string(), "-u", kTestUserIdStr.c_str()); + AddDataFiles(pkgid, params.test_user.uid); + ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); + std::string test_uid_str = std::to_string(params.test_user.uid); + backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str()); ASSERT_NE(backend_crash.Wait(), 0); - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); ASSERT_FALSE(recovery_file.empty()); - ASSERT_EQ(Recover(recovery_file, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } 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()); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); + ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); + std::string test_uid_str = std::to_string(params.test_user.uid); + backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str()); ASSERT_NE(backend_crash.Wait(), 0); std::string pkgid = "smokewgt30"; std::string appid = "smokewgt30.RecoveryModeForDelta"; - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); ASSERT_FALSE(recovery_file.empty()); - ASSERT_EQ(Recover(recovery_file, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); } TEST_F(SmokeTest, RecoveryMode_ForMountInstall) { bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.wgt"; - RemoveAllRecoveryFiles(); - Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); - backend_crash.Run("-w", path.string(), "-u", kTestUserIdStr.c_str()); + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); + std::string test_uid_str = std::to_string(params.test_user.uid); + backend_crash.Run("-w", path.string(), "-u", test_uid_str.c_str()); ASSERT_NE(backend_crash.Wait(), 0); std::string pkgid = "smokewgt31"; std::string appid = "smokewgt31.RecoveryModeForMountInstall"; - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); ASSERT_FALSE(recovery_file.empty()); - ASSERT_EQ(Recover(recovery_file, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) { @@ -240,134 +328,131 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) { kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate_2.wgt"; std::string pkgid = "smokewgt32"; std::string appid = "smokewgt32.RecoveryModeForMountUpdate"; - RemoveAllRecoveryFiles(); - ASSERT_EQ(MountInstall(path_old, PackageType::WGT), + RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid); + ASSERT_EQ(backend.MountInstallSuccess(path_old), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); - backend_crash.Run("-w", path_new.string(), "-u", kTestUserIdStr.c_str()); + AddDataFiles(pkgid, params.test_user.uid); + ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); + std::string test_uid_str = std::to_string(params.test_user.uid); + backend_crash.Run("-w", path_new.string(), "-u", test_uid_str.c_str()); ASSERT_NE(backend_crash.Wait(), 0); // Filesystem may be mounted after crash - ScopedTzipInterface poweroff_unmount_interface(pkgid); + ScopedTzipInterface poweroff_unmount_interface(pkgid, params.test_user.uid); poweroff_unmount_interface.Release(); - bf::path recovery_file = FindRecoveryFile(); + bf::path recovery_file = FindRecoveryFile("/wgt-recovery", + params.test_user.uid); ASSERT_FALSE(recovery_file.empty()); - ASSERT_EQ(Recover(recovery_file, PackageType::WGT), - ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } TEST_F(SmokeTest, InstallationMode_GoodSignature) { // pkgid: smokewgt08 bf::path path = kSmokePackagesDirectory / "InstallationMode_GoodSignature.wgt"; // NOLINT - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); } TEST_F(SmokeTest, InstallationMode_WrongSignature) { // pkgid: smokewgt12 bf::path path = kSmokePackagesDirectory / "InstallationMode_WrongSignature.wgt"; // NOLINT - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::ERROR); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR); } -TEST_F(SmokeTest, InstallationMode_Rollback) { +TEST_F(RollbackSmokeTest, InstallationMode) { bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.wgt"; std::string pkgid = "smokewgt06"; std::string appid = "smokewgt06.InstallationModeRollback"; - ASSERT_EQ(Install(path, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } -TEST_F(SmokeTest, UpdateMode_Rollback) { +TEST_F(RollbackSmokeTest, UpdateMode) { bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Rollback.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_2.wgt"; std::string pkgid = "smokewgt07"; std::string appid = "smokewgt07.UpdateModeRollback"; - ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(path_new, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::ERROR); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(SmokeTest, DeltaMode_Rollback) { +TEST_F(RollbackSmokeTest, DeltaMode) { bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback.wgt"; bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback.delta"; std::string pkgid = "smokewgt01"; std::string appid = "smokewgt01.DeltaMode"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(delta_package, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", - "version 1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); - ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + "version 1\n", params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); + ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res/wgt/DELETED")); - ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, kTestUserId) / + ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res/wgt/ADDED")); } -TEST_F(SmokeTest, InstallationMode_Hybrid) { +TEST_F(HybridSmokeTest, InstallationMode) { bf::path path = kSmokePackagesDirectory / "InstallationMode_Hybrid.wgt"; std::string pkgid = "smokehyb01"; // Excutable for native app doesn't create symlink std::string appid1 = "smokehyb01.Web"; - ASSERT_EQ(Install(path, PackageType::HYBRID), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); } -TEST_F(SmokeTest, UpdateMode_Hybrid) { +TEST_F(HybridSmokeTest, UpdateMode) { bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Hybrid_2.wgt"; std::string pkgid = "smokehyb02"; std::string appid1 = "smokehyb02.Web"; - ASSERT_EQ(Install(path_old, PackageType::HYBRID), - ci::AppInstaller::Result::OK); -// AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(path_new, PackageType::HYBRID), + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "2\n")); -// ValidateDataFiles(pkgid, kTestUserId); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n", + params)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "2\n", params)); + ValidateDataFiles(pkgid, params.test_user.uid); } -TEST_F(SmokeTest, DeinstallationMode_Hybrid) { +TEST_F(HybridSmokeTest, DeinstallationMode) { bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Hybrid.wgt"; std::string pkgid = "smokehyb03"; std::string appid1 = "smokehyb03.Web"; - ASSERT_EQ(Install(path, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ASSERT_EQ(Uninstall(pkgid, PackageType::HYBRID, false), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid1})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } -TEST_F(SmokeTest, DeltaMode_Hybrid) { +TEST_F(HybridSmokeTest, DeltaMode) { bf::path path = kSmokePackagesDirectory / "DeltaMode_Hybrid.wgt"; bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Hybrid.delta"; std::string pkgid = "smokehyb04"; std::string appid1 = "smokehyb04.Web"; - ASSERT_EQ(DeltaInstall(path, delta_package, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); // Check delta modifications - bf::path root_path = ci::GetRootAppPath(false, - kTestUserId); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "wgt" / "DELETED")); ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "ADDED")); ASSERT_FALSE(bf::exists(root_path / pkgid / "lib" / "DELETED")); @@ -375,130 +460,129 @@ TEST_F(SmokeTest, DeltaMode_Hybrid) { ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "css" / "style.css")); // NOLINT ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "images" / "tizen_32.png")); // NOLINT ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "js" / "main.js")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "version 2\n")); // NOLINT - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", "version 2\n")); // NOLINT + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "version 2\n", params)); // NOLINT + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", "version 2\n", params)); // NOLINT } -TEST_F(SmokeTest, MountInstallationMode_Hybrid) { +TEST_F(HybridSmokeTest, MountInstallationMode) { bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Hybrid.wgt"; std::string pkgid = "smokehyb05"; std::string appid1 = "smokehyb05.web"; - ASSERT_EQ(MountInstall(path, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); } -TEST_F(SmokeTest, MountUpdateMode_Hybrid) { +TEST_F(HybridSmokeTest, MountUpdateMode) { bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Hybrid_2.wgt"; std::string pkgid = "smokehyb06"; std::string appid1 = "smokehyb06.web"; - ASSERT_EQ(MountInstall(path_old, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(MountInstall(path_new, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.MountInstallSuccess(path_old), + ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::OK); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "2\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n", + params)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "2\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(SmokeTest, InstallationMode_Rollback_Hybrid) { +TEST_F(RollbackHybridSmokeTest, InstallationMode) { bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback_Hybrid.wgt"; std::string pkgid = "smokehyb07"; std::string appid1 = "smokehyb07.web"; - ASSERT_EQ(Install(path, PackageType::HYBRID, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid1})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } -TEST_F(SmokeTest, UpdateMode_Rollback_Hybrid) { +TEST_F(RollbackHybridSmokeTest, UpdateMode) { bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Rollback_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_Hybrid_2.wgt"; std::string pkgid = "smokehyb08"; std::string appid1 = "smokehyb08.web"; - ASSERT_EQ(Install(path_old, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(path_new, PackageType::HYBRID, - RequestResult::FAIL), ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::ERROR); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(SmokeTest, DeltaMode_Rollback_Hybrid) { +TEST_F(RollbackHybridSmokeTest, DeltaMode) { bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.wgt"; bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.delta"; std::string pkgid = "smokehyb11"; std::string appid1 = "smokehyb11.web"; - ASSERT_EQ(Install(path, PackageType::HYBRID), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(Install(delta_package, PackageType::HYBRID, RequestResult::FAIL), + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::ERROR); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); // Check delta modifications - bf::path root_path = GetPackageRoot(pkgid, kTestUserId); + bf::path root_path = GetPackageRoot(pkgid, params.test_user.uid); ASSERT_TRUE(bf::exists(root_path / "res" / "wgt" / "DELETED")); ASSERT_FALSE(bf::exists(root_path / "res" / "wgt" / "ADDED")); ASSERT_TRUE(bf::exists(root_path / "lib" / "DELETED")); ASSERT_FALSE(bf::exists(root_path / "lib" / "ADDED")); ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", - "version 1\n")); + "version 1\n", params)); ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", - "version 1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + "version 1\n", params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(SmokeTest, MountInstallationMode_Rollback_Hybrid) { +TEST_F(RollbackHybridSmokeTest, MountInstallationMode) { bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Rollback_Hybrid.wgt"; std::string pkgid = "smokehyb09"; std::string appid1 = "smokehyb09.web"; - ASSERT_EQ(MountInstall(path, PackageType::HYBRID, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid1})); + ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::ERROR); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } -TEST_F(SmokeTest, MountUpdateMode_Rollback_Hybrid) { +TEST_F(RollbackHybridSmokeTest, MountUpdateMode) { bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback_Hybrid.wgt"; bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Rollback_Hybrid_2.wgt"; std::string pkgid = "smokehyb10"; std::string appid1 = "smokehyb10.web"; - ASSERT_EQ(MountInstall(path_old, PackageType::HYBRID), + ASSERT_EQ(backend.MountInstallSuccess(path_old), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(MountInstall(path_new, PackageType::HYBRID, - RequestResult::FAIL), ci::AppInstaller::Result::ERROR); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1})); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::ERROR); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } TEST_F(SmokeTest, MountInstallationMode) { bf::path path = kSmokePackagesDirectory / "MountInstallationMode.wgt"; std::string pkgid = "smokewgt28"; std::string appid = "smokewgt28.InstallationMode"; - ASSERT_EQ(MountInstall(path, PackageType::WGT), ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(SmokeTest, MountUpdateMode) { @@ -506,45 +590,44 @@ TEST_F(SmokeTest, MountUpdateMode) { bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_2.wgt"; std::string pkgid = "smokewgt29"; std::string appid = "smokewgt29.UpdateMode"; - ASSERT_EQ(MountInstall(path_old, PackageType::WGT), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(MountInstall(path_new, PackageType::WGT), - ci::AppInstaller::Result::OK); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.MountInstallSuccess(path_old), + ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::OK); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(SmokeTest, MountInstallationMode_Rollback) { +TEST_F(RollbackSmokeTest, MountInstallationMode) { bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Rollback.wgt"; std::string pkgid = "smokewgt33"; std::string appid = "smokewgt33.web"; - ASSERT_EQ(MountInstall(path, PackageType::WGT, RequestResult::FAIL), - ci::AppInstaller::Result::ERROR); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(CheckPackageNonExistance(pkgid, {appid})); + ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::ERROR); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(CheckPackageNonExistance(pkgid, params)); } -TEST_F(SmokeTest, MountUpdateMode_Rollback) { +TEST_F(RollbackSmokeTest, MountUpdateMode) { bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback.wgt"; bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Rollback_2.wgt"; std::string pkgid = "smokewgt34"; std::string appid = "smokewgt34.web"; - ASSERT_EQ(MountInstall(path_old, PackageType::WGT), + ASSERT_EQ(backend.MountInstallSuccess(path_old), ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(MountInstall(path_new, PackageType::WGT, - RequestResult::FAIL), ci::AppInstaller::Result::ERROR); - ScopedTzipInterface interface(pkgid); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::ERROR); + ScopedTzipInterface interface(pkgid, params.test_user.uid); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n")); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n", + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } TEST_F(SmokeTest, UserDefinedPlugins) { @@ -555,10 +638,10 @@ TEST_F(SmokeTest, UserDefinedPlugins) { std::string location_privilege = "http://tizen.org/privilege/location"; std::string power_privilege = "http://tizen.org/privilege/power"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); std::vector res; - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); + ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid); ASSERT_TRUE(pkg_query.PrivilegesForPkgId(&res)); ASSERT_TRUE(std::find(res.begin(), res.end(), call_privilege) != res.end()); ASSERT_TRUE(std::find(res.begin(), res.end(), location_privilege) @@ -571,9 +654,9 @@ TEST_F(SmokeTest, InstallExternalMode) { bf::path path = kSmokePackagesDirectory / "InstallExternalMode.wgt"; std::string pkgid = "smokewgt35"; std::string appid = "smokewgt35.web"; - ASSERT_EQ(InstallWithStorage(path, PackageType::WGT, StorageType::EXTERNAL), + ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTERNAL), ci::AppInstaller::Result::OK); - ValidateExternalPackage(pkgid, {appid}); + ValidateExternalPackage(pkgid, {appid}, params); } TEST_F(SmokeTest, MigrateLegacyExternalImageMode) { @@ -583,69 +666,67 @@ TEST_F(SmokeTest, MigrateLegacyExternalImageMode) { std::string pkgid = "smokewgt36"; std::string appid = "smokewgt36.web"; bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir; - if (kTestUserIdStr == kDefaultUserIdStr || kTestUserId == kGlobalUserUid) { - ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path, - PackageType::WGT), ci::AppInstaller::Result::OK); - ValidateExternalPackage(pkgid, {appid}); + std::string test_uid_str = std::to_string(params.test_user.uid); + if (test_uid_str == kDefaultUserIdStr || + params.test_user.uid == kGlobalUserUid) { + ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path), + ci::AppInstaller::Result::OK); + ValidateExternalPackage(pkgid, {appid}, params); } else { - ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path, - PackageType::WGT), ci::AppInstaller::Result::ERROR); + ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path), + ci::AppInstaller::Result::ERROR); } } -TEST_F(PreloadSmokeTest, InstallationMode_Preload) { +TEST_F(PreloadSmokeTest, InstallationMode) { ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.wgt"; std::string pkgid = "smokewgt37"; std::string appid = "smokewgt37.InstallationModePreload"; - ASSERT_EQ(InstallPreload(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid}, true)); + ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } -TEST_F(PreloadSmokeTest, UpdateMode_Preload) { +TEST_F(PreloadSmokeTest, UpdateMode) { ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.wgt"; std::string pkgid = "smokewgt38"; std::string appid = "smokewgt38.UpdateModePreload"; - ASSERT_EQ(InstallPreload(path_old, PackageType::WGT), - ci::AppInstaller::Result::OK); - AddDataFiles(pkgid, kTestUserId); - ASSERT_EQ(InstallPreload(path_new, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid}, true)); + ASSERT_EQ(backend.InstallPreload(path_old), ci::AppInstaller::Result::OK); + AddDataFiles(pkgid, params.test_user.uid); + ASSERT_EQ(backend.InstallPreload(path_new), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2", - true)); - ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId)); + params)); + ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid)); } -TEST_F(PreloadSmokeTest, DeinstallationMode_Preload) { +TEST_F(PreloadSmokeTest, DeinstallationMode) { ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.wgt"; std::string pkgid = "smokewgt39"; std::string appid = "smokewgt39.DeinstallationModePreload"; - ASSERT_EQ(InstallPreload(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(Uninstall(pkgid, PackageType::WGT, true), - ci::AppInstaller::Result::OK); - CheckPackageReadonlyNonExistance(pkgid, {appid}); + ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.UninstallPreload(pkgid), ci::AppInstaller::Result::OK); + CheckPackageReadonlyNonExistance(pkgid, params); } -TEST_F(PreloadSmokeTest, ManifestDirectInstallMode) { +TEST_F(SmokeTest, ManifestDirectInstallMode) { ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode"; std::string pkgid = "smokewgt40"; std::string appid = "smokewgt40.ManifestDirectInstallMode"; - bf::path pkg_path = ci::GetRootAppPath(false, kTestUserId); + bf::path pkg_path = ci::GetRootAppPath(false, params.test_user.uid); - CopyDir(src_path / pkgid, pkg_path / pkgid); - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId))); - ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::WGT), + ci::CopyDir(src_path / pkgid, pkg_path / pkgid); + ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid); + ASSERT_FALSE(pkg_query.IsPackageInstalled( + ci::GetRequestMode(params.test_user.uid))); + ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(SmokeTest, ManifestDirectUpdateMode) { @@ -653,13 +734,14 @@ TEST_F(SmokeTest, ManifestDirectUpdateMode) { std::string pkgid = "smokewgt41"; std::string appid = "smokewgt41.ManifestDirectUpdateMode"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - int install_time = GetAppInstalledTime(appid.c_str(), kTestUserId); - ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::WGT), + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid); + ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK); - ASSERT_TRUE(GetAppInstalledTime(appid.c_str(), kTestUserId) > install_time) + ASSERT_TRUE(GetAppInstalledTime(appid.c_str(), + params.test_user.uid) > install_time) << "Package is not updated (app installed time didn't change)."; - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(PreloadSmokeTest, ReadonlyUpdateInstallMode) { @@ -668,12 +750,9 @@ TEST_F(PreloadSmokeTest, ReadonlyUpdateInstallMode) { std::string pkgid = "smokewgt42"; std::string appid = "smokewgt42.ReadonlyUpdateInstallMode"; - ASSERT_EQ(InstallPreload(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(Install(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); - ASSERT_TRUE(ValidatePackage(pkgid, {appid}, true)); + ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(PreloadSmokeTest, ReadonlyUpdateUninstallMode) { @@ -682,55 +761,53 @@ TEST_F(PreloadSmokeTest, ReadonlyUpdateUninstallMode) { std::string pkgid = "smokewgt43"; std::string appid = "smokewgt43.ReadonlyUpdateUninstallMode"; - ASSERT_EQ(InstallPreload(path, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_EQ(Install(path, PackageType::WGT), + ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); - ASSERT_TRUE(ValidatePackage(pkgid, {appid}, true)); - ASSERT_EQ(Uninstall(pkgid, PackageType::WGT, false), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid}, true)); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); + ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } -TEST_F(PreloadSmokeTest, ManifestDirectInstallMode_Hybrid) { +TEST_F(HybridSmokeTest, ManifestDirectInstallMode) { ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode_Hybrid"; std::string pkgid = "smokehyb12"; std::string appid = "smokehyb12.ManifestDirectInstallModeHybrid"; - bf::path pkg_path = ci::GetRootAppPath(false, kTestUserId); + bf::path pkg_path = ci::GetRootAppPath(false, params.test_user.uid); - CopyDir(src_path / pkgid, pkg_path / pkgid); - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId))); - ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::HYBRID), + ci::CopyDir(src_path / pkgid, pkg_path / pkgid); + ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid); + ASSERT_FALSE(pkg_query.IsPackageInstalled( + ci::GetRequestMode(params.test_user.uid))); + ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } -TEST_F(SmokeTest, ManifestDirectUpdateMode_Hybrid) { +TEST_F(HybridSmokeTest, ManifestDirectUpdateMode) { bf::path path = kSmokePackagesDirectory / "ManifestDirectUpdateMode_Hybrid.wgt"; std::string pkgid = "smokehyb13"; std::string appid = "smokehyb13.ManifestDirectUpdateModeHybrid"; - ASSERT_EQ(Install(path, PackageType::HYBRID), ci::AppInstaller::Result::OK); - int install_time = GetAppInstalledTime(appid.c_str(), kTestUserId); - ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(GetAppInstalledTime(appid.c_str(), kTestUserId) > install_time) + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid); + ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK); + ASSERT_TRUE(GetAppInstalledTime(appid.c_str(), + params.test_user.uid) > install_time) << "Package is not updated (app installed time didn't change)."; - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); } TEST_F(SmokeTest, SharedRes24) { bf::path path = kSmokePackagesDirectory / "SharedRes24.wgt"; std::string pkgid = "smokeSh2xx"; std::string appid = "smokeSh2xx.SharedRes24"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - ValidatePackage(pkgid, {appid}); - bf::path root_path = ci::GetRootAppPath(false, kTestUserId); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ValidatePackage(pkgid, {appid}, params); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "NOT-SHARED-WGT")); // NOLINT ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "NOT-SHARED-WGT")); // NOLINT } @@ -739,9 +816,9 @@ TEST_F(SmokeTest, SharedRes30) { bf::path path = kSmokePackagesDirectory / "SharedRes30.wgt"; std::string pkgid = "smokeSh3xx"; std::string appid = "smokeSh3xx.SharedRes30"; - ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); - bf::path root_path = ci::GetRootAppPath(false, kTestUserId); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT")); // NOLINT } @@ -751,42 +828,42 @@ TEST_F(SmokeTest, SharedRes30Delta) { bf::path delta_package = kSmokePackagesDirectory / "SharedRes30Delta.delta"; std::string pkgid = "smokeSh3De"; std::string appid = "smokeSh3De.SharedRes30Delta"; - ASSERT_EQ(DeltaInstall(path, delta_package, PackageType::WGT), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid})); + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); // Check delta modifications - bf::path root_path = ci::GetRootAppPath(false, kTestUserId); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-2")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT-2")); // NOLINT ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-1")); // NOLINT ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "SHARED-WGT-1")); // NOLINT } -TEST_F(SmokeTest, SharedRes30Hybrid) { +TEST_F(HybridSmokeTest, SharedRes30Hybrid) { bf::path path = kSmokePackagesDirectory / "SharedRes30Hybrid.wgt"; std::string pkgid = "smokeSh3Hy"; std::string appid1 = "smokeSh3Hy.SharedRes30Hybrid"; std::string appid2 = "sharedres30hybridserivce"; - ASSERT_EQ(Install(path, PackageType::HYBRID), ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2})); - bf::path root_path = ci::GetRootAppPath(false, kTestUserId); + ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2}, params)); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-TPK")); // NOLINT } -TEST_F(SmokeTest, SharedRes30HybridDelta) { +TEST_F(HybridSmokeTest, SharedRes30HybridDelta) { bf::path path = kSmokePackagesDirectory / "SharedRes30HybridDelta.wgt"; bf::path delta_package = kSmokePackagesDirectory / "SharedRes30HybridDelta.delta"; std::string pkgid = "smokeSh3HD"; std::string appid1 = "smokeSh3HD.SharedRes30HybridDelta"; std::string appid2 = "sharedres30hybriddeltaserivce"; - ASSERT_EQ(DeltaInstall(path, delta_package, PackageType::HYBRID), - ci::AppInstaller::Result::OK); - ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2})); + ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK); + ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2}, params)); // Check delta modifications - bf::path root_path = ci::GetRootAppPath(false, kTestUserId); + bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid); ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-2")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT-2")); // NOLINT ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-TPK-2")); // NOLINT @@ -795,27 +872,27 @@ TEST_F(SmokeTest, SharedRes30HybridDelta) { } TEST_F(SmokeTest, InstallExtendedMode) { - ASSERT_TRUE(CheckAvailableExtendedStorage()); + ASSERT_TRUE(CheckAvailableExtendedPath()); bf::path path = kSmokePackagesDirectory / "InstallExtendedMode.wgt"; std::string pkgid = "smokewgt44"; std::string appid = "smokewgt44.web"; - ASSERT_EQ(InstallWithStorage(path, PackageType::WGT, StorageType::EXTENDED), + ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTENDED), ci::AppInstaller::Result::OK); - ValidatePackage(pkgid, {appid}); + ASSERT_TRUE(ValidateExtendedPackage(pkgid, {appid}, params)); } -} // namespace common_installer +} // namespace smoke_test int main(int argc, char** argv) { - ci::RequestMode request_mode = ParseRequestMode(argc, argv); + ci::RequestMode request_mode = st::ParseRequestMode(argc, argv); if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) { std::cout << "Skip tests for preload request" << std::endl; ::testing::GTEST_FLAG(filter) = "SmokeTest.*"; } testing::InitGoogleTest(&argc, argv); - env = testing::AddGlobalTestEnvironment( - new common_installer::SmokeEnvironment(request_mode)); - signal(SIGINT, signalHandler); - signal(SIGSEGV, signalHandler); + ::env = testing::AddGlobalTestEnvironment( + new smoke_test::SmokeEnvironment(request_mode)); + signal(SIGINT, ::signalHandler); + signal(SIGSEGV, ::signalHandler); return RUN_ALL_TESTS(); } diff --git a/src/unit_tests/smoke_utils.cc b/src/unit_tests/smoke_utils.cc index 3730ad0..653df94 100644 --- a/src/unit_tests/smoke_utils.cc +++ b/src/unit_tests/smoke_utils.cc @@ -2,909 +2,39 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include #include "wgt/wgt_installer.h" +#include "hybrid/hybrid_installer.h" #include "unit_tests/smoke_utils.h" -namespace bo = boost::program_options; +namespace ci = common_installer; +namespace st = smoke_test; -const uid_t kGlobalUserUid = tzplatform_getuid(TZ_SYS_GLOBALAPP_USER); -const uid_t kGlobalUserGid = tzplatform_getgid(TZ_SYS_GLOBALAPP_USER); -const uid_t kDefaultUserUid = tzplatform_getuid(TZ_SYS_DEFAULT_USER); -uid_t kTestUserId = kGlobalUserUid; -gid_t kTestGroupId = kGlobalUserGid; -const char kNormalUserName[] = "smokeuser"; -const char kSystemShareGroupName[] = "system_share"; -std::string kTestUserIdStr = std::to_string(kTestUserId); -const std::string& kDefaultUserIdStr = std::to_string(kDefaultUserUid); -const char kLegacyExtImageDir[] = "legacy_extimage_dir"; -const char kMigrateTestDBName[] = "app2sd_migrate.db"; +namespace smoke_test { const bf::path kSmokePackagesDirectory = "/usr/share/wgt-backend-ut/test_samples/smoke/"; - -const char* rwDirectories[] = { - "data", - "cache", - "shared/cache", - "shared/data", - "shared/trusted", -}; - -// common entries -const std::vector kDBEntries = { - {".pkgmgr_parser.db"}, - {".pkgmgr_parser.db-journal"}, - {".pkgmgr_cert.db"}, - {".pkgmgr_cert.db-journal"}, - {".app2sd.db"}, - {".app2sd.db-journal"}, -}; -// globaluser entries -const char kGlobalManifestDir[] = "/opt/share/packages"; -const char kSkelDir[] = "/etc/skel/apps_rw"; -const char kPreloadApps[] = "/usr/apps"; -const char kPreloadManifestDir[] = "/usr/share/packages"; -const char kPreloadIcons[] = "/usr/share/icons"; - -testing::Environment *env = nullptr; -void signalHandler(int signum) { - env->TearDown(); - exit(signum); -} - -ci::RequestMode ParseRequestMode(int argc, char** argv) { - bo::options_description desc("Available options"); - desc.add_options() - ("request-mode", bo::value(), "set request mode") - ("global-request,g", "set request mode to global") - ("user-request,u", "set request mode to user"); - - bo::variables_map vm; - bo::store(bo::command_line_parser(argc, argv). - options(desc).allow_unregistered().run(), vm); - bo::notify(vm); - - if (vm.count("global-request")) { - std::cout << "Request mode was set to global." << std::endl; - return ci::RequestMode::GLOBAL; - } - if (vm.count("user-request")) { - std::cout << "Request mode was set to user." << std::endl; - return ci::RequestMode::USER; - } - if (vm.count("request-mode")) { - if (vm["request-mode"].as() == "global") { - std::cout << "Request mode was set to global." << std::endl; - return ci::RequestMode::GLOBAL; - } - if (vm["request-mode"].as() == "user") { - std::cout << "Request mode was set to user." << std::endl; - return ci::RequestMode::USER; - } - std::cout << "Cannot set request mode to " - << vm["request-mode"].as() << std::endl; - } - std::cout << "Request mode was set to global." << std::endl; - return ci::RequestMode::GLOBAL; -} - -bool TouchFile(const bf::path& path) { - FILE* f = fopen(path.c_str(), "w+"); - if (!f) - return false; - fclose(f); - return true; -} - -bool AddUser(const char *user_name) { - GumUser* user = nullptr; - user = gum_user_create_sync(FALSE); - if (user == nullptr) - LOG(WARNING) << "Failed to create gum user! (user name: " - << user_name << ")"; - g_object_set(G_OBJECT(user), "username", user_name, "usertype", - GUM_USERTYPE_NORMAL, NULL); - gboolean rval = FALSE; - rval = gum_user_add_sync(user); - g_object_unref(user); - return rval; -} - -bool DeleteUser(const char *user_name, bool rem_home_dir) { - bool rval = FALSE; - GumUser* guser = gum_user_get_by_name_sync(user_name, FALSE); - if (guser) - rval = gum_user_delete_sync(guser, rem_home_dir); - return rval; -} - -bool AddTestUser(const char *user_name) { - std::cout << "Adding test user: " << user_name << std::endl; - AddUser(user_name); - if (boost::optional uid = ci::GetUidByUserName(user_name)) { - kTestUserId = *uid; - kTestUserIdStr = std::to_string(kTestUserId); - std::cout << "User created properly: uid=" << *uid; - if (boost::optional gid = ci::GetGidByUid(*uid)) { - kTestGroupId = *gid; - std::cout << " gid=" << *gid; - } - std::cout << std::endl; - return true; - } - LOG(ERROR) << "Adding test user failed"; - return false; -} - -bool DeleteTestUser(const char *user_name) { - std::cout << "Deleting test user: " << user_name << std::endl; - uid_t test_uid; - if (boost::optional uid = ci::GetUidByUserName(user_name)) - test_uid = *uid; - DeleteUser(user_name, true); - if (!ci::GetUidByUserName(user_name)) { - std::cout << "User deleted properly: user_name=" << user_name - << " uid=" << test_uid << std::endl; - return true; - } - LOG(ERROR) << "Deleting test user failed"; - return false; -} - -void RemoveAllRecoveryFiles() { - bf::path root_path = ci::GetRootAppPath(false, - kTestUserId); - if (!bf::exists(root_path)) - return; - for (auto& dir_entry : boost::make_iterator_range( - bf::directory_iterator(root_path), bf::directory_iterator())) { - if (bf::is_regular_file(dir_entry)) { - if (dir_entry.path().string().find("/wgt-recovery") - != std::string::npos) { - bs::error_code error; - bf::remove(dir_entry.path(), error); - } - } - } -} - -bf::path FindRecoveryFile() { - bf::path root_path = ci::GetRootAppPath(false, - kTestUserId); - for (auto& dir_entry : boost::make_iterator_range( - bf::directory_iterator(root_path), bf::directory_iterator())) { - if (bf::is_regular_file(dir_entry)) { - if (dir_entry.path().string().find("/wgt-recovery") - != std::string::npos) { - return dir_entry.path(); - } - } - } - return {}; -} - -bf::path GetPackageRoot(const std::string& pkgid, uid_t uid) { - bf::path root_path = ci::GetRootAppPath(false, uid); - return root_path / pkgid; -} - -bool ValidateFileContentInPackage(const std::string& pkgid, - const std::string& relative, - const std::string& expected, - bool is_readonly) { - bf::path file_path = ci::GetRootAppPath(is_readonly, kTestUserId); - file_path = file_path / pkgid / relative; - if (!bf::exists(file_path)) { - LOG(ERROR) << file_path << " doesn't exist"; - return false; - } - FILE* handle = fopen(file_path.c_str(), "r"); - if (!handle) { - LOG(ERROR) << file_path << " cannot be open"; - return false; - } - std::string content; - std::array buffer; - while (fgets(buffer.data(), buffer.size(), handle)) { - content += buffer.data(); - } - fclose(handle); - return content == expected; -} - -void AddDataFiles(const std::string& pkgid, uid_t uid) { - if (uid == kGlobalUserUid) { - ci::UserList list = ci::GetUserList(); - for (auto l : list) { - auto pkg_path = GetPackageRoot(pkgid, std::get<0>(l)); - ASSERT_TRUE(TouchFile(pkg_path / "data" / "file1.txt")); - ASSERT_TRUE(TouchFile(pkg_path / "data" / "file2.txt")); - } - } else { - auto pkg_path = GetPackageRoot(pkgid, uid); - ASSERT_TRUE(TouchFile(pkg_path / "data" / "file1.txt")); - ASSERT_TRUE(TouchFile(pkg_path / "data" / "file2.txt")); - } -} - -bool ValidateDataFiles(const std::string& pkgid, uid_t uid) { - if (uid == kGlobalUserUid) { - ci::UserList list = ci::GetUserList(); - for (auto l : list) { - auto pkg_path = GetPackageRoot(pkgid, std::get<0>(l)); - EXTENDED_ASSERT_TRUE(bf::exists(pkg_path / "data" / "file1.txt")); - EXTENDED_ASSERT_TRUE(bf::exists(pkg_path / "data" / "file2.txt")); - } - } else { - auto pkg_path = GetPackageRoot(pkgid, uid); - EXTENDED_ASSERT_TRUE(bf::exists(pkg_path / "data" / "file1.txt")); - EXTENDED_ASSERT_TRUE(bf::exists(pkg_path / "data" / "file2.txt")); - } - return true; -} - -bool ValidatePackageRWFS(const std::string& pkgid, uid_t uid) { - bf::path root_path = ci::GetRootAppPath(false, uid); - bf::path package_path = root_path / pkgid; - bf::path data_path = package_path / rwDirectories[DATA]; - bf::path cache_path = package_path / rwDirectories[CACHE]; - bf::path shared_data_path = package_path / rwDirectories[SHARED_DATA]; - - EXTENDED_ASSERT_TRUE(bf::exists(data_path)); - EXTENDED_ASSERT_TRUE(bf::exists(cache_path)); - - struct stat stats; - stat(data_path.c_str(), &stats); - // gid of RW dirs should be system_share - boost::optional system_share = - ci::GetGidByGroupName(kSystemShareGroupName); - EXTENDED_ASSERT_EQ(uid, stats.st_uid); - EXTENDED_ASSERT_EQ(*system_share, stats.st_gid); - if (bf::exists(shared_data_path)) { - stat(shared_data_path.c_str(), &stats); - EXTENDED_ASSERT_EQ(uid, stats.st_uid); - EXTENDED_ASSERT_EQ(*system_share, stats.st_gid); - } - - stat(cache_path.c_str(), &stats); - EXTENDED_ASSERT_EQ(uid, stats.st_uid); - EXTENDED_ASSERT_EQ(*system_share, stats.st_gid); - return true; +WgtBackendInterface::AppQueryInterfacePtr +WgtBackendInterface::CreateQueryInterface() const { + return AppQueryInterfacePtr(new wgt::WgtAppQueryInterface()); } -bool ValidatePackageFS(const std::string& pkgid, - const std::vector& appids, - uid_t uid, gid_t gid, bool is_readonly) { - bf::path root_path = ci::GetRootAppPath(is_readonly, uid); - bf::path package_path = root_path / pkgid; - bf::path shared_path = package_path / "shared"; - EXTENDED_ASSERT_TRUE(bf::exists(root_path)); - EXTENDED_ASSERT_TRUE(bf::exists(package_path)); - EXTENDED_ASSERT_TRUE(bf::exists(shared_path)); - - bf::path manifest_path = - bf::path(getUserManifestPath(uid, is_readonly)) / (pkgid + ".xml"); - EXTENDED_ASSERT_TRUE(bf::exists(manifest_path)); - - for (auto& appid : appids) { - bf::path binary_path = package_path / "bin" / appid; - EXTENDED_ASSERT_TRUE(bf::exists(binary_path)); - } - - bf::path widget_root_path = package_path / "res" / "wgt"; - bf::path config_path = widget_root_path / "config.xml"; - EXTENDED_ASSERT_TRUE(bf::exists(widget_root_path)); - EXTENDED_ASSERT_TRUE(bf::exists(config_path)); - - bf::path private_tmp_path = package_path / "tmp"; - EXTENDED_ASSERT_TRUE(bf::exists(private_tmp_path)); - - // backups should not exist - bf::path package_backup = ci::GetBackupPathForPackagePath(package_path); - bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path); - EXTENDED_ASSERT_FALSE(bf::exists(package_backup)); - EXTENDED_ASSERT_FALSE(bf::exists(manifest_backup)); - - for (bf::recursive_directory_iterator iter(package_path); - iter != bf::recursive_directory_iterator(); ++iter) { - if (bf::is_symlink(symlink_status(iter->path()))) - continue; - bool is_rw_dir = false; - for (const auto rw_dir : rwDirectories) { - bf::path rw_dir_path = rw_dir; - is_rw_dir |= ci::MakeRelativePath(iter->path(), package_path) - == rw_dir_path; - } - if (is_rw_dir || iter->path().filename() == ".mmc") { - iter.no_push(); - continue; - } - struct stat stats; - stat(iter->path().c_str(), &stats); - EXTENDED_ASSERT_EQ(uid, stats.st_uid); - EXTENDED_ASSERT_EQ(gid, stats.st_gid); - } - return true; +WgtBackendInterface::AppInstallerPtr +WgtBackendInterface::CreateInstaller(ci::PkgMgrPtr pkgmgr) const { + return AppInstallerPtr(new wgt::WgtInstaller(pkgmgr)); } -void PackageCheckCleanup(const std::string& pkgid, - const std::vector&, bool is_readonly) { - bf::path root_path = ci::GetRootAppPath(is_readonly, kTestUserId); - bf::path package_path = root_path / pkgid; - ASSERT_FALSE(bf::exists(package_path)); - - bf::path manifest_path = bf::path(getUserManifestPath(kTestUserId, - is_readonly)) / (pkgid + ".xml"); - ASSERT_FALSE(bf::exists(manifest_path)); - - // backups should not exist - bf::path package_backup = ci::GetBackupPathForPackagePath(package_path); - bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path); - ASSERT_FALSE(bf::exists(package_backup)); - ASSERT_FALSE(bf::exists(manifest_backup)); +WgtBackendInterface::AppQueryInterfacePtr +HybridBackendInterface::CreateQueryInterface() const { + return AppQueryInterfacePtr(new wgt::WgtAppQueryInterface()); } -bool ValidatePackage(const std::string& pkgid, - const std::vector& appids, bool is_readonly) { - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - EXTENDED_ASSERT_TRUE(pkg_query.IsPackageInstalled( - ci::GetRequestMode(kTestUserId))); - EXTENDED_ASSERT_TRUE(ValidatePackageFS( - pkgid, appids, kTestUserId, kTestGroupId, is_readonly)); - if (kTestUserId == kGlobalUserUid) { - ci::UserList list = ci::GetUserList(); - for (auto& l : list) - EXTENDED_ASSERT_TRUE(ValidatePackageRWFS(pkgid, std::get<0>(l))); - } else { - EXTENDED_ASSERT_TRUE(ValidatePackageRWFS(pkgid, kTestUserId)); - } - return true; +WgtBackendInterface::AppInstallerPtr +HybridBackendInterface::CreateInstaller(ci::PkgMgrPtr pkgmgr) const { + return AppInstallerPtr(new hybrid::HybridInstaller(pkgmgr)); } -void ValidateExternalPackageFS(const std::string& pkgid, - const std::vector& appids, - uid_t uid, gid_t gid) { - ASSERT_EQ(app2ext_usr_enable_external_pkg(pkgid.c_str(), uid), 0); - bf::path root_path = ci::GetRootAppPath(false, uid); - ASSERT_TRUE(bf::exists(root_path / pkgid / ".mmc" / "res")); - ValidatePackageFS(pkgid, appids, uid, gid, false); - ASSERT_EQ(app2ext_usr_disable_external_pkg(pkgid.c_str(), uid), 0); -} - -void ValidateExternalPackage(const std::string& pkgid, - const std::vector& appids) { - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - ASSERT_TRUE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId))); - std::string storage = pkg_query.StorageForPkgId(); - bf::path ext_mount_path = ci::GetExternalCardPath(); - if (bf::is_empty(ext_mount_path)) { - LOG(INFO) << "Sdcard not exists!"; - ASSERT_EQ(storage, "installed_internal"); - } else { - ASSERT_EQ(storage, "installed_external"); - } - ValidateExternalPackageFS(pkgid, appids, kTestUserId, kTestGroupId); - if (kTestUserId == kGlobalUserUid) { - ci::UserList list = ci::GetUserList(); - for (auto& l : list) - ValidatePackageRWFS(pkgid, std::get<0>(l)); - } else { - ValidatePackageRWFS(pkgid, kTestUserId); - } -} - -bool CheckPackageNonExistance(const std::string& pkgid, - const std::vector& appids) { - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - EXTENDED_ASSERT_FALSE(pkg_query.IsPackageInstalled( - ci::GetRequestMode(kTestUserId))); - PackageCheckCleanup(pkgid, appids); - if (kTestUserId == kGlobalUserUid) { - ci::UserList list = ci::GetUserList(); - bf::path skel_path(kSkelDir); - EXTENDED_ASSERT_FALSE(bf::exists(skel_path / pkgid)); - for (auto& l : list) { - bf::path root_path = ci::GetRootAppPath(false, std::get<0>(l)); - bf::path package_path = root_path / pkgid; - EXTENDED_ASSERT_FALSE(bf::exists(package_path)); - } - } - return true; -} - -void CheckPackageReadonlyNonExistance(const std::string& pkgid, - const std::vector& appids) { - ci::PkgQueryInterface pkg_query(pkgid, kTestUserId); - ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId))); - PackageCheckCleanup(pkgid, appids, true); -} - -std::unique_ptr CreateQueryInterface() { - std::unique_ptr query_interface( - new wgt::WgtAppQueryInterface()); - return query_interface; -} - -std::unique_ptr CreateInstaller(ci::PkgMgrPtr pkgmgr, - PackageType type) { - switch (type) { - case PackageType::WGT: - return std::unique_ptr(new wgt::WgtInstaller(pkgmgr)); - case PackageType::HYBRID: - return std::unique_ptr( - new hybrid::HybridInstaller(pkgmgr)); - default: - LOG(ERROR) << "Unknown installer type"; - return nullptr; - } -} - -void TestRollbackAfterEachStep(int argc, const char*argv[], - std::function validator, - PackageType type) { - TestPkgmgrInstaller pkgmgr_installer; - std::unique_ptr query_interface = - CreateQueryInterface(); - auto pkgmgr = - ci::PkgMgrInterface::Create(argc, const_cast(argv), - &pkgmgr_installer, - query_interface.get()); - if (!pkgmgr) { - LOG(ERROR) << "Failed to initialize pkgmgr interface"; - return; - } - std::unique_ptr backend = CreateInstaller(pkgmgr, type); - int i; - for (i = backend->StepCount()-1; i >= 0; i--) { - backend->AddStepAtIndex(i); - LOG(DEBUG) << "StepFail is inserted at: " << i; - ASSERT_EQ(ci::AppInstaller::Result::ERROR, - backend->Run()); - if (!validator()) - break; - } - ASSERT_EQ(-1, i); -} - -void CrashAfterEachStep(std::vector args, - std::function validator, - PackageType type) { - std::unique_ptr argv(new const char*[args.size()]); - for (size_t i = 0; i < args.size(); ++i) { - argv[i] = args[i].c_str(); - } - TestPkgmgrInstaller pkgmgr_installer; - std::unique_ptr query_interface = - CreateQueryInterface(); - auto pkgmgr = - ci::PkgMgrInterface::Create(args.size(), const_cast(argv.get()), - &pkgmgr_installer, - query_interface.get()); - if (!pkgmgr) { - LOG(ERROR) << "Failed to initialize pkgmgr interface"; - return; - } - std::unique_ptr backend = CreateInstaller(pkgmgr, type); - int stepCount = backend->StepCount(); - - args.push_back("-idx"); - args.push_back(std::to_string(stepCount)); - int i; - for (i = 0; i < stepCount; i++) { - ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper"); - args.back() = std::to_string(i); - backend_crash.Run(args); - ASSERT_NE(backend_crash.Wait(), 0); - if (!validator(i)) - break; - } - ASSERT_EQ(stepCount, i); -} - -ci::AppInstaller::Result RunInstallerWithPkgrmgr(ci::PkgMgrPtr pkgmgr, - PackageType type, - RequestResult mode) { - std::unique_ptr installer = CreateInstaller(pkgmgr, type); - switch (mode) { - case RequestResult::FAIL: - installer->AddStep(); - break; - default: - break; - } - return installer->Run(); -} -ci::AppInstaller::Result CallBackend(int argc, - const char* argv[], - PackageType type, - RequestResult mode) { - TestPkgmgrInstaller pkgmgr_installer; - std::unique_ptr query_interface = - CreateQueryInterface(); - auto pkgmgr = - ci::PkgMgrInterface::Create(argc, const_cast(argv), - &pkgmgr_installer, query_interface.get()); - if (!pkgmgr) { - LOG(ERROR) << "Failed to initialize pkgmgr interface"; - return ci::AppInstaller::Result::UNKNOWN; - } - return RunInstallerWithPkgrmgr(pkgmgr, type, mode); -} - -ci::AppInstaller::Result Install(const bf::path& path, - PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result InstallPreload(const bf::path& path, PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-i", path.c_str(), "--preload"}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -bool CheckAvailableExternalPath() { - bf::path ext_mount_path = ci::GetExternalCardPath(); - LOG(DEBUG) << "ext_mount_path :" << ext_mount_path; - if (ext_mount_path.empty()) { - LOG(ERROR) << "Sdcard not exists!"; - return false; - } - return true; -} - -bool CheckAvailableExtendedStorage() { - bf::path extended_path = bf::path(tzplatform_getenv(TZ_SYS_EXTENDEDSD)); - LOG(DEBUG) << "extended_path :" << extended_path; - // TODO(jeremy.jang): It should be checked by libstorage API. - if (!bf::exists(extended_path)) { - LOG(ERROR) << "Extended storage not exists!"; - return false; - } - return true; -} - -ci::AppInstaller::Result InstallWithStorage(const bf::path& path, - PackageType type, - StorageType storage_type, - RequestResult mode) { - int default_storage = 0; - int storage = 0; - switch (storage_type) { - case StorageType::EXTERNAL: - storage = 1; - break; - case StorageType::EXTENDED: - storage = 2; - break; - default: - LOG(ERROR) << "Unknown storage type"; - break; - } - vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, - &default_storage); - vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, storage); - - const char* argv[] = {"", "-i", path.c_str(), "-u", kTestUserIdStr.c_str()}; - ci::AppInstaller::Result result = - CallBackend(SIZEOFARRAY(argv), argv, type, mode); - - vconf_set_int(VCONFKEY_SETAPPL_DEFAULT_MEM_INSTALL_APPLICATIONS_INT, - default_storage); - return result; -} - -ci::AppInstaller::Result MigrateLegacyExternalImage(const std::string& pkgid, - const bf::path& path, - const bf::path& legacy_path, - PackageType type, - RequestResult mode) { - if (InstallWithStorage(path, type, StorageType::EXTERNAL) != - ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Failed to install application. Cannot perform Migrate"; - return ci::AppInstaller::Result::ERROR; - } - - bf::path ext_mount_path = ci::GetExternalCardPath(); - if (bf::is_empty(ext_mount_path)) { - LOG(ERROR) << "Sdcard not exists!"; - return ci::AppInstaller::Result::ERROR; - } - bf::path app2sd_path = ext_mount_path / "app2sd"; - - char* image_name = app2ext_usr_getname_image(pkgid.c_str(), - kGlobalUserUid); - if (!image_name) { - LOG(ERROR) << "Failed to get external image name"; - return ci::AppInstaller::Result::ERROR; - } - bf::path org_image = app2sd_path / image_name; - free(image_name); - - bs::error_code error; - bf::remove(org_image, error); - if (error) { - LOG(ERROR) << "Failed to remove org image"; - return ci::AppInstaller::Result::ERROR; - } - - bf::path db_path = tzplatform_getenv(TZ_SYS_DB); - bf::path app2sd_db = db_path / ".app2sd.db"; - bf::path app2sd_db_journal = db_path / ".app2sd.db-journal"; - bf::remove(app2sd_db, error); - if (error) { - LOG(ERROR) << "Failed to remove app2sd db"; - return ci::AppInstaller::Result::ERROR; - } - bf::remove(app2sd_db_journal, error); - if (error) { - LOG(ERROR) << "Failed to remove app2sd journal db"; - return ci::AppInstaller::Result::ERROR; - } - - bf::path app2sd_migrate_db = legacy_path / kMigrateTestDBName; - if (!ci::CopyFile(app2sd_migrate_db, app2sd_db)) { - LOG(ERROR) << "Failed to copy test db"; - return ci::AppInstaller::Result::ERROR; - } - - bf::path legacy_src = legacy_path / pkgid; - bf::path legacy_dst = app2sd_path / pkgid; - if (!ci::CopyFile(legacy_src, legacy_dst)) { - LOG(ERROR) << "Failed to copy test image"; - return ci::AppInstaller::Result::ERROR; - } - const char* argv[] = {"", "--migrate-extimg", pkgid.c_str(), - "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result MountInstall(const bf::path& path, - PackageType type, RequestResult mode) { - const char* argv[] = {"", "-w", path.c_str(), "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result Uninstall(const std::string& pkgid, - PackageType type, - bool is_preload, - RequestResult mode) { - if (is_preload) { - const char* argv[] = {"", "-d", pkgid.c_str(), "--preload", - "--force-remove"}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); - } else { - const char* argv[] = {"", "-d", pkgid.c_str(), "-u", - kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); - } -} - -ci::AppInstaller::Result RDSUpdate(const bf::path& path, - const std::string& pkgid, - PackageType type, - RequestResult mode) { - if (Install(path, type) != ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Failed to install application. Cannot perform RDS"; - return ci::AppInstaller::Result::UNKNOWN; - } - const char* argv[] = {"", "-r", pkgid.c_str(), "-u", - kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result DeltaInstall(const bf::path& path, - const bf::path& delta_package, PackageType type) { - if (Install(path, type) != ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Failed to install application. Cannot perform delta update"; - return ci::AppInstaller::Result::UNKNOWN; - } - return Install(delta_package, type); -} - -ci::AppInstaller::Result EnablePackage(const std::string& pkgid, - PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-A", pkgid.c_str(), "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result DisablePackage(const std::string& pkgid, - PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-D", pkgid.c_str(), "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result Recover(const bf::path& recovery_file, - PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-b", recovery_file.c_str(), "-u", - kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -ci::AppInstaller::Result ManifestDirectInstall(const std::string& pkgid, - PackageType type, - RequestResult mode) { - const char* argv[] = {"", "-y", pkgid.c_str(), "-u", kTestUserIdStr.c_str()}; - return CallBackend(SIZEOFARRAY(argv), argv, type, mode); -} - -namespace { - -boost::filesystem::path GetTrashPath(const boost::filesystem::path& path) { - return path.string() + ".trash"; -} - -} - -bool BackupPath(const bf::path& path) { - bf::path trash_path = GetTrashPath(path); - if (bf::exists(trash_path)) { - LOG(ERROR) << trash_path << " exists. Please remove " - << trash_path << " manually!"; - return false; - } - bf::path backup_path = path.string() + ".bck"; - std::cout << "Backup path: " << path << " to " << backup_path << std::endl; - bs::error_code error; - bf::remove_all(backup_path, error); - if (error) - LOG(ERROR) << "Remove failed: " << backup_path - << " (" << error.message() << ")"; - if (bf::exists(path)) { - bf::rename(path, backup_path, error); - if (error) { - LOG(ERROR) << "Failed to setup test environment. Does some previous" - << " test crashed? Path: " - << backup_path << " should not exist."; - return false; - } - assert(!error); - } - return true; -} - -bool RestorePath(const bf::path& path) { - bf::path backup_path = path.string() + ".bck"; - std::cout << "Restore path: " << path << " from " << backup_path << std::endl; - bs::error_code error; - bf::remove_all(path, error); - if (error) { - bf::path trash_path = GetTrashPath(path); - LOG(ERROR) << "Remove failed: " << path << " (" << error.message() << ")"; - std::cout << "Moving " << path << " to " << trash_path << std::endl; - bf::rename(path, trash_path, error); - if (error) - LOG(ERROR) << "Failed to move " << path << " to " << trash_path - << " (" << error.message() << ")"; - else - LOG(ERROR) << trash_path << " should be removed manually!"; - } - if (bf::exists(backup_path)) { - bf::rename(backup_path, path, error); - if (error) { - LOG(ERROR) << "Failed to restore backup path: " << backup_path - << " (" << error.message() << ")"; - return false; - } - } - return true; -} - -std::vector SetupBackupDirectories() { - std::vector entries; - bf::path db_dir = bf::path(tzplatform_getenv(TZ_SYS_DB)); - if (kTestUserId != kGlobalUserUid) - db_dir = db_dir / "user" / std::to_string(kTestUserId); - for (auto e : kDBEntries) { - bf::path path = db_dir / e; - entries.emplace_back(path); - } - - if (getuid() == 0) { - entries.emplace_back(kPreloadApps); - entries.emplace_back(kPreloadManifestDir); - entries.emplace_back(kPreloadIcons); - } - - if (kTestUserId == kGlobalUserUid) { - entries.emplace_back(kSkelDir); - entries.emplace_back(kGlobalManifestDir); - ci::UserList list = ci::GetUserList(); - for (auto l : list) { - bf::path apps = std::get<2>(l) / "apps_rw"; - entries.emplace_back(apps); - } - } else { - tzplatform_set_user(kTestUserId); - bf::path approot = tzplatform_getenv(TZ_USER_APPROOT); - tzplatform_reset_user(); - entries.emplace_back(approot); - } - - bf::path apps_rw = ci::GetRootAppPath(false, kTestUserId); - entries.emplace_back(apps_rw); - - return entries; -} - -void UninstallAllAppsInDirectory(bf::path dir, bool is_preload) { - if (bf::exists(dir)) { - for (auto& dir_entry : boost::make_iterator_range( - bf::directory_iterator(dir), bf::directory_iterator())) { - if (dir_entry.path().string().find("smoke") != std::string::npos && - bf::is_directory(dir_entry)) { - std::string package = dir_entry.path().filename().string(); - std::regex pkg_regex("smoke[a-zA-Z0-9]{5,}"); - if (std::regex_match(package, pkg_regex)) { - if (Uninstall(dir_entry.path().filename().string(), PackageType::WGT, - is_preload, RequestResult::NORMAL) != - ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Cannot uninstall smoke test app: " - << dir_entry.path().filename().string(); - } - } - } - } - } -} - -void UninstallAllSmokeApps(ci::RequestMode request_mode) { - std::cout << "Uninstalling all smoke apps" << std::endl; - bf::path apps_rw = ci::GetRootAppPath(false, kTestUserId); - UninstallAllAppsInDirectory(apps_rw, false); - if (getuid() == 0 && request_mode == ci::RequestMode::GLOBAL) { - bf::path root_path = kPreloadApps; - UninstallAllAppsInDirectory(root_path, true); - } -} - -int GetAppInstalledTime(const char *appid, uid_t uid) { - int ret = 0; - int installed_time = 0; - pkgmgrinfo_appinfo_h handle = NULL; - ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, uid, &handle); - if (ret != PMINFO_R_OK) - return -1; - ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time); - if (ret != PMINFO_R_OK) { - pkgmgrinfo_appinfo_destroy_appinfo(handle); - return -1; - } - pkgmgrinfo_appinfo_destroy_appinfo(handle); - return installed_time; -} +} // namespace smoke_test diff --git a/src/unit_tests/smoke_utils.h b/src/unit_tests/smoke_utils.h index b87da34..d7f7276 100644 --- a/src/unit_tests/smoke_utils.h +++ b/src/unit_tests/smoke_utils.h @@ -5,287 +5,39 @@ #ifndef UNIT_TESTS_SMOKE_UTILS_H_ #define UNIT_TESTS_SMOKE_UTILS_H_ - -#include - -#include #include -#include -#include -#include -#include -#include -#include - -#include +#include +#include #include -#include -#include -#include "hybrid/hybrid_installer.h" #include "wgt/wgt_app_query_interface.h" -#define SIZEOFARRAY(ARR) \ - sizeof(ARR) / sizeof(ARR[0]) \ - -#define EXTENDED_ASSERT_TRUE(expression) do { \ - bool tmp = expression; \ - EXPECT_TRUE(tmp) << #expression << " is not true"; \ - if (!tmp) \ - return false; \ -} while (0); - -#define EXTENDED_ASSERT_FALSE(expression) do { \ - bool tmp = expression; \ - EXPECT_FALSE(tmp) << #expression << " is not false"; \ - if (tmp) \ - return false; \ -} while (0); - -#define EXTENDED_ASSERT_EQ(expression, value) do { \ - auto ret = expression; \ - EXPECT_EQ(ret, value) << #expression << " is not equal to " << #value; \ - if (ret != value) \ - return false; \ -} while (0); - -namespace bf = boost::filesystem; -namespace bs = boost::system; -namespace ci = common_installer; - -extern const uid_t kGlobalUserUid; -extern const uid_t kGlobalUserGid; -extern const uid_t kDefaultUserUid; -extern uid_t kTestUserId; -extern gid_t kTestGroupId; -extern std::string kTestUserIdStr; -extern const char kNormalUserName[]; -extern const char kSystemShareGroupName[]; -extern const std::string& kDefaultUserIdStr; -extern const char kLegacyExtImageDir[]; -extern const char kMigrateTestDBName[]; +namespace smoke_test { extern const bf::path kSmokePackagesDirectory; -enum RWDirectory { - DATA, - CACHE, - SHARED_CACHE, - SHARED_DATA, - SHARED_TRUSTED -}; - -extern const char* rwDirectories[]; - -// common entries -extern const std::vector kDBEntries; -// globaluser entries -extern const char kGlobalManifestDir[]; -extern const char kSkelDir[]; -extern const char kPreloadApps[]; -extern const char kPreloadManifestDir[]; -extern const char kPreloadIcons[]; - -extern testing::Environment *env; -void signalHandler(int signum); - -enum class RequestResult { - NORMAL, - FAIL -}; - -class ScopedTzipInterface { +class WgtBackendInterface: public BackendInterface { public: - explicit ScopedTzipInterface(const std::string& pkgid) - : pkg_path_(bf::path(ci::GetRootAppPath(false, - kTestUserId)) / pkgid), - interface_(ci::GetMountLocation(pkg_path_)), - mounted_(true) { - interface_.MountZip(ci::GetZipPackageLocation(pkg_path_, pkgid)); - } - - void Release() { - if (mounted_) { - interface_.UnmountZip(); - mounted_ = false; - } - } - - ~ScopedTzipInterface() { - Release(); - } + using BackendInterface::BackendInterface; private: - bf::path pkg_path_; - ci::TzipInterface interface_; - bool mounted_; + AppQueryInterfacePtr CreateQueryInterface() const override; + AppInstallerPtr CreateInstaller( + common_installer::PkgMgrPtr pkgmgr) const override; }; -class TestPkgmgrInstaller : public ci::PkgmgrInstallerInterface { +class HybridBackendInterface: public BackendInterface { public: - bool CreatePkgMgrInstaller(pkgmgr_installer** installer, - ci::InstallationMode* mode) { - *installer = pkgmgr_installer_offline_new(); - if (!*installer) - return false; - *mode = ci::InstallationMode::ONLINE; - return true; - } + using BackendInterface::BackendInterface; - bool ShouldCreateSignal() const { - return false; - } -}; - -enum class PackageType { - WGT, - HYBRID -}; - -enum class StorageType { - INTERNAL, - EXTERNAL, - EXTENDED + private: + AppQueryInterfacePtr CreateQueryInterface() const override; + AppInstallerPtr CreateInstaller( + common_installer::PkgMgrPtr pkgmgr) const override; }; -ci::RequestMode ParseRequestMode(int argc, char** argv); - -bool TouchFile(const bf::path& path); - -bool AddUser(const char *user_name); - -bool DeleteUser(const char *user_name, bool rem_home_dir); - -bool AddTestUser(const char *user_name); - -bool DeleteTestUser(const char *user_name); - -void RemoveAllRecoveryFiles(); - -bf::path FindRecoveryFile(); - -bf::path GetPackageRoot(const std::string& pkgid, uid_t uid); - -bool ValidateFileContentInPackage(const std::string& pkgid, - const std::string& relative, - const std::string& expected, - bool is_readonly = false); - -void AddDataFiles(const std::string& pkgid, uid_t uid); - -bool ValidateDataFiles(const std::string& pkgid, uid_t uid); - -bool ValidatePackageRWFS(const std::string& pkgid, uid_t uid); - -bool ValidatePackageFS(const std::string& pkgid, - const std::vector& appids, - uid_t uid, gid_t gid, bool is_readonly); - -void PackageCheckCleanup(const std::string& pkgid, - const std::vector&, bool is_readonly = false); - -bool ValidatePackage(const std::string& pkgid, - const std::vector& appids, bool is_readonly = false); - -void ValidateExternalPackageFS(const std::string& pkgid, - const std::vector& appids, - uid_t uid, gid_t gid); - -void ValidateExternalPackage(const std::string& pkgid, - const std::vector& appids); - -bool CheckPackageNonExistance(const std::string& pkgid, - const std::vector& appids); - -void CheckPackageReadonlyNonExistance(const std::string& pkgid, - const std::vector& appids); - -std::unique_ptr CreateQueryInterface(); - -std::unique_ptr CreateInstaller(ci::PkgMgrPtr pkgmgr, - PackageType type); - -void TestRollbackAfterEachStep(int argc, const char*argv[], - std::function validator, - PackageType type = PackageType::WGT); - -void CrashAfterEachStep(std::vector args, - std::function validator, - PackageType type = PackageType::WGT); - -ci::AppInstaller::Result RunInstallerWithPkgrmgr(ci::PkgMgrPtr pkgmgr, - PackageType type, - RequestResult mode); -ci::AppInstaller::Result CallBackend(int argc, - const char* argv[], - PackageType type, - RequestResult mode - = RequestResult::NORMAL); - -ci::AppInstaller::Result Install(const bf::path& path, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result InstallPreload(const bf::path& path, PackageType type, - RequestResult mode = RequestResult::NORMAL); - -bool CheckAvailableExternalPath(); - -bool CheckAvailableExtendedStorage(); - -ci::AppInstaller::Result InstallWithStorage(const bf::path& path, - PackageType type, - StorageType storage = StorageType::INTERNAL, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result MigrateLegacyExternalImage(const std::string& pkgid, - const bf::path& path, - const bf::path& legacy_path, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result MountInstall(const bf::path& path, - PackageType type, RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result Uninstall(const std::string& pkgid, - PackageType type, - bool is_preload, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result RDSUpdate(const bf::path& path, - const std::string& pkgid, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result DeltaInstall(const bf::path& path, - const bf::path& delta_package, PackageType type); - -ci::AppInstaller::Result EnablePackage(const std::string& pkgid, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result DisablePackage(const std::string& pkgid, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result Recover(const bf::path& recovery_file, - PackageType type, - RequestResult mode = RequestResult::NORMAL); - -ci::AppInstaller::Result ManifestDirectInstall(const std::string& pkgid, - PackageType type, RequestResult mode = RequestResult::NORMAL); - -bool BackupPath(const bf::path& path); - -bool RestorePath(const bf::path& path); - -std::vector SetupBackupDirectories(); - -void UninstallAllAppsInDirectory(bf::path dir, bool is_preload); - -void UninstallAllSmokeApps(ci::RequestMode request_mode); +} // namespace smoke_test -int GetAppInstalledTime(const char *appid, uid_t uid); #endif // UNIT_TESTS_SMOKE_UTILS_H_ -- 2.7.4 From 9b65ff24d909117950aa540fbd894819e0a39c19 Mon Sep 17 00:00:00 2001 From: kniedzielew Date: Fri, 20 Oct 2017 17:12:42 +0200 Subject: [PATCH 13/16] Fix in RDSMode test Sdk directory where are files used for update is changed. Submit with: https://review.tizen.org/gerrit/#/c/158034/ Change-Id: Ia2f78f1ae6e3de4ba777773bb945d76762652203 Signed-off-by: kniedzielew --- src/unit_tests/smoke_test.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index a16c667..14fda52 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -177,16 +177,12 @@ TEST_F(SmokeTest, RDSMode) { bf::path path = kSmokePackagesDirectory / "RDSMode.wgt"; std::string pkgid = "smokewgt11"; std::string appid = "smokewgt11.RDSMode"; - bf::path delta_directory = kSmokePackagesDirectory / "delta_dir/"; - bf::path sdk_expected_directory = - bf::path(ci::GetRootAppPath(false, params.test_user.uid)) / "tmp" / pkgid; - bs::error_code error; - bf::create_directories(sdk_expected_directory.parent_path(), error); - ASSERT_FALSE(error); + bf::path delta_directory = kSmokePackagesDirectory / "delta_dir"; + bf::path sdk_expected_directory = kSdkDirectory / "tmp" / pkgid; ASSERT_TRUE(ci::CopyDir(delta_directory, sdk_expected_directory)); - ASSERT_EQ(backend.RDSUpdate(path, pkgid), ci::AppInstaller::Result::OK); + ASSERT_EQ(backend.RDSUpdate(path, pkgid), + ci::AppInstaller::Result::OK); ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params)); - // Check delta modifications ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) / "res" / "wgt" / "DELETED")); -- 2.7.4 From 9fb3bf930c306a94b1f1c8eabda41aacdd2d02b0 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 7 Nov 2017 11:15:14 +0900 Subject: [PATCH 14/16] Release version 0.8.0 Changes: - Apply new library for smoke utils - Fix in RDSMode test Change-Id: I91b97c9ed7d6ae87efa545f2fd5fddb54da34450 Signed-off-by: Junghyun Yeon --- packaging/wgt-backend.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec index 5725634..d5ab402 100644 --- a/packaging/wgt-backend.spec +++ b/packaging/wgt-backend.spec @@ -1,6 +1,6 @@ Name: wgt-backend Summary: Application installer backend for WGT -Version: 0.7.5 +Version: 0.8.0 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 7c4127098a058b724ce202ab6afb367d89e85dd9 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 7 Nov 2017 09:45:22 +0900 Subject: [PATCH 15/16] Fix logic to store api version at application structure - Each application could have different api version based on pkg which it belongs to, such as hybrid pkg. - Store api version of each application into application structure to deliver it to security-manager. Related changes: [app-installers] : https://review.tizen.org/gerrit/159061 Change-Id: I80c0faa909d25d23bb152d6a715ebe3e7e832f70 Signed-off-by: Junghyun Yeon --- src/wgt/step/configuration/step_parse.cc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 05a3b5d..353cf28 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -412,6 +412,7 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { application->autorestart = strdup("false"); application->launch_mode = strdup(app_info->launch_mode().c_str()); + application->api_version = strdup(manifest->api_version); for (auto& icon : GListRange(manifest->icon)) { icon_x* app_icon = reinterpret_cast(calloc(1, sizeof(icon_x))); if (!app_icon) { @@ -460,7 +461,7 @@ bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { SetApplicationXDefaults(application); application->support_ambient = strdup("false"); application->package = strdup(manifest->package); - + application->api_version = strdup(manifest->api_version); for (auto& pair : service_info.names()) { AppendLabel(application, pair.second, pair.first); } @@ -527,7 +528,7 @@ bool StepParse::FillWidgetApplicationInfo(manifest_x* manifest) { SetApplicationXDefaults(application); application->support_ambient = strdup("false"); application->package = strdup(manifest->package); - + application->api_version = strdup(manifest->api_version); if (!app_widget.label.default_value.empty()) { AppendLabel(application, app_widget.label.default_value, std::string()); } @@ -903,18 +904,6 @@ common_installer::Step::Status StepParse::process() { backend_data->service_list.set(*service_list); } - manifest_x* manifest = - static_cast(calloc(1, sizeof(manifest_x))); - if (!manifest) { - LOG(ERROR) << "Out of memory"; - return common_installer::Step::Status::ERROR; - } - if (!FillManifestX(manifest)) { - LOG(ERROR) << "[Parse] Storing manifest_x failed. " - << parser_->GetErrorMessage(); - return common_installer::Step::Status::PARSE_ERROR; - } - // Copy data from ManifestData to InstallerContext auto info = GetManifestDataForKey( @@ -940,8 +929,20 @@ common_installer::Step::Status StepParse::process() { const std::string& package_version = wgt_info->version(); const std::string& required_api_version = info->required_version(); + manifest_x* manifest = + static_cast(calloc(1, sizeof(manifest_x))); + if (!manifest) { + LOG(ERROR) << "Out of memory"; + return common_installer::Step::Status::ERROR; + } manifest->api_version = strdup(required_api_version.c_str()); + if (!FillManifestX(manifest)) { + LOG(ERROR) << "[Parse] Storing manifest_x failed. " + << parser_->GetErrorMessage(); + return common_installer::Step::Status::PARSE_ERROR; + } + context_->pkgid.set(manifest->package); // write pkgid for recovery file -- 2.7.4 From 925d590e1d06697a4d799996df3d7883dca533b8 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Thu, 9 Nov 2017 11:23:17 +0900 Subject: [PATCH 16/16] Change name of OpenRecoveryFileForPath to OpenRecoveryFile Requires: - https://review.tizen.org/gerrit/159379 Change-Id: Iabfaf8d4a98271678a8508d318cab3c5013a51f7 Signed-off-by: Sangyoon Jang --- src/wgt/wgt_app_query_interface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wgt/wgt_app_query_interface.cc b/src/wgt/wgt_app_query_interface.cc index 87252a0..c5abeda 100644 --- a/src/wgt/wgt_app_query_interface.cc +++ b/src/wgt/wgt_app_query_interface.cc @@ -41,7 +41,7 @@ const char kTizenManifestLocation[] = "tizen-manifest.xml"; std::string ReadPkgidFromRecovery(const std::string& recovery_path) { std::unique_ptr recovery_file = - ci::recovery::RecoveryFile::OpenRecoveryFileForPath(recovery_path); + ci::recovery::RecoveryFile::OpenRecoveryFile(recovery_path); recovery_file->Detach(); return recovery_file->pkgid(); } -- 2.7.4