summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add invokable methods for converting paths to/from native separatorsArttu Tarkiainen2021-10-071-0/+22
| | | | | | | | Task-number: QTIFW-2344 Change-Id: I971e96ed5b1f1e52c5779a04b7edab0952d89d9a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Cppcheck: Add explicit and override keywordsKatja Marttila2021-03-091-2/+2
| | | | | Change-Id: Ia8305652afdf29cbc88328b76f5156187aa54dba Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add alternative way to update components from repositoryKatja Marttila2021-03-031-1/+1
| | | | | | | | | | | | | | Components can be updated from online repository using version number. Sometimes there is a need to update to an older version which is now possible by using content sha. Content sha can be added to repository with repogen --sha-update <component_id>. If there is a new content sha available in the repository, component is updated although it version number might be smaller. After the content sha is removed from online repository, the normal update with version number is performed. Task-number: QTIFW-1798 Change-Id: Id9e32b0345af5101cccaf6e30c81bd39691d9590 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Fix wrong warning text in command 'purge' for running processesArttu Tarkiainen2020-11-031-3/+8
| | | | | | Task-number: QTIFW-1996 Change-Id: Iaf9aa6bfd39d266ed052838e969881c168b4b2ed Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix packagemanagercore test in macosKatja Marttila2020-10-161-0/+6
| | | | | Change-Id: I67178a9df34e3ed4752452dca9a85709fdd4c620 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-251-1/+2
| | | | | | | | | | | | | | Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix build failures in PackageManagerCore tests with Qt 5.9.xArttu Tarkiainen2020-04-141-9/+9
| | | | | Change-Id: Iae43369276282711b242eac41e32997ebbfb40ce Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Initialize user arguments earlierKatja Marttila2020-04-081-0/+39
| | | | | | | | | | | | | | | User can give arguments from command line, for example AllUsers=true, which can affect to other core values. Initialize user arguments in core constructor so we an utilize the user given values when defining other core values. Added also unit test for overwriting core data values. Note that some values belong to QSettings such as MaintenanceToolName which cannot be overwritten. Task-number: QTIFW-576 QTIFW-1730 Change-Id: I82a05f9f4bc8498f4e0e2af407ba29f6dabbf030 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add function to allow additional processes to be runKatja Marttila2020-03-311-0/+35
| | | | | | | | | | | | | | Maintenancetool does not allow updating install if running processes are found from install directory. Only maintenancetool process was allowed, otherwise the install failed with query to shut down processes. This commit adds a function to extend the allowed processes to be run, this is mandatory when running tests as test executable lies in the install directory. Task-number: QTIFW-1019 Change-Id: I5422b0327e3f77edf3f9c88c74f40eff5cc8c830 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Refactor setting and checking of file permissionsArttu Tarkiainen2019-08-301-29/+0
| | | | | | | | | | | | | | | | | | | | | | | Create methods to explicitly set default file permissions on Unix platforms, use these on installer created files and installation target directory. Add unit test for introduced functions. Remove method introduced in 46aecc23b2983c807ff2232ae9cb9651b4d2fdc2 as the same effect is achieved more efficiently by ensuring target directory will be written with explicit permissions on initial installation. Unlike the removed method, this will also not break if an installed component contains owner non-writable directories. Further simplify PackageManagerCore::directoryWritable() introduced in 89f772f819178ee2502768c3d259d22ecb910fbe. Remove orphan unit test for removed PackageManagerCore::subdirectoriesWritable(). This does not change permissions of files and directories extracted for installed components. Task-number: QTIFW-1412 Change-Id: I59698c78aceef874b1f79482bff5a618b9a1b536 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Enable support for Qt 5.12 in installer frameworkArttu Tarkiainen2019-08-221-3/+6
| | | | | | | | | | | | | | | | | Workaround issues of IFW not being able to work on elevated mode caused by changes in qtbase, namely when initializing socket connection between remote installer client and server, and writing maintenance tool binary. Switch to using unbuffered mode for QFSFileEngine instances as buffered mode support has been dropped. Fix calls to QFile::copy() when running elevated installer process. Make minor modifications for unit tests to pass. Explicitly fail and return when performing CreateLocalRepositoryOperation on non-owned directory. Task-number: QTIFW-1312 Change-Id: I3db72547ee95c87d8c02d27e5b31c7b30e793431 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Gain admin rights for writing MaintenanceTool config files if neededArttu Tarkiainen2019-06-141-0/+53
| | | | | | | | | | | | | | | | Running MaintenanceTool from an elevated directory didn't do proper checks for file writing rights when parsing Updates.xml from a repository, for example when a default repository contains actions inside <RepositoryUpdate> tags the MaintenanceTool couldn't write changes to the .ini file immediately. Make MaintenanceTool do proper rights checking when parsing Updates.xml. Create uniform methods for checking directory writing access as it is used on several occasions. Add tests for directory checking methods. Task-number: QTIFW-1363 Change-Id: I6d634ddbd59429e5b98af1d8010e70a71de40f69 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | | | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | Sanitize QDebug outputKai Koehne2015-07-091-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | Prefer using the stream operator logic instead of using QString::fromLatin1. Add a noquote() where a QString should be printed without any quotes/escapes. This also fixes the tests with Qt 5.5, where QString's are further escaped. Change-Id: Ie3afd14b9355101d3c0b52f30f66ec759c76526c Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix autotests for changed debug outputKai Koehne2015-06-101-5/+0
|/ | | | | | | | | Commit fa5f7c662841b1d13f6610db8817608a24e3a3f6 removed the printing of exceptions on creation. Fix autotests accordingly. Change-Id: Id715b194f893016d23d7e2accf4b131a40a3f906 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Fix auto-test for Qt >= 5.5.0Karsten Heimrich2015-05-121-0/+4
| | | | | Change-Id: I8bdde116fc7721ff07f2f1eec07cfa9cf4c5620d Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix auto-test build with Qt 5.5.Karsten Heimrich2015-05-061-0/+2
| | | | | | | | Still the tst_PackageManagerCore fails here cause the expected "\t" is not expanded anymore by qDebug()... Change-Id: Ia5f9383af6b32e95a198ce612c40fe0e3db2392d Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fix autotestNiels Weber2014-11-191-1/+2
| | | | | Change-Id: I1e3b99fc8adb945f29a241dde4b3da14ad2c68e4 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/1.6'Kai Koehne2014-11-181-0/+36
|\ | | | | | | | | | | | | | | | | Conflicts: src/libs/installer/packagemanagercore.cpp src/sdk/installerbase.cpp tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp Change-Id: I807686f154249930d31de80289389f4655c27525
| * Fix calculation of required disk spaceKai Koehne2014-10-281-0/+36
| | | | | | | | | | | | | | | | | | | | Do not count in already installed components when calculating the required disk space. Task-number: QTBUG-39308 Change-Id: Idff52da33d3e42dd156322115d5c489ba13a0945 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* | Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | | | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* | Compile fix.kh12014-10-081-2/+5
| | | | | | | | | | Change-Id: Ibdfe2c86ee583ff56c3c182543aa57489498f2bb Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* | Rewrite the component getter mess, remove superfluous methods.kh12014-10-061-15/+10
| | | | | | | | | | | | | | | | Now we can combine some enum values to achieve the same as before with the several getter functions, removes the clutter from the API. Change-Id: I6368b0ff77821ac95d1defaec4af27dd7d383396 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* | Add small auto test.kh12014-09-221-0/+91
| | | | | | | | | | | | | | | | | | Also fix the implementation for append component in updater case as well as adjust the documentation. The returned list contains all components independent of the run mode. Change-Id: I36523e13c33b9ca6de6e02fcc31e0f0d6606f65b Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* | Split and implement new installer base, update checker.kh12014-09-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on the former patches, split the installer base into its own class. Use the new binary content read functions. Adjust uses to match the new classes. Adjust installer base /update checker signature and inheritance. Remove all now superfluous functions from binary content. Core engine instantiates the operations now, makes reading and writing more generic. Move product key check into QInstaller namespace. Make use of the new command line parser. Change-Id: I00aff79085b69ce627906881b43f374681ea7e91 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Make the marker and the find function class members.kh12014-07-151-2/+2
| | | | | | | | | | | | | | Prepare for QTIFW-292 and QTIFW-345. Change-Id: I065366742d28e72bc5ae55e70eabf6532b809fea Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* | Move class BinaryContent into its own file.kh12014-07-151-1/+1
|/ | | | | | | Prepare for QTIFW-292 and QTIFW-345. Change-Id: I938b5aa728e8f81eb9521df5753ad80ac630d96e Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Always only delete the install directory if it's empty.kh12013-11-061-0/+153
We have to reset the force removal flag inside the operation to not delete any other files/ folders than our own created. Once the flag is set to false, the operation will fail on any file/ folder still left in the install path. Note: the config.rcc is a dummy file to calm down settings class parser warnings. Change-Id: I66efb5836e310bdb1b64e5647ee76c058cea2a7e Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>