From bb6a49cba8cf075304d971b519809b1816bc53ad Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Tue, 7 May 2013 16:46:52 +0900 Subject: [PATCH] [Release] wrt-installer_0.1.53 --- configuration/config.tizen.xsd | 21 +- configuration/config.xml | 48 ++-- configuration/config.xsd | 7 +- packaging/wrt-installer.spec | 6 +- src/CMakeLists.txt | 2 + src/commons/wrt_common_types.h | 1 - src/commons/wrt_install_mode.h | 75 ++++++ src/configuration_parser/widget_parser.cpp | 2 +- src/jobs/job_base.h | 2 +- src/jobs/job_exception_error.h | 28 +-- src/jobs/widget_install/ace_registration.cpp | 98 ++++++++ src/jobs/widget_install/ace_registration.h | 1 + src/jobs/widget_install/directory_api.cpp | 79 +++++++ src/jobs/widget_install/directory_api.h | 32 +++ src/jobs/widget_install/job_widget_install.cpp | 111 +++------ src/jobs/widget_install/job_widget_install.h | 3 - src/jobs/widget_install/task_ace_check.cpp | 6 +- src/jobs/widget_install/task_certify.cpp | 8 +- src/jobs/widget_install/task_commons.h | 2 +- src/jobs/widget_install/task_database.cpp | 27 ++- src/jobs/widget_install/task_database.h | 2 + src/jobs/widget_install/task_file_manipulation.cpp | 22 +- src/jobs/widget_install/task_install_ospsvc.cpp | 38 ++++ src/jobs/widget_install/task_install_ospsvc.h | 1 + src/jobs/widget_install/task_manifest_file.cpp | 32 +-- src/jobs/widget_install/task_prepare_reinstall.cpp | 2 +- src/jobs/widget_install/task_remove_backup.cpp | 29 ++- src/jobs/widget_install/task_remove_backup.h | 1 + src/jobs/widget_install/task_smack.cpp | 8 +- src/jobs/widget_install/task_update_files.cpp | 253 ++------------------- src/jobs/widget_install/task_update_files.h | 11 +- src/jobs/widget_install/widget_install_context.h | 2 + src/jobs/widget_install/widget_install_errors.h | 1 + src/jobs/widget_install/widget_installer_struct.h | 21 +- src/misc/widget_location.cpp | 27 ++- src/misc/widget_location.h | 15 +- src/pkg-manager/backendlib.cpp | 7 +- .../installer_callbacks_translate.cpp | 16 ++ src/wrt-installer/wrt-installer.cpp | 74 ++++-- src/wrt-installer/wrt-installer.h | 3 +- src/wrt-installer/wrt_installer_api.cpp | 43 +--- src/wrt-installer/wrt_installer_api.h | 20 +- src/wrt-installer/wrt_type.h | 44 ++-- tests/general/CMakeLists.txt | 4 +- tests/general/InstallerWrapper.cpp | 36 ++- tests/general/InstallerWrapper.h | 1 - tests/general/ManifestTests.cpp | 42 +++- tests/general/NPluginsInstallTests.cpp | 31 --- ...ceTests.cpp => ParsingTizenAppcontrolTests.cpp} | 45 ++-- .../{appservice_dispos.wgt => app-control.wgt} | Bin 5234 -> 5288 bytes tests/general/widgets/bg-00-with_bg.wgt | Bin 736 -> 862 bytes tests/general/widgets/bg-01-missing_file.wgt | Bin 583 -> 766 bytes tests/general/widgets/bg-02-without_bg.wgt | Bin 567 -> 725 bytes tests/general/widgets/inst_nplug_1.wgt | Bin 1610 -> 1354 bytes tests/general/widgets/inst_nplug_2.wgt | Bin 1079 -> 985 bytes tests/general/widgets/inst_nplug_3.wgt | Bin 1425 -> 1222 bytes tests/general/widgets/inst_nplug_4.wgt | Bin 1420 -> 1104 bytes tests/general/widgets/manifest.wgt | Bin 1386 -> 1615 bytes tests/general/widgets/nonroot.wgt | Bin 5563 -> 5855 bytes tests/general/widgets/tizen_app-control/config.xml | 28 +++ .../icon.png | Bin .../index.htm | 0 .../tizen_appservice_disposition/config.xml | 12 - 63 files changed, 777 insertions(+), 653 deletions(-) create mode 100644 src/commons/wrt_install_mode.h create mode 100644 src/jobs/widget_install/directory_api.cpp create mode 100644 src/jobs/widget_install/directory_api.h rename tests/general/{ParsingTizenAppserviceTests.cpp => ParsingTizenAppcontrolTests.cpp} (62%) rename tests/general/widgets/{appservice_dispos.wgt => app-control.wgt} (83%) create mode 100644 tests/general/widgets/tizen_app-control/config.xml rename tests/general/widgets/{tizen_appservice_disposition => tizen_app-control}/icon.png (100%) rename tests/general/widgets/{tizen_appservice_disposition => tizen_app-control}/index.htm (100%) delete mode 100755 tests/general/widgets/tizen_appservice_disposition/config.xml diff --git a/configuration/config.tizen.xsd b/configuration/config.tizen.xsd index b2293d1..72addb1 100644 --- a/configuration/config.tizen.xsd +++ b/configuration/config.tizen.xsd @@ -2,7 +2,6 @@ - @@ -30,6 +29,7 @@ + @@ -120,6 +120,16 @@ + + + + + + + + + + @@ -131,12 +141,7 @@ - - - - - - + @@ -168,6 +173,7 @@ + @@ -214,5 +220,4 @@ - diff --git a/configuration/config.xml b/configuration/config.xml index 3e5dc15..9968071 100755 --- a/configuration/config.xml +++ b/configuration/config.xml @@ -1,36 +1,26 @@ - - - - - - - - - - - - - - - - - - - - hello + + hello - - - - - - + - - - + + + + + + + + + + + + "img-src http://test.com 'unsafe-inline'; script-src 'unsafe-inline';" + img-src http://test.com 'unsafe-inline'; script-src 'unsafe-inline'; + + + test.com diff --git a/configuration/config.xsd b/configuration/config.xsd index 6a9443e..4d7a823 100644 --- a/configuration/config.xsd +++ b/configuration/config.xsd @@ -74,10 +74,13 @@ - + + + + - + diff --git a/packaging/wrt-installer.spec b/packaging/wrt-installer.spec index fdb0340..bc8c952 100644 --- a/packaging/wrt-installer.spec +++ b/packaging/wrt-installer.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt-installer wrt-installer 0.1.49 +#git:framework/web/wrt-installer wrt-installer_0.1.53 Name: wrt-installer Summary: Installer for tizen Webruntime -Version: 0.1.49 +Version: 0.1.53 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 @@ -28,6 +28,7 @@ BuildRequires: pkgconfig(libpcrecpp) BuildRequires: pkgconfig(pkgmgr-installer) BuildRequires: pkgconfig(pkgmgr-parser) BuildRequires: pkgconfig(pkgmgr-types) +BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(pkgmgr) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(cert-svc) @@ -43,6 +44,7 @@ BuildRequires: pkgconfig(libprivilege-control) BuildRequires: pkgconfig(osp-appfw) BuildRequires: osp-appfw-internal-devel Requires: osp-appfw +Requires: osp-installer Requires: xmlsec1 %description diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e33b52..03997c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -81,6 +81,7 @@ SET(INSTALLER_SOURCES ${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp ${INSTALLER_JOBS}/widget_install/wac_security.cpp ${INSTALLER_JOBS}/widget_install/widget_update_info.cpp + ${INSTALLER_JOBS}/widget_install/directory_api.cpp ${INSTALLER_JOBS}/widget_uninstall/job_widget_uninstall.cpp ${INSTALLER_JOBS}/widget_uninstall/task_check.cpp ${INSTALLER_JOBS}/widget_uninstall/task_remove_files.cpp @@ -122,6 +123,7 @@ PKG_CHECK_MODULES(INSTALLER_STATIC_DEP wrt-plugins-types pkgmgr-installer pkgmgr-parser + pkgmgr-info web-provider osp-appfw REQUIRED diff --git a/src/commons/wrt_common_types.h b/src/commons/wrt_common_types.h index f888c85..965db9c 100644 --- a/src/commons/wrt_common_types.h +++ b/src/commons/wrt_common_types.h @@ -42,7 +42,6 @@ enum InstallLocationType { INSTALL_LOCATION_TYPE_UNKNOWN = 0, INSTALL_LOCATION_TYPE_NOMAL, - INSTALL_LOCATION_TYPE_PRELOAD, INSTALL_LOCATION_TYPE_EXTERNAL }; diff --git a/src/commons/wrt_install_mode.h b/src/commons/wrt_install_mode.h new file mode 100644 index 0000000..a545f9c --- /dev/null +++ b/src/commons/wrt_install_mode.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file wrt_install_mode.h + * @author Jihoon Chung (jihoon.chung@samgsung.com) + * @version + * @brief Definition file of widget install mode class + */ + +#ifndef WRT_INSTALL_MODE_H +#define WRT_INSTALL_MODE_H + +class InstallMode +{ + public: + enum class Command + { + INSTALL, + REINSTALL + }; + enum class Location + { + INTERNAL, + EXTERNAL + }; + enum class RootPath + { + RW, + RO + }; + enum class ExtensionType + { + WGT, + DIR + }; + enum class InstallTime + { + NORMAL, + PRELOAD + }; + + InstallMode(Command cmd = Command::INSTALL, + Location lo = Location::INTERNAL, + RootPath root = RootPath::RW, + ExtensionType extensionType = ExtensionType::WGT, + InstallTime time = InstallTime::NORMAL) : + command(cmd), + location(lo), + rootPath(root), + extension(extensionType), + installTime(time) + {}; + + Command command; + Location location; + RootPath rootPath; + ExtensionType extension; + InstallTime installTime; +}; + +#endif // WRT_INSTALL_MODE_H + diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 289e30d..6433176 100644 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -1352,7 +1352,7 @@ class ApplicationParser : public ElementParser }; const char* const ApplicationParser::REGEXP_PACKAGE = "[0-9A-Za-z]{10}"; -const char* const ApplicationParser::REGEXP_ID = "([0-9A-Za-z]{10})\\..{2,52}"; +const char* const ApplicationParser::REGEXP_ID = "([0-9A-Za-z]{10})\\.[0-9A-Za-z]{2,52}"; const char* const ApplicationParser::REGEXP_VERSION = "\\d+\\.\\d+(\\.\\d+)?"; class SplashParser : public ElementParser diff --git a/src/jobs/job_base.h b/src/jobs/job_base.h index c2ed1d8..bb0bbf1 100644 --- a/src/jobs/job_base.h +++ b/src/jobs/job_base.h @@ -59,7 +59,7 @@ class JobProgressBase ProgressDescription const &description) { m_progresPercent = - ((static_cast(step) + 1.0) / + ((static_cast(step)) / static_cast(lastElement)) * 100; m_progresDescription = description; } diff --git a/src/jobs/job_exception_error.h b/src/jobs/job_exception_error.h index 52a98a1..9aebb74 100644 --- a/src/jobs/job_exception_error.h +++ b/src/jobs/job_exception_error.h @@ -42,29 +42,31 @@ enum Type ErrorPackageNotFound, ///< ErrorPackageInvalid, ///< invalid widget package ErrorPackageLowerVersion, ///< given version is lower - ///< than existing version - ErrorManifestNotFound, ///< + ErrorPackageExecutableNotFound, + + ErrorManifestNotFound = 11, ///< ErrorManifestInvalid, ///< ErrorConfigNotFound, ///< couldn't find config.xml - ///< in package. ErrorConfigInvalid, ///< invalid config.xml - ErrorSignatureNotFound, ///< signature file not exist. + + ErrorSignatureNotFound = 21, ///< signature file not exist. ErrorSignatureInvalid, ///< invalid signature file ErrorSignatureVerificationFailed, ///< failure in verificate ///< signature - ErrorRootCertificateNotFound, ///< couldn't find root - ///< certificate. + ErrorRootCertificateNotFound = 31, ///< couldn't find root ErrorCertificationInvaid, ///< invalid certification ErrorCertificateChainVerificationFailed, ///< failure in verificate - ///< certification chain. ErrorCertificateExpired, ///< expire cerification. - ErrorInvalidPrivilege, ///< invalid privilege. - ErrorMenuIconNotFound, ///< - ErrorFatalError, ///< failure in db operation - ///< or file opertion.. - ErrorOutOfStorage, ///< failure in shortage of - ///< memory + + ErrorInvalidPrivilege = 41, ///< invalid privilege. + ErrorPrivilegeLevelViolation, + + ErrorMenuIconNotFound = 51, ///< + + ErrorFatalError = 61, ///< failure in db operation + ErrorOutOfStorage, ///< failure in shortage of memory ErrorOutOfMemory, ///< failure in shortage of RAM + ErrorArgumentInvalid, /* wrt-installer error */ /* 121-140 : reserved for Web installer */ diff --git a/src/jobs/widget_install/ace_registration.cpp b/src/jobs/widget_install/ace_registration.cpp index e2077ef..ac266d1 100644 --- a/src/jobs/widget_install/ace_registration.cpp +++ b/src/jobs/widget_install/ace_registration.cpp @@ -137,4 +137,102 @@ bool registerAceWidget(const WrtDB::DbWidgetHandle& widgetHandle, delete[] certData; return retval == ACE_OK; } +bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle) +{ + using namespace WrtDB; + LogDebug("Updating Ace database from Widget DB"); + struct widget_info wi; + DPL::OptionalString os; + WrtDB::WidgetCertificateDataList certList; + + Try { + WidgetDAOReadOnly dao(widgetHandle); + + WidgetType type = dao.getWidgetType(); + if (type == WrtDB::APP_TYPE_WAC20) { + wi.type = WAC20; + } else if (type == WrtDB::APP_TYPE_TIZENWEBAPP) { + wi.type = Tizen; + } else { + LogError("Unknown application type"); + return false; + } + + wi.id = toAceString(dao.getGUID()); + wi.version = toAceString(dao.getVersion()); + wi.author = toAceString(dao.getAuthorName()); + wi.shareHerf = strdup(dao.getShareHref().c_str()); + LogDebug("Basic data converted. Certificates begin."); + certList = dao.getCertificateDataList(); + } + Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) { + LogError("Widget does not exist"); + return false; + } + + //one more element for NULL termination + LogDebug("Found: " << certList.size() << " certificates"); + ace_certificate_data** certData = new ace_certificate_data * + [certList.size() + 1]; + certData[certList.size()] = NULL; // last element set to NULL + + int i = 0; + FOREACH(it, certList) + { + certData[i] = new ace_certificate_data; + switch (it->owner) { + case WrtDB::WidgetCertificateData::AUTHOR: + certData[i]->owner = AUTHOR; + break; + case WrtDB::WidgetCertificateData::DISTRIBUTOR: + certData[i]->owner = DISTRIBUTOR; + break; + default: + LogDebug("Unknown owner type of cert"); + certData[i]->owner = UNKNOWN; + break; + } + switch (it->type) { + case WrtDB::WidgetCertificateData::ENDENTITY: + certData[i]->type = ENDENTITY; + break; + case WrtDB::WidgetCertificateData::ROOT: + certData[i]->type = ROOT; + break; + default: + LogError("Unknown type of cert"); + certData[i]->type = ENDENTITY; + break; + } + certData[i]->chain_id = it->chainId; + + certData[i]->md5_fp = toAceString(it->strMD5Fingerprint); + certData[i]->sha1_fp = toAceString(it->strSHA1Fingerprint); + certData[i]->common_name = + toAceString(DPL::ToUTF8String(it->strCommonName)); + ++i; + } + + LogDebug("Registerign widget in ace"); + ace_return_t retval = ace_register_widget( + static_cast(widgetHandle), &wi, certData); + + //clean up - WidgetInfo + free(wi.author); + free(wi.id); + free(wi.shareHerf); + free(wi.version); + + //free cert list + i = 0; + while (certData[i] != NULL) { + free(certData[i]->common_name); + free(certData[i]->md5_fp); + free(certData[i]->sha1_fp); + delete certData[i]; + ++i; + } + delete[] certData; + return retval == ACE_OK; +} } diff --git a/src/jobs/widget_install/ace_registration.h b/src/jobs/widget_install/ace_registration.h index a9e0577..f98c3ce 100644 --- a/src/jobs/widget_install/ace_registration.h +++ b/src/jobs/widget_install/ace_registration.h @@ -28,6 +28,7 @@ namespace AceApi { bool registerAceWidget(const WrtDB::DbWidgetHandle& widgetHandle, const WrtDB::WidgetRegisterInfo& widgetConfig, const WrtDB::WidgetCertificateDataList& certList); +bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle); } #endif /* WRT_SRC_INSTALLER_CORE_ACE_REGISTRATION_H_ */ diff --git a/src/jobs/widget_install/directory_api.cpp b/src/jobs/widget_install/directory_api.cpp new file mode 100644 index 0000000..678ec1d --- /dev/null +++ b/src/jobs/widget_install/directory_api.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file directory_api.cpp + * @author Soyoung Kim(sy037.kim@samsung.com) + * @version 1.0 + * @brief directory api - implementation file + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace DirectoryApi { +bool DirectoryCopy(std::string source, std::string dest) +{ + DIR* dir = opendir(source.c_str()); + if (NULL == dir) { + return false; + } + + struct dirent dEntry; + struct dirent *dEntryResult; + int return_code; + + do { + struct stat statInfo; + return_code = readdir_r(dir, &dEntry, &dEntryResult); + if (dEntryResult != NULL && return_code == 0) { + std::string fileName = dEntry.d_name; + std::string fullName = source + "/" + fileName; + + if (stat(fullName.c_str(), &statInfo) != 0) { + closedir(dir); + return false; + } + + if (S_ISDIR(statInfo.st_mode)) { + if (("." == fileName) || (".." == fileName)) { + continue; + } + std::string destFolder = dest + "/" + fileName; + WrtUtilMakeDir(destFolder); + + if (!DirectoryCopy(fullName, destFolder)) { + closedir(dir); + return false; + } + } + + std::string destFile = dest + "/" + fileName; + std::ifstream infile(fullName); + std::ofstream outfile(destFile); + outfile << infile.rdbuf(); + outfile.close(); + infile.close(); + } + } while (dEntryResult != NULL && return_code == 0); + closedir(dir); + return true; +} +} diff --git a/src/jobs/widget_install/directory_api.h b/src/jobs/widget_install/directory_api.h new file mode 100644 index 0000000..1632528 --- /dev/null +++ b/src/jobs/widget_install/directory_api.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file directory_api.h + * @author Soyoung Kim(sy037.kim@samsung.com) + * @version 1.0 + * @brief directory api - header file + */ +#ifndef WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_ +#define WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_ + +#include + +namespace DirectoryApi { +bool DirectoryCopy(std::string source, std::string dest); +} + +#endif /* WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_ */ + diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index d733180..aa46a4e 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -162,6 +162,7 @@ JobWidgetInstall::JobWidgetInstall( JobContextBase(installerStruct), m_exceptionCaught(Jobs::Exceptions::Success) { + m_installerContext.mode = m_jobStruct.m_installMode; ConfigureResult result = PrePareInstallation(widgetPath); if (result == ConfigureResult::Ok) { @@ -208,8 +209,8 @@ JobWidgetInstall::JobWidgetInstall( LogInfo("Widget Update"); m_installerContext.job->SetProgressFlag(true); - if (m_jobStruct.m_installMode == - InstallMode::REINSTALL_MODE_DIRECTORY) + if (m_installerContext.mode.command == + InstallMode::Command::REINSTALL) { AddTask(new TaskPrepareReinstall(m_installerContext)); } @@ -240,6 +241,7 @@ JobWidgetInstall::JobWidgetInstall( WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) { AddTask(new TaskUpdateFiles(m_installerContext)); + AddTask(new TaskFileManipulation(m_installerContext)); } AddTask(new TaskManifestFile(m_installerContext)); @@ -248,17 +250,14 @@ JobWidgetInstall::JobWidgetInstall( { AddTask(new TaskInstallOspsvc(m_installerContext)); } - if (m_installerContext.widgetConfig.packagingType != - WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) - { - AddTask(new TaskRemoveBackupFiles(m_installerContext)); - } + AddTask(new TaskCertificates(m_installerContext)); AddTask(new TaskDatabase(m_installerContext)); AddTask(new TaskAceCheck(m_installerContext)); //TODO: remove widgetHandle from this task and move before database task // by now widget handle is needed in ace check // Any error in acecheck while update will break widget AddTask(new TaskSmack(m_installerContext)); + AddTask(new TaskRemoveBackupFiles(m_installerContext)); } else if (result == ConfigureResult::Deferred) { // Installation is deferred LogInfo("Configure installation deferred"); @@ -284,9 +283,7 @@ ConfigureResult JobWidgetInstall::PrePareInstallation( Try { std::string tempDir; - if (m_jobStruct.m_installMode == - InstallMode::REINSTALL_MODE_DIRECTORY) - { + if (m_installerContext.mode.extension == InstallMode::ExtensionType::DIR) { std::ostringstream tempPathBuilder; tempPathBuilder << WrtDB::GlobalConfig::GetUserInstalledWidgetPath(); tempPathBuilder << WrtDB::GlobalConfig::GetTmpDirPath(); @@ -296,8 +293,8 @@ ConfigureResult JobWidgetInstall::PrePareInstallation( } else { tempDir = Jobs::WidgetInstall::createTempPath( - m_jobStruct.m_installMode == - InstallMode::INSTALL_MODE_PRELOAD); + m_installerContext.mode.rootPath == + InstallMode::RootPath::RO); } m_isDRM = isDRMWidget(widgetPath); @@ -318,8 +315,7 @@ ConfigureResult JobWidgetInstall::PrePareInstallation( tempDir, m_installerContext.widgetConfig.packagingType, m_isDRM, - m_jobStruct.m_installMode == - InstallMode::REINSTALL_MODE_DIRECTORY); + m_installerContext.mode.command == InstallMode::Command::REINSTALL); LogDebug("widget packaging type : " << m_installerContext.widgetConfig.packagingType.pkgType); @@ -447,24 +443,13 @@ void JobWidgetInstall::setTizenId( void JobWidgetInstall::configureWidgetLocation(const std::string & widgetPath, const std::string& tempPath) { - if (m_jobStruct.m_installMode == - InstallMode::REINSTALL_MODE_DIRECTORY) - { - // replace widget path to installed path - m_installerContext.locations = - WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig. - tzPkgid), - widgetPath, tempPath, - m_installerContext.widgetConfig.packagingType, - m_installerContext.locationType); - } else { - m_installerContext.locations = - WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig. - tzPkgid), - widgetPath, tempPath, - m_installerContext.widgetConfig.packagingType, - m_installerContext.locationType); - } + m_installerContext.locations = + WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig. + tzPkgid), + widgetPath, tempPath, + m_installerContext.widgetConfig.packagingType, + m_installerContext.mode.rootPath == + InstallMode::RootPath::RO); m_installerContext.locations->registerAppid( DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid)); @@ -570,13 +555,14 @@ bool JobWidgetInstall::validateTizenPackageID( ConfigureResult JobWidgetInstall::checkWidgetUpdate( const WidgetUpdateInfo &update) { - LogInfo("incoming version = '" << update.incomingVersion); - LogInfo("Tizen AppID = " << update.tzAppId); - if (update.existingVersion.IsNull() || update.incomingVersion.IsNull()) { return ConfigureResult::Failed; } + LogInfo("existing version = '" << update.existingVersion); + LogInfo("incoming version = '" << update.incomingVersion); + LogInfo("Tizen AppID = " << update.tzAppId); + // Check running state bool isRunning = false; int ret = @@ -637,47 +623,15 @@ ConfigureResult JobWidgetInstall::checkWidgetUpdate( m_installerContext.widgetConfig.tzAppid = update.tzAppId; - if (isUpperVersion(update.existingVersion, update.incomingVersion) || - (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY) || - (m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY)) - { - LogInfo("Whether widget policy allow proceed ok"); + if (!!update.existingVersion || + m_installerContext.mode.extension == + InstallMode::ExtensionType::DIR) { return ConfigureResult::Updated; - } else { - return ConfigureResult::Failed_LowerVersion; } return ConfigureResult::Failed; } -bool JobWidgetInstall::isUpperVersion( - const OptionalWidgetVersion &existingVersion, - const OptionalWidgetVersion &incomingVersion) -{ - LogInfo("Existing version = '" << *existingVersion); - LogInfo("Incoming version = '" << *incomingVersion); - - if (!existingVersion && !incomingVersion) { - return false; - } else if (!existingVersion && !!incomingVersion) { - return false; - } else if (!!existingVersion && !incomingVersion) { - return true; - } else { - if (!existingVersion->IsWac() || !incomingVersion->IsWac()) { - return false; - } else { - if (*incomingVersion == *existingVersion) { - return false; - } else if (*incomingVersion > *existingVersion) { - return true; - } else { - return false; - } - } - } -} - ConfigParserData JobWidgetInstall::getWidgetDataFromXML( const std::string &widgetSource, const std::string &tempPath, @@ -991,9 +945,7 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType( const std::string &tempPath) { // Check installation type (direcotory/ or config.xml or widget.wgt) - if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY || - m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY) - { + if (m_installerContext.mode.extension == InstallMode::ExtensionType::DIR) { LogDebug("Install directly from directory"); return PKG_TYPE_DIRECTORY_WEB_APP; } @@ -1123,18 +1075,11 @@ bool JobWidgetInstall::detectResourceEncryption( } void JobWidgetInstall::setInstallLocationType( - const - WrtDB::ConfigParserData & - configData) + const WrtDB::ConfigParserData & configData) { m_installerContext.locationType = INSTALL_LOCATION_TYPE_NOMAL; - - if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_PRELOAD) { - m_installerContext.locationType = - INSTALL_LOCATION_TYPE_PRELOAD; - } else { - FOREACH(it, configData.settingsList) - { + if (m_installerContext.mode.installTime != InstallMode::InstallTime::PRELOAD) { + FOREACH(it, configData.settingsList) { if (it->m_name == SETTING_VALUE_INSTALLTOEXT_NAME && it->m_value == SETTING_VALUE_INSTALLTOEXT_PREPER_EXT) diff --git a/src/jobs/widget_install/job_widget_install.h b/src/jobs/widget_install/job_widget_install.h index f0af6f2..549c80d 100644 --- a/src/jobs/widget_install/job_widget_install.h +++ b/src/jobs/widget_install/job_widget_install.h @@ -79,9 +79,6 @@ class JobWidgetInstall : static WidgetUpdateInfo detectWidgetUpdate( const WrtDB::ConfigParserData &configInfo, const WrtDB::TizenAppId &tizenId); - bool isUpperVersion( - const OptionalWidgetVersion &existingVersion, - const OptionalWidgetVersion &incomingVersion); void setTizenId(const WrtDB::ConfigParserData &configInfo); void displayWidgetInfo(); void configureWidgetLocation(const std::string & widgetPath, diff --git a/src/jobs/widget_install/task_ace_check.cpp b/src/jobs/widget_install/task_ace_check.cpp index b8e4c70..b3d7e4a 100644 --- a/src/jobs/widget_install/task_ace_check.cpp +++ b/src/jobs/widget_install/task_ace_check.cpp @@ -76,9 +76,7 @@ void TaskAceCheck::StepAceCheck() ace_policy_result_t policyResult = ACE_DENY; //TODO: remove dao.getHandle() - if (m_context.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) { LogDebug("This widget is prealoaded. So ace check will be skiped"); policyResult = ACE_PERMIT; } else { @@ -189,7 +187,7 @@ void TaskAceCheck::StepCheckAceResponse() if (m_context.featureLogic->isRejected()) { LogError("Installation failure. Some devCap was not accepted by ACE."); ThrowMsg( - Exceptions::AceCheckFailed, + Exceptions::PrivilegeLevelViolation, "Instalation failure. " "Some deviceCap was not accepted by ACE."); } diff --git a/src/jobs/widget_install/task_certify.cpp b/src/jobs/widget_install/task_certify.cpp index 128f022..edf9f1d 100644 --- a/src/jobs/widget_install/task_certify.cpp +++ b/src/jobs/widget_install/task_certify.cpp @@ -253,13 +253,9 @@ void TaskCertify::stepSignature() result = validator.check(data, widgetPath); - if (m_contextData.widgetConfig.packagingType - == WrtDB::PKG_TYPE_DIRECTORY_WEB_APP || - m_contextData.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) + if (m_contextData.mode.installTime + == InstallMode::InstallTime::PRELOAD) { - // In directory installation mode, the validation is skipped. - result = WrtSignatureValidator::SIGNATURE_VERIFIED; } diff --git a/src/jobs/widget_install/task_commons.h b/src/jobs/widget_install/task_commons.h index c87541d..caf9660 100644 --- a/src/jobs/widget_install/task_commons.h +++ b/src/jobs/widget_install/task_commons.h @@ -28,7 +28,7 @@ namespace Jobs { namespace WidgetInstall { //TODO make directory like jobs common? -std::string createTempPath(bool preload = false); +std::string createTempPath(bool isReadOnly = false); void createTempPath(const std::string& path); } // WidgetInstall } // Jobs diff --git a/src/jobs/widget_install/task_database.cpp b/src/jobs/widget_install/task_database.cpp index 0258359..a7b405b 100644 --- a/src/jobs/widget_install/task_database.cpp +++ b/src/jobs/widget_install/task_database.cpp @@ -65,6 +65,7 @@ TaskDatabase::TaskDatabase(InstallerContext& context) : AddStep(&TaskDatabase::StepLiveboxDBInsert); AddAbortStep(&TaskDatabase::StepAbortDBInsert); + AddAbortStep(&TaskDatabase::StepAbortAceDBInsert); } void TaskDatabase::StepWrtDBInsert() @@ -80,6 +81,11 @@ void TaskDatabase::StepWrtDBInsert() { m_handleToRemove = WidgetDAOReadOnly::getHandle( m_context.widgetConfig.tzAppid); + + std::string makeAppid = + DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + "." + + "backup"; + m_backAppId = DPL::FromUTF8String(makeAppid); } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) { @@ -88,7 +94,9 @@ void TaskDatabase::StepWrtDBInsert() ThrowMsg(Exceptions::DatabaseFailure, "Given tizenId not found for update installation"); } - WidgetDAO::registerOrUpdateWidget( + + WidgetDAO::backupAndUpdateWidget( + m_backAppId, m_context.widgetConfig.tzAppid, m_context.widgetConfig, m_context.wacSecurity); @@ -255,6 +263,9 @@ void TaskDatabase::StepCreateVconf() WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage( m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON; vconfData[ + WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage( + m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON; + vconfData[ WrtDB::VconfConfig::GetVconfKeyMemorySavingMode( m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_OFF; @@ -280,13 +291,19 @@ void TaskDatabase::StepAbortDBInsert() LogWarning("[DB Update Task] Aborting... (DB Clean)"); Try { - WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid); + WidgetDAO::restoreUpdateWidget(m_backAppId, + m_context.widgetConfig.tzAppid); LogDebug("Cleaning DB successful!"); } Catch(DPL::DB::SqlConnection::Exception::Base) { LogError("Failed to handle StepAbortDBClean!"); } +} + +void TaskDatabase::StepAbortAceDBInsert() +{ + LogWarning("[DB Update Task] ACE DB Aborting... (DB Clean)"); ace_unregister_widget(static_cast(m_handle)); // Remove also old one. If it was already updated nothing wrong will happen, @@ -294,6 +311,12 @@ void TaskDatabase::StepAbortDBInsert() if (INVALID_WIDGET_HANDLE != m_handleToRemove) { ace_unregister_widget(static_cast(m_handle)); } + + if (!AceApi::registerAceWidgetFromDB(m_handleToRemove)) + { + LogError("ace database restore failed"); + } + LogDebug("Ace data inserted"); } void TaskDatabase::StepLiveboxDBInsert() diff --git a/src/jobs/widget_install/task_database.h b/src/jobs/widget_install/task_database.h index 3e0beba..88d99e9 100644 --- a/src/jobs/widget_install/task_database.h +++ b/src/jobs/widget_install/task_database.h @@ -43,6 +43,7 @@ class TaskDatabase : //of widget handle WrtDB::DbWidgetHandle m_handleToRemove; WrtDB::DbWidgetHandle m_handle; + WrtDB::TizenAppId m_backAppId; void StepRegisterExternalFiles(); void StepWrtDBInsert(); @@ -53,6 +54,7 @@ class TaskDatabase : void StepLiveboxDBInsert(); void StepAbortDBInsert(); + void StepAbortAceDBInsert(); public: TaskDatabase(InstallerContext& context); diff --git a/src/jobs/widget_install/task_file_manipulation.cpp b/src/jobs/widget_install/task_file_manipulation.cpp index 4e25780..e32607b 100644 --- a/src/jobs/widget_install/task_file_manipulation.cpp +++ b/src/jobs/widget_install/task_file_manipulation.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -149,13 +150,13 @@ TaskFileManipulation::TaskFileManipulation(InstallerContext& context) : m_context.locationType) { AddStep(&TaskFileManipulation::StepCreateDirs); - AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir); if (m_context.widgetConfig.packagingType != WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) { AddStep(&TaskFileManipulation::StepRenamePath); AddAbortStep(&TaskFileManipulation::StepAbortRenamePath); } + AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir); AddStep(&TaskFileManipulation::StepLinkForPreload); } else { @@ -186,9 +187,7 @@ void TaskFileManipulation::StepCreateDirs() LogDebug("Create resource directory"); WrtUtilMakeDir(widgetBinPath); WrtUtilMakeDir(widgetSrcPath); - if (m_context.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) { std::string userWidgetDir = m_context.locations->getUserDataRootDir(); WrtUtilMakeDir(userWidgetDir); } @@ -204,6 +203,17 @@ void TaskFileManipulation::StepCreatePrivateStorageDir() std::string storagePath = m_context.locations->getPrivateStorageDir(); LogDebug("Create private storage directory : " << m_context.locations->getPrivateStorageDir()); + + if (m_context.isUpdateMode) { //update + std::string backData = m_context.locations->getBackupPrivateDir(); + LogDebug("copy private storage " << backData << " to " << storagePath); + WrtUtilMakeDir(storagePath); + if (!DirectoryApi::DirectoryCopy(backData, storagePath)) { + LogError("Failed to rename " << backData << " to " << storagePath); + ThrowMsg(Exceptions::BackupFailed, + "Error occurs copy private strage files"); + } + } changeOwnerForDirectory(storagePath); } @@ -236,9 +246,7 @@ void TaskFileManipulation::StepRenamePath() void TaskFileManipulation::StepLinkForPreload() { - if (m_context.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.rootPath == InstallMode::RootPath::RO) { std::string srcDir = m_context.locations->getUserDataRootDir() + WrtDB::GlobalConfig::GetWidgetSrcPath(); diff --git a/src/jobs/widget_install/task_install_ospsvc.cpp b/src/jobs/widget_install/task_install_ospsvc.cpp index 7909c26..30c8101 100644 --- a/src/jobs/widget_install/task_install_ospsvc.cpp +++ b/src/jobs/widget_install/task_install_ospsvc.cpp @@ -24,6 +24,9 @@ #include #include +#include +#include +#include #include #include #include @@ -48,6 +51,7 @@ TaskInstallOspsvc::TaskInstallOspsvc(InstallerContext& context) : m_context(context) { AddStep(&TaskInstallOspsvc::StepInstallOspService); + AddStep(&TaskInstallOspsvc::StepUpdateManifestFile); } void TaskInstallOspsvc::StepInstallOspService() @@ -93,5 +97,39 @@ void TaskInstallOspsvc::StepInstallOspService() InstallerContext::INSTALL_INSTALL_OSPSVC, "Installed Osp servcie"); } + +void TaskInstallOspsvc::StepUpdateManifestFile() +{ + std::string pkgid = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid); + pkgmgrinfo_pkginfo_h handle; + + int ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid.c_str(), &handle); + if (ret != PMINFO_R_OK) { + LogDebug("StepUpdateManifestFile"); + std::ostringstream manifest_file; + if (m_context.mode.rootPath == InstallMode::RootPath::RO) { + manifest_file << "/usr/share/packages/"; //TODO constant with path + } else { + manifest_file << "/opt/share/packages/"; //TODO constant with path + } + manifest_file << pkgid; + manifest_file << ".xml"; + LogDebug("manifest file : " << manifest_file.str()); + + int ret = pkgmgr_parser_parse_manifest_for_uninstallation( + manifest_file.str().c_str(), NULL); + + if (ret != 0) { + LogError("Manifest parser error: " << ret); + } + + int code = pkgmgr_parser_parse_manifest_for_installation( + manifest_file.str().c_str(), NULL); + + if (code != 0) { + LogError("Manifest parser error: " << code); + } + } +} } //namespace WidgetInstall } //namespace Jobs diff --git a/src/jobs/widget_install/task_install_ospsvc.h b/src/jobs/widget_install/task_install_ospsvc.h index 445bfb4..819a1b0 100644 --- a/src/jobs/widget_install/task_install_ospsvc.h +++ b/src/jobs/widget_install/task_install_ospsvc.h @@ -36,6 +36,7 @@ class TaskInstallOspsvc : public DPL::TaskDecl InstallerContext &m_context; void StepInstallOspService(); + void StepUpdateManifestFile(); void StepAbortInstall(); diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp index 7074609..7c3e165 100644 --- a/src/jobs/widget_install/task_manifest_file.cpp +++ b/src/jobs/widget_install/task_manifest_file.cpp @@ -111,6 +111,7 @@ TaskManifestFile::TaskManifestFile(InstallerContext &inCont) : // for widget update. AddStep(&TaskManifestFile::stepBackupIconFiles); AddStep(&TaskManifestFile::stepCopyIconFiles); + AddStep(&TaskManifestFile::stepCreateExecFile); AddStep(&TaskManifestFile::stepGenerateManifest); AddStep(&TaskManifestFile::stepParseUpgradedManifest); AddStep(&TaskManifestFile::stepUpdateFinalize); @@ -307,8 +308,7 @@ void TaskManifestFile::stepBackupIconFiles() { LogDebug("Backup Icon Files"); - backup_dir << m_context.locations->getPackageInstallationDir(); - backup_dir << "/" << "backup" << "/"; + backup_dir << m_context.locations->getBackupDir() << "/"; backupIconFiles(); @@ -544,18 +544,22 @@ void TaskManifestFile::stepParseManifest() void TaskManifestFile::stepParseUpgradedManifest() { - int code = pkgmgr_parser_parse_manifest_for_upgrade( - DPL::ToUTF8String(manifest_file).c_str(), NULL); + if (m_context.widgetConfig.packagingType != + PKG_TYPE_HYBRID_WEB_APP) + { + int code = pkgmgr_parser_parse_manifest_for_upgrade( + DPL::ToUTF8String(manifest_file).c_str(), NULL); - if (code != 0) { - LogError("Manifest parser error: " << code); - ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code); - } + if (code != 0) { + LogError("Manifest parser error: " << code); + ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code); + } - m_context.job->UpdateProgress( - InstallerContext::INSTALL_CREATE_MANIFEST, - "Widget Manifest Parsing Finished"); - LogDebug("Manifest parsed"); + m_context.job->UpdateProgress( + InstallerContext::INSTALL_CREATE_MANIFEST, + "Widget Manifest Parsing Finished"); + LogDebug("Manifest parsed"); + } } void TaskManifestFile::commitManifest() @@ -563,9 +567,7 @@ void TaskManifestFile::commitManifest() LogDebug("Commiting manifest file : " << manifest_file); std::ostringstream destFile; - if (m_context.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.rootPath == InstallMode::RootPath::RO) { destFile << "/usr/share/packages" << "/"; //TODO constant with path } else { destFile << "/opt/share/packages" << "/"; //TODO constant with path diff --git a/src/jobs/widget_install/task_prepare_reinstall.cpp b/src/jobs/widget_install/task_prepare_reinstall.cpp index 0e6bdc4..20a209c 100644 --- a/src/jobs/widget_install/task_prepare_reinstall.cpp +++ b/src/jobs/widget_install/task_prepare_reinstall.cpp @@ -45,7 +45,7 @@ std::list keyList = {KEY_DELETE, KEY_ADD, KEY_MODIFY}; void verifyFile(const std::string &filePath) { if (access(filePath.c_str(), F_OK) != 0) { - ThrowMsg(Exceptions::AceCheckFailed, "File is missed " << filePath); + ThrowMsg(Exceptions::RDSDeltaFailure, "File is missed " << filePath); } } } diff --git a/src/jobs/widget_install/task_remove_backup.cpp b/src/jobs/widget_install/task_remove_backup.cpp index 8841739..47e9cf4 100644 --- a/src/jobs/widget_install/task_remove_backup.cpp +++ b/src/jobs/widget_install/task_remove_backup.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,12 @@ TaskRemoveBackupFiles::TaskRemoveBackupFiles(InstallerContext& context) : DPL::TaskDecl(this), m_context(context) { - AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles); + if (m_context.widgetConfig.packagingType != + WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) + { + AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles); + } + AddStep(&TaskRemoveBackupFiles::StepDeleteBackupDB); } void TaskRemoveBackupFiles::StepRemoveBackupFiles() @@ -62,13 +68,24 @@ void TaskRemoveBackupFiles::StepRemoveBackupFiles() LogDebug("Success to remove temp directory : " << tmp); } else { LogError("Failed to remove temp directory : " << tmp); - ThrowMsg(Exceptions::RemoveBackupFailed, - "Error occurs during removing existing folder"); } +} - m_context.job->UpdateProgress( - InstallerContext::INSTALL_REMOVE_BACKUP_FILE, - "Backup widget file delete Finished"); +void TaskRemoveBackupFiles::StepDeleteBackupDB() +{ + LogDebug("StepDeleteBackupDB"); + std::string oldAppid = + DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + ".backup"; + + Try + { + WidgetDAO::unregisterWidget(DPL::FromUTF8String(oldAppid)); + } + Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) + { + LogError("Fail to delete old version db information"); + } } + } //namespace WidgetInstall } //namespace Jobs diff --git a/src/jobs/widget_install/task_remove_backup.h b/src/jobs/widget_install/task_remove_backup.h index d269435..777f988 100644 --- a/src/jobs/widget_install/task_remove_backup.h +++ b/src/jobs/widget_install/task_remove_backup.h @@ -35,6 +35,7 @@ class TaskRemoveBackupFiles : InstallerContext& m_context; void StepRemoveBackupFiles(); + void StepDeleteBackupDB(); public: TaskRemoveBackupFiles(InstallerContext& context); diff --git a/src/jobs/widget_install/task_smack.cpp b/src/jobs/widget_install/task_smack.cpp index a5624a9..9857bf7 100644 --- a/src/jobs/widget_install/task_smack.cpp +++ b/src/jobs/widget_install/task_smack.cpp @@ -35,7 +35,9 @@ namespace { const int MAX_BUF_SIZE = 128; +#ifdef WRT_SMACK_ENABLED const char* SMACK_RULE_STR = "/usr/bin/smackload-app.sh"; +#endif } namespace Jobs { @@ -131,9 +133,7 @@ void TaskSmack::SmackPrivilegeStep() const char* perm_list[0]; perm_list[0] = NULL; #endif - if (m_context.job->getInstallerStruct().m_installMode - != InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.installTime != InstallMode::InstallTime::PRELOAD) { int result = app_add_permissions( DPL::ToUTF8String(tzPkgid).c_str(), perm_list); if (PC_OPERATION_SUCCESS != result) { @@ -175,7 +175,7 @@ void TaskSmack::SmackTemporaryStep() #endif } -void TaskSmack::SetEndofInstallation() +void TaskSmack::SetEndofInstallation() { m_context.job->UpdateProgress( InstallerContext::INSTALL_END, diff --git a/src/jobs/widget_install/task_update_files.cpp b/src/jobs/widget_install/task_update_files.cpp index eeecb86..69b7053 100644 --- a/src/jobs/widget_install/task_update_files.cpp +++ b/src/jobs/widget_install/task_update_files.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -57,258 +58,48 @@ TaskUpdateFiles::TaskUpdateFiles(InstallerContext& context) : DPL::TaskDecl(this), m_context(context) { - AddStep(&TaskUpdateFiles::StepCreateBackupFolder); - AddStep(&TaskUpdateFiles::StepResourceFilesBackup); - AddStep(&TaskUpdateFiles::StepExecFileBackup); + AddStep(&TaskUpdateFiles::StepBackupDirectory); - AddAbortStep(&TaskUpdateFiles::StepAbortCreateBackupFolder); - AddAbortStep(&TaskUpdateFiles::StepAbortExecFileBackup); - AddAbortStep(&TaskUpdateFiles::StepAbortResourceFilesBackup); + AddAbortStep(&TaskUpdateFiles::StepAbortBackupDirectory); } -void TaskUpdateFiles::StepCreateBackupFolder() +void TaskUpdateFiles::StepBackupDirectory() { LogDebug("StepCreateBackupFolder"); - std::string srcBuPath = m_context.locations->getBackupSourceDir(); - LogDebug("backup resource directory path : " << srcBuPath); - if (!WrtUtilMakeDir(srcBuPath)) { - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during create \ - backup directory."); - } - - std::string binBuPath = m_context.locations->getBackupBinaryDir(); - LogDebug("backup execution directory path : " << binBuPath); - if (!WrtUtilMakeDir(binBuPath)) { - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during create backup \ - directory."); - } - - m_context.job->UpdateProgress( - InstallerContext::INSTALL_CREATE_BACKUP_DIR, - "Backup directory created for update"); -} - -void TaskUpdateFiles::ReadDirList(std::string dirPath, ExistFileList &list, - size_t subLen) -{ - DIR* pkgDir = opendir(dirPath.c_str()); - if (!pkgDir) { - LogError("Package directory " << dirPath << " doesn't exist"); - ThrowMsg(Exceptions::BackupFailed, - "Error occurs during read \ - directory"); - } - - struct stat statInfo; - struct dirent dirent; - struct dirent *result; - int return_code; - errno = 0; - for (return_code = readdir_r(pkgDir, &dirent, &result); - result != NULL && return_code == 0; - return_code = readdir_r(pkgDir, &dirent, &result)) - { - std::string dirName = dirent.d_name; - std::string absFileName = dirPath + "/" + dirName; - if (stat(absFileName.c_str(), &statInfo) != 0) { - ThrowMsg(Exceptions::BackupFailed, "Error occurs read file"); - } - - if (S_ISDIR(statInfo.st_mode)) { - if (strcmp(dirent.d_name, ".") == 0 || strcmp(dirent.d_name, - "..") == 0) - { - continue; - } - ReadDirList(absFileName, list, subLen); - } - - list.insert(absFileName.substr(subLen)); - } - if (return_code != 0 || errno != 0) { - LogError("readdir_r() failed with " << DPL::GetErrnoString()); - } - errno = 0; - //closing the directory - if (-1 == TEMP_FAILURE_RETRY(closedir(pkgDir))) { - LogError("Failed to close dir: " << dirPath << " with error: " - << DPL::GetErrnoString()); - } -} - -void TaskUpdateFiles::StepResourceFilesBackup() -{ - LogDebug("StepCopyFiles"); - - ExistFileList resList; - ExistFileList tempList; - - std::string pkgSrc = m_context.locations->getSourceDir(); - ReadDirList(pkgSrc, resList, strlen(pkgSrc.c_str()) + 1); - - std::string tempSrc = m_context.locations->getTemporaryPackageDir(); - ReadDirList(tempSrc, tempList, strlen(tempSrc.c_str()) + 1); - - FOREACH(it, tempList) { - std::set::iterator res; - res = resList.find(*it); - std::string resFile = pkgSrc + "/" + (*it); - std::string newFile = tempSrc + "/" + (*it); - - if (res != resList.end()) { - std::string backupFile = - m_context.locations->getBackupSourceDir() + - "/" + (*it); - - struct stat sInfo; - if (stat(resFile.c_str(), &sInfo) != 0) { - ThrowMsg(Exceptions::BackupFailed, "Error occurs read file"); - } - - if (S_ISDIR(sInfo.st_mode)) { - LogDebug(resFile << " is a directory. so create a folder : " << - backupFile); - WrtUtilMakeDir(backupFile); - } else { - if ((rename(resFile.c_str(), backupFile.c_str())) != 0) { - LogError( - "Failed to rename " << resFile << " to " << - backupFile); - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during \ - rename file"); - } - - LogDebug("backup : " << resFile << " to " << backupFile); + std::string backPath = m_context.locations->getBackupDir(); + LogDebug("backup resource directory path : " << backPath); + std::string pkgPath = m_context.locations->getPackageInstallationDir(); - if ((rename(newFile.c_str(), resFile.c_str())) != 0) { - LogError( - "Failed to rename " << newFile << " to " << resFile); - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during \ - rename file"); - } - LogDebug("copy : " << newFile << " to " << resFile); - } - resList.erase(res); - } else { - if ((rename(newFile.c_str(), resFile.c_str())) != 0) { - LogError("Failed to rename " << newFile << " to " << resFile); - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during \ - rename file"); - } - LogDebug("only copy : " << newFile << " to " << resFile); - } - } - - if (resList.empty() != 0) { - FOREACH(remain, resList) { - std::string pkgFile = pkgSrc + "/" + (*remain); - std::string backFile = tempSrc + "/" + (*remain); - if ((rename(pkgFile.c_str(), backFile.c_str())) != 0) { - LogError("Failed to backup : " << pkgFile << " to " << backFile); - ThrowMsg( - Exceptions::BackupFailed, - "Error occurs during \ - rename file"); - } - LogDebug("only backup : " << pkgFile << " to " << backFile); - } - } - - m_context.job->UpdateProgress( - InstallerContext::INSTALL_BACKUP_RES_FILES, - "Backup resource file for update"); -} - -void TaskUpdateFiles::StepExecFileBackup() -{ - std::string execFile = m_context.locations->getExecFile(); - - LogDebug(" source : " << execFile); - - std::string tempSource = m_context.locations->getBackupExecFile(); - LogDebug(" source : " << tempSource); - - if ((rename(execFile.c_str(), tempSource.c_str())) != 0) { - LogError("Failed to rename " << execFile << " to " << - tempSource); + LogDebug("copy : " << pkgPath << " to " << backPath); + if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) { + LogError("Failed to rename " << pkgPath << " to " << backPath); ThrowMsg(Exceptions::BackupFailed, - "Error occurs during \ - rename file"); + "Error occurs during rename file"); } - LogDebug("Backup : " << execFile << " to " << tempSource); - std::string clientPath = GlobalConfig::GetWrtClientExec(); + WrtUtilMakeDir(pkgPath); - LogInfo("link -s " << clientPath << " " << execFile); - - errno = 0; - if( symlink(clientPath.c_str(), execFile.c_str()) != 0 ) - { - int error = errno; - if(error) - LogPedantic("Failed to make a symbolic name for a file " - << "[" << DPL::GetErrnoString(error) << "]"); - ThrowMsg(Exceptions::BackupFailed, - "Error occurs during rename file"); - } m_context.job->UpdateProgress( - InstallerContext::INSTALL_BACKUP_EXEC, - "Backup execution file for update"); + InstallerContext::INSTALL_CREATE_BACKUP_DIR, + "Backup directory created for update"); } -void TaskUpdateFiles::StepAbortResourceFilesBackup() +void TaskUpdateFiles::StepAbortBackupDirectory() { LogDebug("StepAbortCopyFiles"); - std::string srcPath = m_context.locations->getSourceDir(); - std::string srcBuPath = m_context.locations->getBackupSourceDir(); - - LogDebug("Backup Folder " << srcBuPath << " to " << srcPath); - - if (!WrtUtilRemove(srcPath)) { - LogError("Failed to remove " << srcPath); - } - - if (rename(srcBuPath.c_str(), srcPath.c_str()) != 0) { - LogError("Failed to rename " << srcBuPath << " to " << srcPath); - } -} -void TaskUpdateFiles::StepAbortExecFileBackup() -{ - LogDebug("StepAbortExecFileBackup"); - std::string binPath = m_context.locations->getBinaryDir(); + std::string backPath = m_context.locations->getBackupDir(); + std::string pkgPath = m_context.locations->getPackageInstallationDir(); - if (!WrtUtilRemove(binPath)) { - LogError("Failed to remove " << binPath); - } + LogDebug("Backup Folder " << backPath << " to " << pkgPath); - std::string binBuPath = m_context.locations->getBackupBinaryDir(); - if (rename(binBuPath.c_str(), binPath.c_str()) != 0) { - LogError("Failed to rename " << binBuPath << " to " << binPath); + if (!WrtUtilRemove(pkgPath)) { + LogError("Failed to remove " << pkgPath); } - LogDebug("Backup Folder " << binBuPath << "move to " << binPath); -} - -void TaskUpdateFiles::StepAbortCreateBackupFolder() -{ - LogDebug("StepAbortCreateBackupFolder"); - std::ostringstream path; - path << m_context.locations->getBackupDir(); - LogDebug("Remove backup directory : " << path.str()); - if (!WrtUtilRemove(path.str())) { - LogError("Failed to remove " << path); + if (rename(backPath.c_str(), pkgPath.c_str()) != 0) { + LogError("Failed to rename " << backPath << " to " << pkgPath); } } } //namespace WidgetInstall diff --git a/src/jobs/widget_install/task_update_files.h b/src/jobs/widget_install/task_update_files.h index b95e5c9..4161b13 100644 --- a/src/jobs/widget_install/task_update_files.h +++ b/src/jobs/widget_install/task_update_files.h @@ -40,16 +40,9 @@ class TaskUpdateFiles : private: InstallerContext& m_context; - /* TODO : md5 check */ - void StepCreateBackupFolder(); - void StepResourceFilesBackup(); - void StepExecFileBackup(); + void StepBackupDirectory(); - void ReadDirList(std::string dirPath, ExistFileList &list, size_t subLen); - - void StepAbortResourceFilesBackup(); - void StepAbortCreateBackupFolder(); - void StepAbortExecFileBackup(); + void StepAbortBackupDirectory(); public: TaskUpdateFiles(InstallerContext& context); diff --git a/src/jobs/widget_install/widget_install_context.h b/src/jobs/widget_install/widget_install_context.h index bd96390..a981670 100644 --- a/src/jobs/widget_install/widget_install_context.h +++ b/src/jobs/widget_install/widget_install_context.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace Jobs { namespace WidgetInstall { @@ -100,6 +101,7 @@ struct InstallerContext std::string installInfo; /// InstallLocationType locationType; bool isUpdateMode; + InstallMode mode; }; #endif // INSTALLER_CONTEXT_H diff --git a/src/jobs/widget_install/widget_install_errors.h b/src/jobs/widget_install/widget_install_errors.h index 6464504..9e3f8c9 100644 --- a/src/jobs/widget_install/widget_install_errors.h +++ b/src/jobs/widget_install/widget_install_errors.h @@ -88,6 +88,7 @@ DECLARE_JOB_EXCEPTION(Base, PackageAlreadyInstalled, ErrorPackageAlreadyInstalle DECLARE_JOB_EXCEPTION(Base, AceCheckFailed, ErrorAceCheckFailed) DECLARE_JOB_EXCEPTION(Base, EncryptionFailed, ErrorEncryptionFailed) DECLARE_JOB_EXCEPTION(Base, InstallOspsvcFailed, ErrorInstallOspServcie) +DECLARE_JOB_EXCEPTION(Base, PrivilegeLevelViolation, ErrorPrivilegeLevelViolation) } //namespace } //namespace } //namespace diff --git a/src/jobs/widget_install/widget_installer_struct.h b/src/jobs/widget_install/widget_installer_struct.h index 0ebe48a..6f0c176 100644 --- a/src/jobs/widget_install/widget_installer_struct.h +++ b/src/jobs/widget_install/widget_installer_struct.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -45,17 +46,6 @@ typedef void (*InstallerProgressCallback)(void *userParam, ProgressPercent percent, const ProgressDescription &); -namespace InstallMode { -enum Type -{ - WRONG_INSTALL_MODE = -1, - INSTALL_MODE_WGT, - INSTALL_MODE_DIRECTORY, - INSTALL_MODE_PRELOAD, - REINSTALL_MODE_DIRECTORY -}; -} - //TODO into namespace //InstallationStruct typedef Jobs::JobCallbacksBase pkgmgrInterface; // It must be empty-constructible as a parameter of generic event - WidgetInstallationStruct() : - m_installMode(InstallMode::Type::INSTALL_MODE_WGT) - {} - + WidgetInstallationStruct() {}; WidgetInstallationStruct( InstallerFinishedCallback finished, InstallerProgressCallback progress, void *param, - InstallMode::Type mode, + InstallMode mode, std::shared_ptr _pkgmgrInterface ) : diff --git a/src/misc/widget_location.cpp b/src/misc/widget_location.cpp index f48751f..adfbd44 100644 --- a/src/misc/widget_location.cpp +++ b/src/misc/widget_location.cpp @@ -25,11 +25,10 @@ #include #include #include - #include -WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isPreload) : - m_dirpath(Jobs::WidgetInstall::createTempPath(isPreload)) +WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isReadOnly) : + m_dirpath(Jobs::WidgetInstall::createTempPath(isReadOnly)) {} WidgetLocation::DirectoryDeletor::DirectoryDeletor(std::string tempPath) : @@ -63,15 +62,14 @@ WidgetLocation::~WidgetLocation() WidgetLocation::WidgetLocation(const std::string & widgetname, std::string sourcePath, WrtDB::PackagingType t, - InstallLocationType locationType) : + bool isReadonly) : m_pkgid(widgetname), m_widgetSource(sourcePath), m_type(t), m_temp( - new WidgetLocation::DirectoryDeletor( - INSTALL_LOCATION_TYPE_PRELOAD == locationType)) + new WidgetLocation::DirectoryDeletor(isReadonly)) { - if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) { + if (isReadonly) { m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath(); } else { m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath(); @@ -86,14 +84,13 @@ WidgetLocation::WidgetLocation(const std::string & widgetname, std::string sourcePath, std::string dirPath, WrtDB::PackagingType t, - InstallLocationType locationType) : + bool isReadonly) : m_pkgid(widgetname), m_widgetSource(sourcePath), m_type(t), - m_temp(new - WidgetLocation::DirectoryDeletor(dirPath)) + m_temp(new WidgetLocation::DirectoryDeletor(dirPath)) { - if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) { + if (isReadonly) { m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath(); } else { m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath(); @@ -140,7 +137,7 @@ std::string WidgetLocation::getExecFile() const std::string WidgetLocation::getBackupDir() const { - return getPackageInstallationDir() + "/backup"; + return getPackageInstallationDir() + ".backup"; } std::string WidgetLocation::getBackupSourceDir() const @@ -158,6 +155,12 @@ std::string WidgetLocation::getBackupExecFile() const return getBackupBinaryDir() + "/" + m_appid; } +std::string WidgetLocation::getBackupPrivateDir() const +{ + return getBackupDir() + "/" + + WrtDB::GlobalConfig::GetWidgetPrivateStoragePath(); +} + std::string WidgetLocation::getUserDataRootDir() const { return std::string(WrtDB::GlobalConfig::GetWidgetUserDataPath()) + diff --git a/src/misc/widget_location.h b/src/misc/widget_location.h index 07ea234..0cdcbdd 100644 --- a/src/misc/widget_location.h +++ b/src/misc/widget_location.h @@ -101,14 +101,12 @@ class WidgetLocation */ WidgetLocation(const std::string & widgetname, std::string sourcePath, WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP, - InstallLocationType ltype = - INSTALL_LOCATION_TYPE_NOMAL); + bool isReadonly = false); WidgetLocation(const std::string & widgetname, std::string sourcePath, std::string dirPath, WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP, - InstallLocationType ltype = - INSTALL_LOCATION_TYPE_NOMAL); + bool isReadonly = false); ~WidgetLocation(); @@ -119,10 +117,11 @@ class WidgetLocation std::string getBinaryDir() const; // /opt/apps/[package]/bin or /usr/apps/[package]/bin std::string getUserBinaryDir() const; // /opt/apps/[package]/bin std::string getExecFile() const; // /opt/apps/[package]/bin/[package] - std::string getBackupDir() const; // /opt/apps/[package]/backup - std::string getBackupSourceDir() const; // /opt/apps/[pkg]/backup/res/wgt - std::string getBackupBinaryDir() const; // /opt/apps/[pkg]/backup/bin - std::string getBackupExecFile() const; // /opt/apps/[pkg]/backup/bin/[pkg] + std::string getBackupDir() const; // /opt/apps/[package].backup + std::string getBackupSourceDir() const; // /opt/apps/[pkg].backup/res/wgt + std::string getBackupBinaryDir() const; // /opt/apps/[pkg].backup/bin + std::string getBackupExecFile() const; // /opt/apps/[pkg].backup/bin/[pkg] + std::string getBackupPrivateDir() const; // /opt/apps/[pkg].backup/data std::string getUserDataRootDir() const; // /opt/usr/apps/[package] std::string getPrivateStorageDir() const; // /opt/usr/apps/[package]/data diff --git a/src/pkg-manager/backendlib.cpp b/src/pkg-manager/backendlib.cpp index 497bf3f..3786026 100644 --- a/src/pkg-manager/backendlib.cpp +++ b/src/pkg-manager/backendlib.cpp @@ -419,15 +419,16 @@ int getWidgetDetailInfoFromPackage(const char* pkgPath, PKG_VALUE_STRING_LEN_MAX - 1); } - GList *privilege_list = pkg_detail_info->privilege_list; + pkg_detail_info->privilege_list = NULL; FOREACH(it, configInfo.featuresList) { std::string featureInfo = DPL::ToUTF8String(it->name); LogDebug("privilege : " << featureInfo); int length = featureInfo.size(); char *privilege = (char*) calloc(1, (sizeof(char) * (length + 1))); snprintf(privilege, length + 1, "%s", featureInfo.c_str()); - privilege_list = g_list_append(privilege_list, &privilege); + pkg_detail_info->privilege_list = + g_list_append(pkg_detail_info->privilege_list, privilege); } std::string icon_name; @@ -463,7 +464,7 @@ pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path) LogError("Failed to get package detail info "); return NULL; } - return &pkg_detail_info; + return reinterpret_cast(pkg_detail_info); } __attribute__ ((visibility("default"))) diff --git a/src/wrt-installer/installer_callbacks_translate.cpp b/src/wrt-installer/installer_callbacks_translate.cpp index ef479c8..fa1c9f2 100644 --- a/src/wrt-installer/installer_callbacks_translate.cpp +++ b/src/wrt-installer/installer_callbacks_translate.cpp @@ -48,10 +48,18 @@ void installFinishedCallback(void *userParam, errorStatus = WRT_INSTALLER_ERROR_PACKAGE_NOT_FOUND; break; + case Jobs::Exceptions::ErrorPackageInvalid: + errorStatus = WRT_INSTALLER_ERROR_PACKAGE_INVALID; + break; + case Jobs::Exceptions::ErrorPackageLowerVersion: errorStatus = WRT_INSTALLER_ERROR_PACKAGE_LOWER_VERSION; break; + case Jobs::Exceptions::ErrorPackageExecutableNotFound: + errorStatus = WRT_INSTALLER_ERROR_PACKAGE_EXCUTABLE_NOT_FOUND; + break; + case Jobs::Exceptions::ErrorManifestNotFound: errorStatus = WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND; break; @@ -102,6 +110,10 @@ void installFinishedCallback(void *userParam, errorStatus = WRT_INSTALLER_ERROR_INVALID_PRIVILEGE; break; + case Jobs::Exceptions::ErrorPrivilegeLevelViolation: + errorStatus = WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION; + break; + case Jobs::Exceptions::ErrorMenuIconNotFound: errorStatus = WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND; break; @@ -118,6 +130,10 @@ void installFinishedCallback(void *userParam, errorStatus = WRT_INSTALLER_ERROR_OUT_OF_MEMORY; break; + case Jobs::Exceptions::ErrorArgumentInvalid: + errorStatus = WRT_INSTALLER_ERROR_ARGUMENT_INVALID; + break; + case Jobs::Exceptions::ErrorPackageAlreadyInstalled: errorStatus = WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED; break; diff --git a/src/wrt-installer/wrt-installer.cpp b/src/wrt-installer/wrt-installer.cpp index 58db8f4..77457f5 100644 --- a/src/wrt-installer/wrt-installer.cpp +++ b/src/wrt-installer/wrt-installer.cpp @@ -82,7 +82,6 @@ struct PluginInstallerData WrtInstaller::WrtInstaller(int argc, char **argv) : Application(argc, argv, "backend", false), DPL::TaskDecl(this), - m_installMode(WRT_INSTALL_MODE_UNKNOWN), m_packagePath(), m_initialized(false), m_numPluginsToInstall(0), @@ -175,10 +174,10 @@ void WrtInstaller::OnCreate() struct stat info; if (-1 != stat(m_argv[2], &info) && S_ISDIR(info.st_mode)) { LogInfo("Installing package directly from directory"); - m_installMode = WRT_INSTALL_MODE_INSTALL_DIRECTORY; + m_installMode.extension = InstallMode::ExtensionType::DIR; } else { LogInfo("Installing from regular location"); - m_installMode = WRT_INSTALL_MODE_INSTALL_WGT; + m_installMode.extension = InstallMode::ExtensionType::WGT; } m_packagePath = m_argv[2]; @@ -189,7 +188,17 @@ void WrtInstaller::OnCreate() return showHelpAndQuit(); } m_packagePath = m_argv[2]; - m_installMode = WRT_INSTALL_MODE_INSTALL_PRELOAD; + m_installMode.installTime = InstallMode::InstallTime::PRELOAD; + m_installMode.rootPath = InstallMode::RootPath::RO; + AddStep(&WrtInstaller::installStep); + } else if (arg == "-ipw" || arg == "--install-preload-writable") { + LogDebug("Install preload web application to writable storage"); + if (m_argc != 3) { + return showHelpAndQuit(); + } + m_packagePath = m_argv[2]; + m_installMode.installTime = InstallMode::InstallTime::PRELOAD; + m_installMode.rootPath = InstallMode::RootPath::RW; AddStep(&WrtInstaller::installStep); } else if (arg == "-c" || arg == "--csc-update") { // "path=/opt/system/csc/Ozq2iEG15R-2.0.0-arm.wgt:op=install:removable=true" @@ -208,7 +217,7 @@ void WrtInstaller::OnCreate() if (it->second == CSCConfiguration::VALUE_INSTALL) { LogDebug("operation = " << it->second); - m_installMode = WRT_INSTALL_MODE_INSTALL_WGT; + m_installMode.extension = InstallMode::ExtensionType::WGT; it = m_CSCconfigurationMap.find(CSCConfiguration::KEY_PATH); if (it == m_CSCconfigurationMap.end()) { return showHelpAndQuit(); @@ -249,7 +258,8 @@ void WrtInstaller::OnCreate() return showHelpAndQuit(); } LogInfo("Installing package directly from directory"); - m_installMode = WRT_INSTALL_MODE_REINSTALL; + m_installMode.command = InstallMode::Command::REINSTALL; + m_installMode.extension = InstallMode::ExtensionType::DIR; m_packagePath = m_argv[2]; AddStep(&WrtInstaller::installStep); } else { @@ -276,10 +286,10 @@ void WrtInstaller::OnCreate() struct stat info; if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) { LogInfo("Installing package directly from directory"); - m_installMode = WRT_INSTALL_MODE_INSTALL_DIRECTORY; + m_installMode.extension = InstallMode::ExtensionType::DIR; } else { LogInfo("Installing from regular location"); - m_installMode = WRT_INSTALL_MODE_INSTALL_WGT; + m_installMode.extension = InstallMode::ExtensionType::WGT; } AddStep(&WrtInstaller::installStep); break; @@ -289,7 +299,8 @@ void WrtInstaller::OnCreate() break; case PKGMGR_REQ_REINSTALL: m_packagePath = m_argv[4]; - m_installMode = WRT_INSTALL_MODE_REINSTALL; + m_installMode.command = InstallMode::Command::REINSTALL; + m_installMode.extension = InstallMode::ExtensionType::DIR; AddStep(&WrtInstaller::installStep); break; default: @@ -312,8 +323,8 @@ void WrtInstaller::OnReset(bundle* /*b*/) void WrtInstaller::OnTerminate() { LogDebug("Wrt Shutdown now"); - PluginUtils::unlockPluginInstallation(m_installMode == - WRT_INSTALL_MODE_INSTALL_PRELOAD); + PluginUtils::unlockPluginInstallation( + m_installMode.installTime == InstallMode::InstallTime::PRELOAD); if (m_initialized) { wrt_installer_shutdown(); } @@ -414,8 +425,9 @@ void WrtInstaller::installPluginsStep() if (m_startupPluginInstallation) { LogInfo("Plugin installation started because new plugin package found"); - } else if (!PluginUtils::lockPluginInstallation(m_installMode == - WRT_INSTALL_MODE_INSTALL_PRELOAD)) { + } else if (!PluginUtils::lockPluginInstallation( + m_installMode.installTime == InstallMode::InstallTime::PRELOAD)) + { LogError("Failed to open plugin installation lock file" " Plugins are currently installed by other process"); staticWrtPluginInstallationCallback(WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED, @@ -745,6 +757,13 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId, tizenId.c_str(), printMsg.c_str()); break; + case WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION: + This->m_returnStatus = 1; //this status is specific + fprintf(stderr, "## wrt-installer : %s %s has failed - " + "privilege level violation\n", + tizenId.c_str(), printMsg.c_str()); + break; + case WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND: This->m_returnStatus = 1; //this status is specific fprintf(stderr, "## wrt-installer : %s %s has failed - " @@ -773,6 +792,13 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId, tizenId.c_str(), printMsg.c_str()); break; + case WRT_INSTALLER_ERROR_ARGUMENT_INVALID: + This->m_returnStatus = 1; //this status is specific + fprintf(stderr, "## wrt-installer : %s %s has failed - " + "invalid argument\n", + tizenId.c_str(), printMsg.c_str()); + break; + case WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED: This->m_returnStatus = 1; //this status is specific fprintf(stderr, "## wrt-installer : %s %s has failed - " @@ -833,8 +859,9 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId, This->m_returnStatus = 0; resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS); - if (This->m_installMode == WRT_INSTALL_MODE_INSTALL_PRELOAD && - !This->m_packagePath.empty()) { + if (This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD && + !This->m_packagePath.empty()) + { LogDebug("This widget is preloaded so it will be removed : " << This->m_packagePath); if (!WrtUtilRemove(This->m_packagePath)) { @@ -873,8 +900,9 @@ void WrtInstaller::staticWrtPluginInstallationCallback(WrtErrStatus status, } //remove lock file - if (!PluginUtils::unlockPluginInstallation(This->m_installMode == - WRT_INSTALL_MODE_INSTALL_PRELOAD)) { + if (!PluginUtils::unlockPluginInstallation( + This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD)) + { LogInfo("Failed to remove installation lock"); } @@ -967,16 +995,17 @@ void WrtInstaller::installNewPlugins() { LogDebug("Install new plugins"); - if (!PluginUtils::lockPluginInstallation(m_installMode == - WRT_INSTALL_MODE_INSTALL_PRELOAD)) { + if (!PluginUtils::lockPluginInstallation( + m_installMode.installTime == InstallMode::InstallTime::PRELOAD)) + { LogInfo("Lock NOT created"); return; } if (!PluginUtils::checkPluginInstallationRequired()) { LogDebug("Plugin installation not required"); - PluginUtils::unlockPluginInstallation(m_installMode == - WRT_INSTALL_MODE_INSTALL_PRELOAD); + PluginUtils::unlockPluginInstallation( + m_installMode.installTime == InstallMode::InstallTime::PRELOAD); return; } @@ -1010,7 +1039,8 @@ CSCConfiguration::dataMap WrtInstaller::parseCSCConfiguration( CSCConfiguration::dataPair(string.substr(0, pos), string.substr(pos+1))); } - return result; + free(buf); + return result; } int main(int argc, char *argv[]) diff --git a/src/wrt-installer/wrt-installer.h b/src/wrt-installer/wrt-installer.h index da75d42..59bcc90 100644 --- a/src/wrt-installer/wrt-installer.h +++ b/src/wrt-installer/wrt-installer.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace WRTInstallerNS { //anonymous DECLARE_GENERIC_EVENT_0(QuitEvent) @@ -122,7 +123,7 @@ class WrtInstaller : // Private data std::shared_ptr pkgmgrSignalInterface; - WrtInstallMode m_installMode; + InstallMode m_installMode; std::string m_packagePath; std::string m_name; bool m_initialized; diff --git a/src/wrt-installer/wrt_installer_api.cpp b/src/wrt-installer/wrt_installer_api.cpp index bb84730..83b5172 100644 --- a/src/wrt-installer/wrt_installer_api.cpp +++ b/src/wrt-installer/wrt_installer_api.cpp @@ -45,31 +45,10 @@ #include #include #include +#include using namespace WrtDB; -#ifdef __cplusplus - -#define EXPORT_API __attribute__((visibility("default"))) -extern "C" -{ -#endif -inline InstallMode::Type translateInstallMode( - WrtInstallMode installMode) -{ - if (WRT_INSTALL_MODE_INSTALL_WGT == installMode) { - return InstallMode::INSTALL_MODE_WGT; - } else if (WRT_INSTALL_MODE_INSTALL_DIRECTORY == installMode) { - return InstallMode::INSTALL_MODE_DIRECTORY; - } else if (WRT_INSTALL_MODE_INSTALL_PRELOAD == installMode) { - return InstallMode::INSTALL_MODE_PRELOAD; - } else if (WRT_INSTALL_MODE_REINSTALL == installMode) { - return InstallMode::REINSTALL_MODE_DIRECTORY; - } - Assert(true && "wrong argument is inputed"); - return InstallMode::WRONG_INSTALL_MODE; -} - static std::string cutOffFileName(const std::string& path) { size_t found = path.find_last_of("/"); @@ -102,7 +81,7 @@ static bool checkPaths() return if_ok; } -EXPORT_API void wrt_installer_init(void *userdata, +void wrt_installer_init(void *userdata, WrtInstallerInitCallback callback) { // Set DPL/LOG MID @@ -164,7 +143,7 @@ EXPORT_API void wrt_installer_init(void *userdata, return; } -EXPORT_API void wrt_installer_shutdown() +void wrt_installer_shutdown() { try { LogInfo("[WRT-API] DEINITIALIZING WRT INSTALLER..."); @@ -189,19 +168,19 @@ EXPORT_API void wrt_installer_shutdown() } } -EXPORT_API void wrt_install_widget( +void wrt_install_widget( const char *path, void* userdata, WrtInstallerStatusCallback status_cb, WrtProgressCallback progress_cb, - WrtInstallMode installMode, + InstallMode installMode, std::shared_ptr pkgmgrInterface ) { UNHANDLED_EXCEPTION_HANDLER_BEGIN { - if ( WRT_INSTALL_MODE_INSTALL_PRELOAD == installMode) { + if (InstallMode::InstallTime::PRELOAD == installMode.installTime) { DPL::Log::OldStyleLogProvider *oldStyleProvider = new DPL::Log::OldStyleLogProvider(false, false, false, true, false, true); @@ -218,13 +197,13 @@ EXPORT_API void wrt_install_widget( InstallerCallbacksTranslate::installProgressCallback, new InstallerCallbacksTranslate::StatusCallbackStruct( userdata, status_cb, progress_cb), - translateInstallMode(installMode), + installMode, pkgmgrInterface))); } UNHANDLED_EXCEPTION_HANDLER_END } -EXPORT_API void wrt_uninstall_widget( +void wrt_uninstall_widget( const char * const tzAppid, void* userdata, WrtInstallerStatusCallback status_cb, @@ -254,7 +233,7 @@ EXPORT_API void wrt_uninstall_widget( UNHANDLED_EXCEPTION_HANDLER_END } -EXPORT_API void wrt_install_plugin( +void wrt_install_plugin( const char *pluginDir, void *user_param, WrtPluginInstallerStatusCallback status_cb, @@ -282,7 +261,3 @@ EXPORT_API void wrt_install_plugin( } UNHANDLED_EXCEPTION_HANDLER_END } - -#ifdef __cplusplus -} -#endif diff --git a/src/wrt-installer/wrt_installer_api.h b/src/wrt-installer/wrt_installer_api.h index 512168b..694c9d1 100644 --- a/src/wrt-installer/wrt_installer_api.h +++ b/src/wrt-installer/wrt_installer_api.h @@ -27,13 +27,10 @@ #include #include #include +#include #include #include -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*WrtInstallerInitCallback)(WrtErrStatus status, void *data); typedef void (*WrtPluginInstallerStatusCallback)(WrtErrStatus status, @@ -45,15 +42,6 @@ typedef void (*WrtProgressCallback)(float percent, const char *description, void *data); -enum WrtInstallMode -{ - WRT_INSTALL_MODE_UNKNOWN = 0, - WRT_INSTALL_MODE_INSTALL_WGT, - WRT_INSTALL_MODE_INSTALL_DIRECTORY, - WRT_INSTALL_MODE_INSTALL_PRELOAD, - WRT_INSTALL_MODE_REINSTALL -}; - void wrt_installer_init( void *userdata, WrtInstallerInitCallback callback); @@ -63,7 +51,7 @@ void wrt_install_widget( void *user_parameter, WrtInstallerStatusCallback status_callback, WrtProgressCallback progress_callback, - WrtInstallMode install_mode, + InstallMode install_mode, std::shared_ptr pkgmgrInterface ); @@ -79,8 +67,4 @@ void wrt_install_plugin(const char *pluginDirectory, WrtPluginInstallerStatusCallback statusCallback, WrtProgressCallback progressCallback); -#ifdef __cplusplus -} -#endif - #endif /* WRT_INSTALLER_API_H_ */ diff --git a/src/wrt-installer/wrt_type.h b/src/wrt-installer/wrt_type.h index 9781131..2cfb584 100644 --- a/src/wrt-installer/wrt_type.h +++ b/src/wrt-installer/wrt_type.h @@ -47,25 +47,31 @@ typedef enum WRT_INSTALLER_ERROR_PACKAGE_NOT_FOUND, ///< WRT_INSTALLER_ERROR_PACKAGE_INVALID, ///< invalid widget package WRT_INSTALLER_ERROR_PACKAGE_LOWER_VERSION, ///< given version is lower than existing version - WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND, ///< + WRT_INSTALLER_ERROR_PACKAGE_EXCUTABLE_NOT_FOUND, + + WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11,///< WRT_INSTALLER_ERROR_MANIFEST_INVALID, ///< WRT_INSTALLER_CONFIG_NOT_FOUND, ///< couldn't find config.xml ///< in package. WRT_INSTALLER_ERROR_CONFIG_INVALID, ///< invalid config.xml - WRT_INSTALLER_ERROR_SIGNATURE_NOT_FOUND, ///< signature file not exist. - WRT_INSTALLER_ERROR_SIGNATURE_INVALID, ///< invalid signature file - WRT_INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED, ///< failure in verificate - ///< signature - WRT_INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND, ///< couldn't find root certificate. - WRT_INSTALLER_ERROR_CERTIFICATION_INVAID, ///< invalid certification - WRT_INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, ///< failure in verificate - ///< certification chain. - WRT_INSTALLER_ERROR_CERTIFICATE_EXPIRED, ///< expire cerification. - WRT_INSTALLER_ERROR_INVALID_PRIVILEGE, ///< invalid privilege. - WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND, ///< - WRT_INSTALLER_ERROR_FATAL_ERROR, ///< failure in db operation or file opertion.. - WRT_INSTALLER_ERROR_OUT_OF_STORAGE, ///< failure in shortage of memory - WRT_INSTALLER_ERROR_OUT_OF_MEMORY, ///< failure in shortage of RAM + + WRT_INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21, ///< signature file not exist. + WRT_INSTALLER_ERROR_SIGNATURE_INVALID, ///< invalid signature file + WRT_INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED, ///< failure in verificate signature + WRT_INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31, ///< couldn't find root certificate. + WRT_INSTALLER_ERROR_CERTIFICATION_INVAID, ///< invalid certification + WRT_INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, ///< failure in verificate certification chain. + WRT_INSTALLER_ERROR_CERTIFICATE_EXPIRED, ///< expire cerification. + + WRT_INSTALLER_ERROR_INVALID_PRIVILEGE = 41, ///< invalid privilege. + WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION, + + WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51, ///< + + WRT_INSTALLER_ERROR_FATAL_ERROR = 61, ///< failure in db operation or file opertion.. + WRT_INSTALLER_ERROR_OUT_OF_STORAGE, ///< failure in shortage of memory + WRT_INSTALLER_ERROR_OUT_OF_MEMORY, ///< failure in shortage of RAM + WRT_INSTALLER_ERROR_ARGUMENT_INVALID, /* wrt-installer error */ /* 121-140 : reserved for Web installer */ @@ -73,13 +79,13 @@ typedef enum /* installation */ WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED = 121, WRT_INSTALLER_ERROR_ACE_CHECK_FAILED, - WRT_INSTALLER_ERROR_MANIFEST_CREATE_FAILED, ///< - WRT_INSTALLER_ERROR_ENCRYPTION_FAILED, ///< Failure in reousrce encrypttion - WRT_INSTALLER_ERROR_INSTALL_OSP_SERVCIE, ///< Failure in installing osp service + WRT_INSTALLER_ERROR_MANIFEST_CREATE_FAILED, ///< + WRT_INSTALLER_ERROR_ENCRYPTION_FAILED, ///< Failure in reousrce encrypttion + WRT_INSTALLER_ERROR_INSTALL_OSP_SERVCIE, ///< Failure in installing osp service WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED, WRT_INSTALLER_ERROR_UNINSTALLATION_FAILED, - WRT_INSTALLER_ERROR_UNKNOWN, ///< do not use this error code. + WRT_INSTALLER_ERROR_UNKNOWN = 140, ///< do not use this error code. } WrtErrStatus; diff --git a/tests/general/CMakeLists.txt b/tests/general/CMakeLists.txt index cf87bdf..8e67a1a 100644 --- a/tests/general/CMakeLists.txt +++ b/tests/general/CMakeLists.txt @@ -65,7 +65,7 @@ SET(INSTALLER_TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/BackgroundPageTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/NonRootUserTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/NPluginsInstallTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ParsingTizenAppserviceTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ParsingTizenAppcontrolTests.cpp ) SET(INSTALLER_TESTS_TARGET "wrt-installer-tests-general") @@ -138,4 +138,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_1.wgt DESTINATION / INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_2.wgt DESTINATION /opt/share/widget/tests/installer/widgets/) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_3.wgt DESTINATION /opt/share/widget/tests/installer/widgets/) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_4.wgt DESTINATION /opt/share/widget/tests/installer/widgets/) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/appservice_dispos.wgt DESTINATION /opt/share/widget/tests/installer/widgets/) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/app-control.wgt DESTINATION /opt/share/widget/tests/installer/widgets/) diff --git a/tests/general/InstallerWrapper.cpp b/tests/general/InstallerWrapper.cpp index 662f617..71b0382 100644 --- a/tests/general/InstallerWrapper.cpp +++ b/tests/general/InstallerWrapper.cpp @@ -25,12 +25,13 @@ namespace const std::string params = "DPL_USE_OLD_STYLE_LOGS=0 " "DPL_USE_OLD_STYLE_PEDANTIC_LOGS=0 WRT_TEST_MODE=1 "; -const std::string installCmd = params + "wrt-installer -if "; +const std::string installCmd = params + "wrt-installer -i "; const std::string uninstallCmd = params + "wrt-installer -un "; -const std::string uninstallByGuidCmd = params + "wrt-installer -ug \""; const std::string redirection = " 2>&1"; const std::string INSTALLER_MESSAGE_ID_LINE = "## wrt-installer : %s installation was successful.\n"; +const std::string INSTALLER_MESSAGE_ID_LINE_FAIL = + "## wrt-installer : %s installation has failed - package already installed"; const std::string INSTALLER_MESSSGE_START = "## wrt-installer : "; std::string getAndCutInstallerLogLine(std::string &src) @@ -80,16 +81,34 @@ InstallResult install( if (!WIFEXITED(err)) { return OtherError; } + + char* id = NULL; + std::string line; + if (0 != WEXITSTATUS(err)) { + while ((line = getAndCutInstallerLogLine(msg)) != "") + { + if(line.find("failed") != std::string::npos) + { + id = new char[line.length()]; + int nr = sscanf(line.c_str(), INSTALLER_MESSAGE_ID_LINE_FAIL.c_str(), id); + if (1 != nr) + { + LogWarning("Can not read widget ID from message: " << line); + delete[] id; + return OtherError; + } + tizenId = id; + delete[] id; + } + } + if (1 == WEXITSTATUS(err)) { return WrongWidgetPackage; } return OtherError; } - char* id = NULL; - std::string line; - while ((line = getAndCutInstallerLogLine(msg)) != "") { if (line.find("successful") != std::string::npos) @@ -122,13 +141,6 @@ bool uninstall(const std::string& tizenId) return (system(cmd.c_str()) == EXIT_SUCCESS); } -bool uninstallByGuid(const std::string& guid) -{ - std::string cmd = uninstallByGuidCmd + guid + "\" > /dev/null 2>/dev/null"; - LogDebug("executing: " << cmd); - return (system(cmd.c_str()) == EXIT_SUCCESS); -} - bool sigintWrtClients() { return (system("pkill -2 wrt-client") == 0); diff --git a/tests/general/InstallerWrapper.h b/tests/general/InstallerWrapper.h index ee3d0a8..404a3e8 100644 --- a/tests/general/InstallerWrapper.h +++ b/tests/general/InstallerWrapper.h @@ -43,7 +43,6 @@ InstallResult install( std::string& tizenId, const std::string& user = ""); bool uninstall(const std::string& tizenId); -bool uninstallByGuid(const std::string& guid); /** * @brief killWrtClients kills processes that matches 'wrt-client' * @return True if any client was killed diff --git a/tests/general/ManifestTests.cpp b/tests/general/ManifestTests.cpp index 769bfa3..6b76d3a 100644 --- a/tests/general/ManifestTests.cpp +++ b/tests/general/ManifestTests.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using namespace InstallerWrapper; @@ -41,57 +42,76 @@ Expected: file should be created and installed by wrt-installer. Content should */ RUNNER_TEST(creatingManifestFile) { - const char * manifestPath = "/opt/share/packages/manifest01.xml"; + std::string manifestPath = "/opt/share/packages/"; /* This widget removal should stay here in case previous test run failed * (so widget has not been uninstalled) */ - uninstallByGuid("http://test.samsung.com/widget/manifestTest"); std::string tizenId; - RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) - == InstallerWrapper::Success); - RUNNER_ASSERT(WrtUtilFileExists(manifestPath)); + + if(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) + != InstallerWrapper::Success) + { + uninstall(tizenId); + RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId) + == InstallerWrapper::Success); + } + + RUNNER_ASSERT(WrtUtilFileExists(manifestPath.append(tizenId.substr(0,10)).append(".xml"))); ManifestFile mf(manifestPath); Try { + LogDebug("Package " << mf.getValueByXpath("/p:manifest/@package")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package") - == "manifest01"); + == tizenId.substr(0,10)); + LogDebug("type " << mf.getValueByXpath("/p:manifest/@type")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type") == "wgt"); + LogDebug("version " << mf.getValueByXpath("/p:manifest/@version")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version") == "1.0"); + LogDebug("label " << mf.getValueByXpath("/p:manifest/p:label")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label") == "Manifest Example"); + LogDebug("email " << mf.getValueByXpath("/p:manifest/p:author/@email")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email") == "manifest@misc.test.create.desktop.com"); + LogDebug("href " << mf.getValueByXpath("/p:manifest/p:author/@href")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href") == "http://misc.test.create.desktop.com"); + LogDebug("author " << mf.getValueByXpath("/p:manifest/p:author")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author") == "Manifest"); + LogDebug("appid " << mf.getValueByXpath("/p:manifest/p:ui-application/@appid")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid") - == "manifest01"); + == tizenId); + LogDebug("nodisplay " << mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay") == "false"); + LogDebug("type " << mf.getValueByXpath("/p:manifest/p:ui-application/@type")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type") == "webapp"); + LogDebug("extraid " << mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid") == "http://test.samsung.com/widget/manifestTest"); + LogDebug("taskmanage " << mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage") == "true"); + LogDebug("icon " << mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon") - == "manifest01.png"); + == (tizenId + ".png")); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[not(@xml:lang)]") == "Manifest Example"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de_DE']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de-de']") == "Manifest Beispiel"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en_US']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en-us']") == "Manifest Example"); RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pl']") == "Przykład Manifest"); - RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt_PT']") + RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt-pt']") == "Exemplo manifesto"); } Catch(ManifestFile::ManifestParseError) diff --git a/tests/general/NPluginsInstallTests.cpp b/tests/general/NPluginsInstallTests.cpp index ae39eb4..ac141d8 100644 --- a/tests/general/NPluginsInstallTests.cpp +++ b/tests/general/NPluginsInstallTests.cpp @@ -45,21 +45,6 @@ RUNNER_TEST(pluginFilesAdded) } /* -Name: emptyPluginsDir -Description: Tests installation with empty 'plugins' directory -Expected: widget should be not installed -*/ -RUNNER_TEST(emptyPluginsDir) -{ - std::string tizenId; - if(install(miscWidgetsStuff + "widgets/inst_nplug_2.wgt", - tizenId) == InstallerWrapper::Success) { - uninstall(tizenId); - RUNNER_ASSERT_MSG(false, "Invalid widget package installed"); - } -} - -/* Name: pluginFileAndOtherFile Description: Tests installation with plugins directory and data files Expected: widget should be installed @@ -71,19 +56,3 @@ RUNNER_TEST(pluginFileAndOtherFile) + "widgets/inst_nplug_3.wgt", tizenId) == InstallerWrapper::Success); uninstall(tizenId); } - -/* -Name: pluginFileAndSubdir -Description: Tests installation with 'plugins' directory and subdirectories - inside plugin directory -Expected: widget should be not installed -*/ -RUNNER_TEST(pluginFileAndSubdir) -{ - std::string tizenId; - if(install(miscWidgetsStuff + "widgets/inst_nplug_4.wgt", - tizenId) == InstallerWrapper::Success) { - uninstall(tizenId); - RUNNER_ASSERT_MSG(false, "Invalid widget package installed"); - } -} diff --git a/tests/general/ParsingTizenAppserviceTests.cpp b/tests/general/ParsingTizenAppcontrolTests.cpp similarity index 62% rename from tests/general/ParsingTizenAppserviceTests.cpp rename to tests/general/ParsingTizenAppcontrolTests.cpp index 5896f41..67572f1 100644 --- a/tests/general/ParsingTizenAppserviceTests.cpp +++ b/tests/general/ParsingTizenAppcontrolTests.cpp @@ -18,7 +18,7 @@ * @author Karol Pawlowski (k.pawlowski@samsung.com) * @author Andrzej Surdej (a.surdej@samsung.com) * @version 1.0 - * @brief Parsing Tizen Appservice test's bodies + * @brief Parsing Tizen app-control test's bodies */ #include @@ -32,57 +32,60 @@ using namespace InstallerWrapper; //////////////////////////////////////////////////////////////////////////////// -RUNNER_TEST_GROUP_INIT(ParsingTizenAppservice) +RUNNER_TEST_GROUP_INIT(ParsingTizenAppcontrol) /* -Name: correct_csp_policy -Description: Tests if widget policy is correctly parsed from config file - and stored into database -Expected: widget should be installed and policy should mach +Name: tizen_app-contro +Description: Tests if widget app-control tag is correctly parsed +Expected: widget should be installed */ -RUNNER_TEST(tizen_appservice_disposition) +RUNNER_TEST(tizen_app_control) { std::string tizenId; - RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/appservice_dispos.wgt", + RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/app-control.wgt", tizenId) == InstallerWrapper::Success); WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId)); - WrtDB::WidgetAppControlList appsvcList; - dao.getAppControlList(appsvcList); + WrtDB::WidgetAppControlList appcontrolList; + dao.getAppControlList(appcontrolList); uninstall(tizenId); - LogDebug("Actual size" << appsvcList.size()); - RUNNER_ASSERT_MSG(appsvcList.size() == 4, "Incorrect list size"); + LogDebug("Actual size" << appcontrolList.size()); + RUNNER_ASSERT_MSG(appcontrolList.size() == 4, "Incorrect list size"); WrtDB::WidgetAppControl s; s.src = DPL::FromUTF8String("edit1.html"); - s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/edit"); + s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/edit"); s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */ s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW; + RUNNER_ASSERT_MSG( - std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(), + std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(), "Unable to find service #"); s.src = DPL::FromUTF8String("edit2.html"); - s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/view"); + s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/view"); s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */ s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW; + RUNNER_ASSERT_MSG( - std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(), + std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(), "Unable to find service ##"); s.src = DPL::FromUTF8String("edit3.html"); - s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/call"); + s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/call"); s.mime = DPL::FromUTF8String("image/png"); /* mime type */ - s.disposition = WrtDB::WidgetAppControl::Disposition::INLINE; + s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW; + RUNNER_ASSERT_MSG( - std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(), + std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(), "Unable to find service ###"); s.src = DPL::FromUTF8String("edit4.html"); - s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/send"); + s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/send"); s.mime = DPL::FromUTF8String("text/css"); /* mime type */ s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW; + RUNNER_ASSERT_MSG( - std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(), + std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(), "Unable to find service ####"); } diff --git a/tests/general/widgets/appservice_dispos.wgt b/tests/general/widgets/app-control.wgt similarity index 83% rename from tests/general/widgets/appservice_dispos.wgt rename to tests/general/widgets/app-control.wgt index 9451a4f08f7a76df07992620b962f1f606407278..4aa5c7fbcdd489508b8f4032436849bdff2be176 100644 GIT binary patch delta 641 zcmeyQu|ktKz?+#xgn@y9gQ3T7=HzxpdG;L-DgxskR!m;Y*vAYKvtyEjiEU11;uEY# z(%`heSNvrTBLl-q76t|`1{sFr{JgZxbiIn)oX`+X24;|1AY59(&A`a=f|-Ewj25r0xA*(U#wh#dWEfyCsB^O+I?mb2>fWpL+Q4>BA)x zbgz}RhF!2oEvfHY{zOFi!X1vKseSSD-m6`&2uxWkBxDn$bbRUeGQXAV&pVU1MrV2M zSoxA|q3+`=tMf19pNY!blJC}%Q%uIr%b!ZQM!doHKb`$>Vfro^#(<}=L^>etyXnY zyfytU&)Xk)_kSvAhyAXK=t(N+bJVa`UAlht*+X)MVp7kX`GqP9=H)VHp1&lqT|8uU z!8zZyRWn(BC8kbVvOntI>AyKP-={Wx+hHBemAYc0@~-p8il48!#c%bZ`j5X`vAz8H zyNzPU@7k`heR}TiTDkp>ze}_owltK!-)O`f?-SJS3w4p^Z>QN MM?`^bsW3<#0Dhz=eCgx5$op)G4!1eo2uI}1}nNgu#Z`S;h7i<-rcdFs2kI$9$ z`gKokx-O|;eOzr>?iQTBg>Q$|FTDWesAqNct3%F3KI`o{xzZtP+JqUd(Z}LB(qESB z4qvzG)55(S4H1*Rm2mjYdLh2>)U7l8Z%XeAFJa_8^Ndj_QD?^1nyKrH&n8#wT-P0| zdEK#k#fsie>5r{f+@18eHtyc_#Yank3nrw6h4@+OSTSzqYPp zRmzhxt5x-$_N;f~n$E>-IFWsG(|Z@uYL8jVEB-Gt{>8TVoRF!M>&uhQoDa4#f4w}N zr9UG7{06p`nxvP_M^`M;)~TKuplrk@{rPa5`S}mM?{?jeTb_CUgJFrp1I7P;CG8wH zsM{T$I8||1zWvb$k1QQ-aq7G$O-8oHD}>mj4l8U;tqbV02^x<3q0?FC82ik@HjnZ?mawe90$R&&VXlj4Ku; zfU(QK0E|?Izl|Uka-6b4;uI}D1H2LD0UhSF(y;$p2~g)uAm(I1Hm?e3Y-V0ceQJeX zMoDgH2+%x`7qFVg1+tt0(_0YpKyrT@4Vi%E!958y4dh7-(^%O+s+ocCEs)L^1~M2J E0D_zH82|tP diff --git a/tests/general/widgets/bg-00-with_bg.wgt b/tests/general/widgets/bg-00-with_bg.wgt index 36d2452edbe17dea14f9a0158a4354eb1c09ccc5..6696e36db4b7d13cefdb61a0a13036219490e0ec 100644 GIT binary patch literal 862 zcmZ`%&1&2*5O%U{p?m2iy$hX6VXY0jrOP5au!TZd2tK6r7;H(EMb@$_Y3n4X=H3@5 zg}gy;Irc63LLF({c-K%F{dvC8eDlp@>(P^w$dB*mKUU$;EiYg%a&{$6z12J}UA4&$ zz~5#cUj8|XB0t9fX0`sTWPDw1=ou{Nt1wp8I>D#$6eFQo&6So3{&?|zvcP94Z55Zo zp;9PWx&*(SzrjfH1eeY=OG2EmF1C4Pw_3)muE-8g3V8vRPs)`mi3d>t;>rZi7Z4FR zX#4nD+qQ8#i)$l^w%t><11+7p6+rY~V1FAT)A4hv^Gc+vM@_O^ic?C$U$AmvnNf{{ zocBPe0Ti;^rm2lXJ|}S5hk|D>GqQ#yxW5P4F-gY=2F)20)}q=dsetZlZ=iwuGH;rV zV!00azB0PmFD6)aHYOaJY8DU{HEhw&h`cIvIQZ~uAr2F-FuLo3*5sS+4|`CWc2^$ zgt%cm-1%*w+0c2|tUK2zdbpdwv2Wd>-!RkO@73{s-r4%;GjAKg_Y3x)V2z@`WmoZk literal 736 zcmWIWW@Zs#U|`^2SnML=IB(vb6gwc#8;H3WWEe8@Qc^4QGD>oDLPIzim<4Ye27qvB z1vdjD%L`@(1~9Stq{hj!8y^P+Z16ngzmmnU;S5i*_3|T6-h5f~=h7aL)`lZrLRu$X zc_h^O>CBWbSA?W%7ua~T+qrO0;5TDt2!OkwD?!C^*{`0N$AGr0F+yCBoS&DLnXXp> zb%Dwy*8mVkbAfN4Zyu8&kK6S#nrm*lyi#JEx{5<}^8*$gtx{Q|Kq1FEk!p_P`5A!+ zwQt|A-jvF{c{9uQ3eOcY)U~P=qq6tx{TwsbL*t)7$_439UAg7iZ1>ondu}}cmc7~F z|LT;97Oy(Ii|#!6vEk^++OJQnC)iuCg-07cS#qOo{Y{fKDVHw#vFDy!_e}My``b5e zUH5bS)4P|oImK2sE-2wD&{Pd?`u%X-o<(8l_gG5`R`Xx~x* diff --git a/tests/general/widgets/bg-01-missing_file.wgt b/tests/general/widgets/bg-01-missing_file.wgt index aca63a75b1e02afae1ed22964dca2ef4f33d20b3..30ddb2601dbe24a451230453cb2d93b0873aef97 100644 GIT binary patch literal 766 zcmZ`%!A=`75M7djM9zGG$Pq7i73sMH(U*pAm~);6}ohTgdM2YTTv zIQCci9ldtEn}!gnv+`Q@yqS4^GsUF;;UJ0j(Amrzf8x*j#J|#(SDWBuR!CV zz6)UcuX;RfBlE#N)nzU6i;{hl&MY)9N-2&gX>Y;Hg=bFL01w{)Aqyzv7uFgVP<$AK zY(gP&x=x9_V;O!sr&XxunB)TlMoY$o_sBRU70~?{9kk^>F0Gv_R>tD3kf&FVH?yzm zwmwRya(Flz)}3hgvsN_=6@eEhzs6zY#KS^4!SCO-kK}YES6;juf|r+Hd;-mnD-MCu zTr69{G_sDI>D2J275VCTQ3v4{v?OeDg@S8C+1i)ReG(p92`$=8q(?Hv`86hr6&d*EBOxLS` zx*+V5YXAtNxxlx7zaO(9PkZ`1%{9?VhAOOGD*}p`nWcr8^$X6rb{>7&pCteAqvyg! zUsHa6uidmpTJN4=&2iI-f{i_q3AKwgf|9^3^xyqp@@r9*K`(jkjob0gPDSWwL@nxC2UyN@1$A6wS z?fcE$)obgv+s4Y=>}uUz#OnA`ycwC~m~lmk1TbhA7=U5Ju%!{iLXIF-NCcq;4YGNd0gP;3 e6VN>5;0Bt9C8z_uS=m4~GXdcOAUzS}7zP0Og~CVx diff --git a/tests/general/widgets/bg-02-without_bg.wgt b/tests/general/widgets/bg-02-without_bg.wgt index ccbf1dffc0e14a53717ca413b66cc1272030eef2..df388cdfbe1d3e764729b586518a694e51f648b2 100644 GIT binary patch literal 725 zcmZ`%y-p)B5Do!OM`|9xa(PnLKtQ0#yGW6s$qBXyf(~tL45+b6^e=OdR* zT&ZQm%!D*}GL|EdoGYK3(hnqFas()!$9VSuoB|E)J`Gk?6;-{+6q0B+v*u=?zE=+d zxPJH!uVrM?*`PX`h-8qlYgw35^E8v9M@jt)QZ5`Tl=Tqy0ti_^Ay-;!3Xeiqpt1<< zAQ&`bOgM*3p`-#Pzc5KUw5HY1ti4ez3wG-ai4i+0r~Kl#ipH|LwbQMdY+Q~Z9TwPu z!x+y|7!~5SRE6M|U#db9I?F?neyQ#A^D7@hO~VScRho;tDECm?uqD8ljt##L7r5rV z#c)GX>M&7LF-kxlG)SWY@7hK>TxoBve&0~ww;nH#;h4AAvfeV;MhhDA@eNvYPCXs2 P{|K@+Obh2}JG|Zjbivnz literal 567 zcmWIWW@Zs#U|`^2D0CHZoHuVziXD*W4a8gwG7On{DXA5D86~+np&^_M%+u}|27qvB z1vdjD%L`@(1~9Stq{hj!8y^P+Z16ngzmmnU;S5i*_3|T6-h5f~=h7aL)`lZrLRu$X zc_h^O>CBWbSA?W%7ua~T+qrO0;5TDt2!Oj_Yl4a+ zbwTMR*8ng^b%Af6qaU*&kL&d_nrrfOHhM&DnY+yTVI(ZsdQ(9s{vXF@OK+76~EOjXx@?96V0% z*J^a#7+raKNloPXZFP&MPu!!{nL626v8L_V%9L*Qt;Z{O8Q)x+XlMQ3Z*5NHP75yg z#r5lzW0`(WTgCH~t;tH`!P;w=SnBHdpNh>*=qbF%o~EH2c&e;?|K-mq>&`xVDIMU= z$Rx*%D+(llLBYTP3=4)WjUX0sgs?&)1T8X<&BF{(Wb>MU<{<|!&^#fgc5KRfK)SP>P(`rxcAzso-2&Hzaexww&KqQI~r^?tg@46=VAdNeO;B=RthINoH*aR%%nr_*Pq!M@?%(}5QvIL7;aa0%R}23|Qe5-I z8xJ%80AFMTN^>a!+VNgc0wR(z7fC=rUY@pJ(Sx2}@;CuQ5G!;*Q)BWjV`W)-<(?;1 z!h~iHqNxLQ4gU&AIE7ZHMP#o<(0maNp*P5igbPh@nJ~*jgXs_h+K`UVDnx73$FvOy z^G||At0lfWKqvii5nn`|4=+6%>q_Jp`Km)n9!57| z0*?`tD7Y=Sg7|7qA*A=G_4WpHLhpXxxc`MB+hv8G<>a4TzP*@MeAYiaaob9OA()U@ zq1rauD4@r#&i3Ub2TG<@2h_mWFk9a~iPBJMFoA2(BQC>Dwo1+I&W_I<$f?g!W|E-{Ur>)k$wI{KNM=%X69phBD!b{Yd%aI?B1&#jVkNZA%azPQWs|y#5c>?F z)+4v?H`in$3!(vtNjc(CZ`^?()A`Cnts$=6UDJ>>0x`9r94iy#Nhgb`;X_ZfQ_x2Tc&mSKA+eq z6L6Hn|A^?@vocGB6qQ2dXD@%$7n?azt@-P2&$ZhGKdB}5D7@7XaBDhwcFPmy%oB&& z4VWuxqU)TNoJ%;mujS6xgQ~YhE=h{NyWNnn`Fcjks@qkoXNz(6%@X-xZ!JIPc*3r3 zeKXbbSN^rVKmR=cMNCr%$C8p~-P`70NSnENmbhWkXZtd-sS=OZgg^ZEYNgf(?Immd zS*A#zz9>9#GtZn@3Egs0>#W;59{Wg%7aGkqw&0j-R9Je6ce2 zV*osSCp5Y`J~MP_SqBX5-#`os-{kzfw9It93TXIVc$F96_8KF6W6y2uJ7mDa_F$%6 z>(jYyU96#=?rCkiB}02db(ZFN-r?T0eEF6RMsGQt+Hd)@Z+>6$L83{e-TdlGGqvY2 z&yp>V-SaS#_S~^B>gW6?&evZ?o3ZMoE|p!evt?(x=Y}oY6t|pO+z=GBVojv$#?5y% zycSJJdOqRk<;8nm3J7@Yy14lZUw!?#-@>z|#~Hsao5fUq+x8n@>a9szoH|P8TTa^l zFVKg(AYv+eOX}@?^K-h?K|baJ`j3I3FT}+W%zzS-Kpz+6l%{9q73(J!75b0^rhmw_f+#b=6J zi!+KT97v{sO?cvy6Ci+@Ap^V_ndF#pWorp=bO3WW!*xzCf{}AnXb8|mP_n`kBAAH^*~H06CW1`^B{2-sSlK|)!w!V; MKp$QO>S16201Fh?H2?qr diff --git a/tests/general/widgets/inst_nplug_2.wgt b/tests/general/widgets/inst_nplug_2.wgt index 95f3d692f6776747d3d926e093e65d20aee16176..96e719520db37a9f8d21a70654e505cf8ddc0c9d 100644 GIT binary patch literal 985 zcmaJ=&2G~`5KbFFN)DX*0Lz}*Lu{H}P-?qs+M=TH6G15A6uI_dud?2Cz2i9H);kxD zNW1{|z5qNKGqFqBAQ)@cyX(*M^L?}9QTxG8i|otmZ^N(Z$K&IzR*Oa#&myBg$;4S? z$~(e|%|&6Q(LUdIo^mF1WMZikpTD0x?>*y3fmg{m5x@|ut{)yCxO-C$rgm2*Kyu%6tHtO*kpH7jHS@JE&blcKrfln{2vfa@x$GL`wi;?TK z&A)vXdAAfAC1#|iwHIC9v-eu^iN$x;%nv{Ojp@4wlS!b)huy~QUAlXfOF~SZH}E`Z z&~mF#T9=vsTw!Ym=gMC>ab50ZpT#6MMbzI|XR7BoPi2j0${yxJE(Sa2PpeVjjr)<1 z#?bx!ssKoe=d9LE0sxY-hD)OH_zpyVhI{rtqHOFg<#cS1y9WSHZ z>zaGGWf`CTD3X_*SkAL2I!d`*)LLr!pF*{@{uVRONy@amH7cw%Vo_o_w*KOm!Yhwu zEN{gDW4uagb-HG0b?5t_k6&8Y3=>W^FFpS+*ZB8Lk#DLVMHQiU ztCEY(<<{k1w~+Q+HmODQ>#2B^`Y$v7onF`&6n3n&t$4?I9Zs*;5{Fjo;nGlTJvYnQ z#J?=c)l(#Bj?AWtTeny1F*c?|*`9v$;qj+`f7+h8%g_9~Be!vRRsUY+n^}{}I40(m z_dT(f7YSzM^MA|jbaUH&f4;NkATM(PJ;=bIknG|JWvwW)K-&`xPa{lGL^Fj0$rP{&|9~d6Vl#n}Nsbv;5|;qG37Fa$wlsp6$O)bmlHk#z zA;2499%f`Bo0kSO7CCBx=3$9ehE`*qf8EVKT g&POsaGz4fGC=4-7V`T${3=0rC0DbfjsE2_80M~e2y8r+H diff --git a/tests/general/widgets/inst_nplug_3.wgt b/tests/general/widgets/inst_nplug_3.wgt index 5d98267da5e6a7b432f502dbb1942157c523ae95..39693c996f5d1873b6fc918e1541de454c56562e 100644 GIT binary patch literal 1222 zcmaJ=O>fgc5KU=8YPt3Rx9y(VL%dYEpwv#)PqiwA9EyNbW$cN)sEUl?ix?n0JM!s>-W6o-Puh zjBpUc9jJ@)3sAs0barbZdmD_*SK$zP{j5x+GK?06Sr#Id!w?LzjxT12jdh>OMo{=) zfy@+9z@>^|{(&;VciMn=pa< z2+j()EoA}m^%6rA-kn{=gJlfj&MI_s0iC)y?pIu$PnRk44a&YX9GXjQyA+toa zZMM6BAGto;SK}Nwn|B>>gb@nc-yVz7urPpu6X;$nl$brn=5}Yt7Y^ju7p@q0Ied5g zi5VPcM8jv|BPn#L;&!AnU38NIKyhMr-A_Bc4{jnVi7B%bTJiEi=TKzhT1AL`K~U?F z+wb{+jdjTk0K-%gp7^E{C^nz3JTwO4+TDppK_f86vrzV0&kev%4@Wt<)olj3&em%q*s`3|MuYTFc_v*HqgJ zI?US^VKEd&4`CoP@Nk3=d%bLU4Z<66Q9Psj7b{OTS08?~b?WKFo)%BI>DQdWg`cFU yTufxsug2NkwpZJ9a=Q9hv&&W2UUs+b);67dZA57_|MZ!KuF>x=?LP_JYW)MFZcx7f literal 1425 zcmWIWW@Zs#U|`^2c-i3U$epaHD9y;guoZ~87-SeS^HNeP^fF3vb3#Kn8JMTO%nJbF z(h6<{MwS=M3=Ci*H1J>^lcI>t>+n4Vmkysg=p9^co_Y0{TJEi8-^t0IPP-njKs+rS0l^($*b6F307|itdwwutVQ^R50 zaD4k!ahF#-VQ->O#7f6(@>QH$_;4R@hgo&6+tOLr=kLm#_+W)+<4u{2%{n{xzOc?dWjuO5d09n=^NsKlQ#kIANA+R-ujWz#{&8B;o6PgWDSXIz)LIDdiM^RRRKzp@9w zgSWWR)lt9aoAo+iVE+bUQ1B+_=cQ$)>s3I5ch;-C01!qC-q>>+`wkiKusxV**ZOpB zTd;VDs_ab3cWEJ}VH>CHQZ3Z)SiXEq2cx%~PVKk+**Cv0DUfecX%D};(oF4n%(GQ8 z$@wZXdsXfPto@_#^FrybX}*l!k(umS=MvvV3hAuPt}Y&U3TDZS^r+=ncGy>3Mk!8>wBXAU*s~A z%)cq@EvdKn&Clsl2llNpN z(^rpIZh!!0`a&4_2AD>Xjg&w$vN%6CH7zqIRj;I?1Z?6QplM6+naBu?7Gx87&`boI zatLU`VSJ{zwK$`g!hvK8*n}rOIoN&1$Rx*%EB{G=9mWVGw={y7$hnafk{i*IN`N=Q zJj?`#Y+gLjSmfjfG!IMCgP4aaIw9tPT(+e#kck0bvML6MHfM9e5hHqi!HHp0?6*fdZAz%Y%K4HS56 OK=>CJ9d$rG3=9BbO|Sa^ diff --git a/tests/general/widgets/inst_nplug_4.wgt b/tests/general/widgets/inst_nplug_4.wgt index 9275ccace14670cb80b1541b5f03647032e2b23f..78dcecc58248860e7c41e04eb21746ef2ee196cd 100644 GIT binary patch literal 1104 zcmaJ=&u`N(6z(V>ZC7^Tfb{TbJ2VEZLa0kRt=-V1jnP9nY?t9CUSc)1gY7IWNJtY` z{sAsr_!lN|;9ujwbKR(05qpsnJO2EBeBblnxcP9i;q2S#_uhwRKfdg*H5zVg;J;YO zOOXcCNgnRu3$C~}Ldl4{3|3{EB;^(mD@{Z)Yl{x0RaFJm zPM~y3rJ){ThzE77_{7oS0y44?NLOY~$#KwAv zX$h*&KL9h`x&vm9v{As?w$rA%6}%9ZXQ4Fq{z53`+aPpdJPuxN{gXgqlyQrvWy!o7!? zFg3~CR%EE}(GV=tO0aK0=p$#z2=liI?s&Grx0Sw?ikFC-(=bNH)N1U@T)2N1@ z<4VY)v|y1pETFVjNdijtu>-~tsZb471#zwn-`d_KaK-WxfrnFJ0sF+Y&D24{KD^71UDLg0rFZoK>z>% literal 1420 zcmWIWW@Zs#U|`^2Fllsk6s}(UM~;z!VK)$SF~~4v=B1=o=w+1T=7ffDGB7K@$_sD< z;?fFk21b?_%nS@*!Z*-1|FD9<+{y8Usa|Z;7s{?Ww(Uwyh-B2(X6qD{0xk`f7>h?w z?u#GaB&8zY|Gx13yTH8J=liR;DyQB)d%J4Ky$7704Qg53e|(?CY@Ax&(%1FumJ+k& zf-b?hj%=%&tRA{fF01NheSg$?_o|Y!*z5e+e8*f*%x>A*)Kl&t!I^gc^CbR73&rhB zj2oU_uVSCLPE327_@@dEJIhdy{MriM6`L-n1ie~bCHY5Cw!}?#f}3;*zv}sv^_jmn zUsUUxwW4+t*Btd5kNuTqMf>d%6=*`L4VCCL7eHCpG( zGNt%5vx?GtiHhx;+~l;cNiMJXuCcb?Vz$1-oL1k+9Xn^_+}hUDKl6*_mCJL^zCHhs zApjo2xxf(qIMHy@24Hyq24YYMC+Fv-Wv1&@Kts3}7`h;g7Q(UT4rU!T;9-04`ICs# z_gk`W6IrZ}&nu5OuY5#F)WR!kb@9u~=Y3D{3BOSIu_S(7frRHnJJ*wP`m4ONb2X1n zX`XpGL-lrV%AJ7Ke-wT$e*GoBjQ2{>CI2h6$8MjPv~b%u!*8cHHw1-QSnck5c9wUu zMyHcsv->oM^5Tn{N)vdB6C`ct?f2Wwzr}xV+P1%&T;#S@%h;USr20}&@#5EGork{j zFO6wDUcT9V#qD=rQ?CDE0{NK>=tBmEz7Q8jFat_R0{vW&Q<|QcSFE2{l&hbXn4JpY z>lNpN6IqW}Zos*h7(swAauF~Xk&P5aGqSieDJ8Q=A8gorU|4d##$(uWG{bn%3ViIB=$Yom^!X+N THc+^+0pSl|Ow7E7>yAhmEWeJP3*B#0C%EwuVnTH2<4u=v!bf4+Yk|LX83&i(CpIOOeg$FDc!$)3 z5pi_apiWW6qa#mm-;MiIN|_o(!jVa6(c~)b?Ex4yRBUqY^~o|Pj7vp^f+F>4o@Y@VP_7e@W!NMKc9_pU`+_MoQ;3nL=_Rd5RJ^i_kxvdy zP@fntuOg-#6iS=mP*p^1jan*h8rox1rb_`2b)RUQNDxzryPlvUMy5{+EziuQn)dQ`MQe5ACp5yNuE>0jj&*u6NiT&#~>BS$Sg+onQOCk*w8j?(>HZ9-fb@_`=Sat7n(jcO1WS_pd+i{C08EB_6*SyFJ&j zYhw<7IQ`@0xmU&>y%s-r`=zCmYquSY{(Pz4wfU2yZ;Y3s%TIn)Tg<=xV)ROWjq~15 zch7WR{G)tyEUN9_n)y9H-@_MfbZ7Y4bN=GK_p@)EoZS3P;`EV;$3A`a&E<7_wk_ae zvFlGvUHjqnU*4Vl?$pM`Z*yDIAB^AIk~govb7N{ds;$3T&+Pu<%QL~ln;jg^ETqRy zQi-i)mPZjuGe0?6}|r0zmzgJ6cw3FiO+ literal 1386 zcmWIWW@h1H00FToMn^CMO0Y4=Fk~j@=N0RRhHx@4TkA*$%Q~XSL>Mz)str(c+037C;3k-&$$^C7QNKYO-xTBv%#{Diqh>hDUq=lkhAUdrLINu|$OV!YIRHLad*K2+@I zz4VK2U*D{td2_c4|KqTHu_ky`x~1~9ibs*ZXR}_G+uk*Qm+XS4TZ~?I`?wsN`SZC{ zspzg2{`|s?I|?cnaa>U6nYXS^@AVv^Sqz9k{vJ8maohXzRTF>#+yaaPE?^)7<0vgN zU9TcH2OPSWCSMEyVYG-^8hkqMjsee}_u&G&+;1(Jo{(tm+wdi9LHiRK4zufGi^5&= z_MSBSKka|l6ZbfWZU$3@1B=oulqapy>pOQy-Y2DL{n3?oxE$`co%^v*Y`eL=-?^i% zn{S3Jep!`rBEx^H#Ei#&D+^_w{_t(PqV1p6Hi6;tUL}c6)l7Hx`=`xzur8VNEp7h! zyiY_TM4r-WN?W(7ree{#>#T-~!zeDi6Uv@d%aYTDf`H*7wwsW|;p z!}y-QOATVWIPN71VQK!6ZR9|k8Ms!%HT{=y$*rQAv_b_Qn9iqi%sYW5j7DS3a zySE{TxotwVt4GWoH%D4f5g|>2Fi|)%hYWR31U>}fIFhZ#Q6wv1b){&i42!a-5h;0b|%5itn);b(5;<7>`<|q`k#V9q1qjeo zax-|fu{B)XTk7rTW12?TKE$qsKQThU$?Jr2;=GuV0kVvOiq@={o;yF@eJE*~dX$*x z_--a*O8=y$MD#N?Rg9}^k6OKFopqot4s;GycOJF?tRnPesfEy5Zw)-%>h10TDM!#1 zoZ14R^)}2}J5s`wXnOm33+gH~o2Guf8fSsJBOFOgBdhdR+0`43MxG;+UDL-({zR&H zJS%A75$xpCOml(?pIAL5CBkGIiGkEsN~U}QBCtHEh^p$Mk4#ultE!lkA4=uQM`4p} zAVYx^>Sf!*JSM`-?+=U^f+kRmm!Wf907PnDmnY7Gtx9FKd-U>HjTD{eA;5|-g2I^vHm=lY1zC&os!v8 zGcOBi|E^|wu2hk!wExwgFWa|8_}#itSjPwoKrUdAF)*+-ue8eyJ6QflfPn#oIY0rJ zoS&yxke3b)KAxY)eSe|`A2|FrtF!(SsE5VF8dn#`JDmEn@_=!0oCy*SKvU8()AcH# z@z7$B8}JR)AW&qq2A%XfY#^}ryS7d|m(z{JcoFsh);TK#TKP9j%1nBAW16kv+xw4A z-W}qc|7Pa)p80C^5nE^dY2ZI4WoVmRe{)KMX6{lS-DUCf^_OqI+@3V)`>Iupo-DH! zGMZn!vwZ)1-dFK6zh=!o;O?S zWuo{o#>RAdi;sa>31iRRE|w6*V(C7u_-k5PsxX+3l8^M249Z7WgcE4 zU9{)Zkq!fv=FSwYh>dK~zMSh~&%{}Y%RUhhkLT^3yrW*sdXtVfN2A1nd%yA>FP1xW zUXEScc2#nI_wwyWum73qsard{E4uMqsL+3Z%|oBJ6d!#ej);4f+zoc%L;xjNfN`H( zT&xd{cM0B$zMn9oE5MtPNsbwo`RdVgp9I(_U?N~>Xaq5l^CBxGFQVl`h=I5gBg8zA zNpBnNfyN?|CeSpVpY_Lmu^I<)A7-LNc3!Oz0|Rmr1sVuSqFBv?I1e+toM7$~V0i1O e5405$d_bc>!G~cKD;vlsEI?=h^h++tl?(te8?KK4 diff --git a/tests/general/widgets/tizen_app-control/config.xml b/tests/general/widgets/tizen_app-control/config.xml new file mode 100644 index 0000000..b2aa6af --- /dev/null +++ b/tests/general/widgets/tizen_app-control/config.xml @@ -0,0 +1,28 @@ + + app-control + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/general/widgets/tizen_appservice_disposition/icon.png b/tests/general/widgets/tizen_app-control/icon.png similarity index 100% rename from tests/general/widgets/tizen_appservice_disposition/icon.png rename to tests/general/widgets/tizen_app-control/icon.png diff --git a/tests/general/widgets/tizen_appservice_disposition/index.htm b/tests/general/widgets/tizen_app-control/index.htm similarity index 100% rename from tests/general/widgets/tizen_appservice_disposition/index.htm rename to tests/general/widgets/tizen_app-control/index.htm diff --git a/tests/general/widgets/tizen_appservice_disposition/config.xml b/tests/general/widgets/tizen_appservice_disposition/config.xml deleted file mode 100755 index 4544234..0000000 --- a/tests/general/widgets/tizen_appservice_disposition/config.xml +++ /dev/null @@ -1,12 +0,0 @@ - - Disposition_attribute - - - - - - - -- 2.7.4