summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix creating archives containing Windows shortcutsArttu Tarkiainen2021-10-291-0/+56
| | | | | | | | | | | | | On Windows, QFileInfo::isSymLink() returns true for *.lnk files, which unlike symlinks contain data - when creating an archive the writing was incorrectly skipped. Also add test case for creating and extracting archives containing either symlinks or shortcuts. Change-Id: I3ebbd28e889ffa17ece7378c3812244a55df20d5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for seeking files handled with libarchiveArttu Tarkiainen2021-10-261-10/+2
| | | | | | | | | | | | | | | | | | | This fixes losing executable bits of files in Zip archives when extracted. Zip archives store file metadata in two ways, partial metadata per-entry and full metadata at the end of archive. IFW's read implementation previously did only streaming without support for seeking archives, which is required to obtain full metadata - meaning the partial metadata was used instead by libarchive's Zip reader. The extracted entries between the two metadata types are not consistent. This change also enables usage of archive formats that cannot be accurately handled with a streaming model, like 7zip which needs to read key data from the end of the file before reading file data from the beginning. Task-number: QTIFW-2372 Change-Id: Ie4ed33040fc52de073546e46d9da726816f47a81 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Print essential component information with std::coutArttu Tarkiainen2021-10-221-53/+59
| | | | | | | | | | | | | | | | | | Do not use our own message handler for printing XML-formatted component information (from 'list', 'search', 'check-updates') that is expected to be included in output regardless of the current verbosity level or logging rules. Higher verbosity can still add more information to be included in output. Also: - Modify auto-tests to pass and check the output correctly. - Remove now orphaned 'ifw.package.info' logging category. - Rename 'LoggingHandler::printComponentInformation()' to 'printUpdateInformation()' to better match the intended purpose. Task-number: QTIFW-2349 Change-Id: Id1a868f8f824c606825cd6168974a7e3845383e6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Blacklist tst_ClientServer::testQProcessWrapper()Simo Fält2021-10-071-0/+2
| | | | | | | This tends to fail on CI with rhel 7.4 Change-Id: I50408060f75d57497b878bc171289bb39a859644 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* 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>
* Merge "Merge remote-tracking branch 'origin/4.1' into master"Arttu Tarkiainen2021-09-154-22/+62
|\
| * Merge remote-tracking branch 'origin/4.1' into masterArttu Tarkiainen2021-09-104-22/+62
| |\ | | | | | | | | | Change-Id: I8e2864b3ec81cffa907fe02ff1f2019e155c54e3
| | * Repogen: Fix updating of repository from a partial package set directoryArttu Tarkiainen2021-08-164-30/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When collecting information about the paths to be compressed into unified metadata, if the package directory used to update repository was missing replacements for two or more components, it would reveal an issue with the traversing of the existing repository directory. Fix by adding the missing "cd up" after entering a component entry directory. Add new test case. Task-number: QTIFW-2287 Change-Id: Ica1228968398b6e987bdf89336f74f53fcd35d27 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | | Add tests for the new archive handling classesArttu Tarkiainen2021-09-1417-177/+576
| | | | | | | | | | | | | | | Change-Id: I1e3a91fd0722b0b73197257ec5092a617b41516e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | | Add support for handling archive files with libarchiveArttu Tarkiainen2021-09-143-8/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libarchive is a multi-format archive and compression library written in C and licensed under the new BSD license. Usage of libarchive brings in support for additional archive formats (in addition to 7z) with the installer framework, like zip and tar, with several available compression methods like gzip, bzip2 and xz. libarchive will coexist as a supported archive format handler with the LZMA SDK currently used in the framework, which will continue to be used for handling the 7-Zip file format. This change introduces classes for handling archive operations using both libraries, removes most calls to the old Lib7z facade and migrates the code base to use the new handling methods. Task-number: QTIFW-2255 Change-Id: I8d77110ded503060495a3d6fdfdbc26281df9453 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Fix qbsp adding from GUIKatja Marttila2021-09-026-0/+73
| | | | | | | | | | | | | | | | | | | | | | Qbsp package adding failed using gui if the package with the same name existed in the component tree. Also increased priority to qbsp package so that if the same name and version exists in the component tree then qbsp package is used. Task-number: QTIFW-2312 Change-Id: I732fef1a7ba503d2332f411e15b6873c63dcf630 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Translations: validate and update translatable user interface stringsArttu Tarkiainen2021-06-232-3/+3
| | | | | | | | | | | | | | Task-number: QTIFW-2245 Change-Id: Id9a79c7c572dc588c05ad37c67ae3f0431fa7cdb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/4.1'Arttu Tarkiainen2021-06-021-0/+15
|\| | | | | | | Change-Id: I86049138466399411ba36791330f4a94faad8c52
| * Add possibility to list components with regexpKatja Marttila2021-05-211-0/+15
| | | | | | | | | | | | Task-number: QTIFW-2225 Change-Id: I6a7fdfc1070ad54d520563cae7d2446e97e2e87c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Merge remote-tracking branch 'origin/4.1'Arttu Tarkiainen2021-04-146-0/+25
|\| | | | | | | Change-Id: I8adecc4573134d2b33f2b98fba9372320b2f8737
| * CLI: Fix offline installer creation with empty component meta-archiveArttu Tarkiainen2021-03-236-0/+25
| | | | | | | | | | | | | | Task-number: QTIFW-2189 Change-Id: Ic6f56156194039cca7bebf095fad8c1fc66fc275 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Offline-generator: Fix duplicate package entries in internal Updates.xmlArttu Tarkiainen2021-04-1223-33/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a somewhat rare case, it is possible that a same package exist in multiple repositories. The latest available package from remotes is used - however if we select that package for inclusion and also implicitly get some other package from the another repository it exists in with an older version (autodependency, etc.), that repository is then also used to parse package information, and we store a duplicate entry of the package to the Updates.xml to-be-written to the offline installer binary. Fix by appending only the package with the latest version to the PackageInfoVector object used to temporarily hold the package information. Task-number: QTIFW-2190 Change-Id: Icdb3dc979153dfada37fdb0aabb3c718bc8aedff Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Add support for additional filtering of search resultsArttu Tarkiainen2021-04-092-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Search command results can now be optionally filtered with the '--filter-packages'-option, which takes an unspecified count of key-value pairs that contain the desired package information element and a regular expression used to find matches in the element. Example usage: 'installer --fp "Version=1.0, Description=Some text" search *' Only the packages which match all given filter rules are included in the output print. Task-number: QTIFW-2168 Change-Id: I788b065d95952b988489c36db80b3c859b970f05 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: improvements to 'search' and 'install' command outputArttu Tarkiainen2021-03-113-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously subcomponents of a virtual component were shown on search results, and trying to install these would print a bit vague message: 'Component not found'. As the sub-branches of virtual component nodes are hidden on GUI, we should also hide them when using CLI search, and give a more appropriate error message why the component cannot be explicitly selected for installation, if the user still tries to do so. Also some minor refactoring to the handling of supplemental information about binary type of the running installer/mt. This change does not fix the possible case of an install script changing the 'virtual'-state of a component, as it would require downloading and evaluating the full metadata for repositories (or components), which would impose a performance penalty to search. Task-number: QTIFW-2168 Change-Id: Ibacaca23c38f5ea98967955d91849cefc1f11f61 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | tst_CLIInterface: remove unused repository contentArttu Tarkiainen2021-03-1117-5/+0
| | | | | | | | | | Change-Id: I787b6ae58a01af1d8be5f3504e561982cf8acc0c Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Cppcheck: Add explicit and override keywordsKatja Marttila2021-03-093-8/+8
| | | | | | | | | | Change-Id: Ia8305652afdf29cbc88328b76f5156187aa54dba Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Cppcheck: Remove unused variablesKatja Marttila2021-03-094-14/+2
| | | | | | | | | | Change-Id: Ibf92b3e93ca11428f92e60031a5c8c3c5f60b402 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Cppcheck: Misc fixesKatja Marttila2021-03-092-3/+2
| | | | | | | | | | Change-Id: I77acdecaf5660f2d7aa723c56d53a97e5687a8b8 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* | Add alternative way to update components from repositoryKatja Marttila2021-03-0316-7/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Refactor repogen for easier testingKatja Marttila2021-03-021-92/+37
|/ | | | | | | | Functionality is only moved from repogen.cpp to repositorygen.cpp. This makes the repository testing much easier. Change-Id: I2078e2880955c71b9ffa0ac46501eafbd499c3ba Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add unit tests for offline generationArttu Tarkiainen2021-02-1626-15/+321
| | | | | | | | | | | | This also changes some of the return values in our CLI-related functions in PackageManagerCore class to better catch cases where we exit without failing but also without doing anything. Also adapt existing tests. Task-number: QTIFW-2028 Change-Id: I73c4ca1b20d439773d0e290195f137d0d7369d17 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add possibility to move component in component treeKatja Marttila2021-02-1138-15/+369
| | | | | | | | | | | | Setting <TreeName> -tag to component.xml will overwrite the default location of component in installer's tree view. This way we can define the component location without a complete repo build. Updates.xml can be directly modified by adding <TreeName> -tag for easy relocation of components. TreeName must be an unique name - it cannot conflict with existing tree name or name. Task-number: QTIFW-594 Change-Id: Ie69f90f1303d932369d566d0d7b4bc0e354505c6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Try rerunning execute operationKatja Marttila2021-02-053-1/+77
| | | | | | | | | | | | | Execute operation can have hard coded paths to program which is executed. In case the program is relocated, UNDO operation will fail as it will not find the program. Implemented new XXXX_OLD value which can be used for overwriting the hardcoded value. In case the program execution fails, program is tried to launch again with the replaced value. Task-number: QTIFW-2125 Change-Id: I446a4c423e53cc4ffc6e5e25617d2400945ac3d9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for setting minimum wizard dimensions in config.xmlArttu Tarkiainen2021-02-045-0/+14
| | | | | | | Task-number: QTIFW-1903 Change-Id: I4d8eaf71a1a63dfbfa75ea61af728fa1f5e3e9f3 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix InstallIcons and CreateDesktopEntry operations usage as rootArttu Tarkiainen2021-01-152-0/+4
| | | | | | | | | | | | | | | | | | | | The operations write the output files to a valid, writable directory value of XDG_DATA_HOME variable if set, otherwise defaulting to "$HOME/.local/share". This follows the XDG Base Directory Specification but misses the use case of system-wide installation: the XDG_DATA_HOME should only contain base directory relative to which user specific data files should be stored. Prefer a predefined value "/usr/local/share" when launced as root or the internal elevated admin rights handling is active. This should be a sane and well known value for applications installed system-wide, and should not conflict with files extracted by distribution's package management system. Task-number: QTIFW-2093 Change-Id: I96fab3367122e7df783697e07baeb71dfd9b3f0e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for generating offline installer from onlineArttu Tarkiainen2021-01-151-4/+4
| | | | | | Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Allow disabling undo in RegisterFileType operation during uninstallKatja Marttila2020-12-301-0/+24
| | | | | | Task-number: QTIFW-2089 Change-Id: I8cccd471718eaaa6dc167a852b8854dc424f994e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo in SimpleMoveFile operation during uninstallKatja Marttila2020-12-301-16/+44
| | | | | | Task-number: QTIFW-2090 Change-Id: If0c2d4901ee1fb634e1e436ab14a507d06dd99ab Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo in CopyDirectory during uninstallKatja Marttila2020-12-301-9/+34
| | | | | | Task-number: QTIFW-2088 Change-Id: Ic5e781b89b1c74fc8f65575bd46c073610545523 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Allow disabling undo of GlobalSettings during uninstallKatja Marttila2020-12-303-1/+107
| | | | | | Task-number: QTIFW-1973 Change-Id: I89f15c8ed7d56c3e1bc72d3c740e9054363f9390 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Introduce ForcedUpdate element for componentKatja Marttila2020-12-227-4/+50
| | | | | | | | | | | Setting ForcedUpdate for component will cause a mandatory update for component if it is installed. Component must be updated before any other component can be updated/installed/removed. Essential components are updated at the same time with ForcedUpdate. Task-number: QTIFW-1565 Change-Id: I6af07fba222371e8cd161d1fec65301450077d86 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add option to define operations in component.xmlKatja Marttila2020-12-0745-241/+642
| | | | | | | | | | | Operations can from now on be declared also in component.xml. The operations are performed, backuped and rollbacked the same way as they would be when defined from scripting api. Task-number: QTIFW-507 Change-Id: Ia509219b94737136c3de25db0cb0c72076b48380 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Tools: refactor to move general purpose functionality to installer libArttu Tarkiainen2020-12-021-1/+0
| | | | | | | | | This makes it possible to utilize parts of our existing tooling in the offline installer from online installer generation process. Task-number: QTIFW-2048 Change-Id: I7ee605be75541cc83a3b6909089bda45f0835bcf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Print package information in xml formatKatja Marttila2020-11-251-22/+38
| | | | | | | | | Also removed logging categories for package information, the full package information can be printed by increasing the verbosity level. Task-number: QTIFW-1950 Change-Id: I4bce019a63ba1fbf48e3bb0ca45511e42d4974c9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Merge remote-tracking branch 'origin/4.0' into masterKatja Marttila2020-11-2426-47/+81
|\ | | | | | | Change-Id: If5205ff6ef2c8989520e24d41595c04d5920d207
| * Repogen: Fix unite metadata when --repository switch usedKatja Marttila2020-11-1023-40/+67
| | | | | | | | | | | | | | | | | | | | United metadata 7z was missing the component which had no update available. Task-number: QTIFW-2018 Change-Id: I069fd852499f157075bf28e3ccfef3e42e5f30a9 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
| * CLI: Tidy up progress message printArttu Tarkiainen2020-11-051-4/+4
| | | | | | | | | | | | | | | | The debug print does not look very nice when the string contains escape characters for quotes or extra spaces. Change-Id: I9428d3aef4e3ebd693f66083447430e4e2600098 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
| * Fix loading controller script with comment on last lineMartin Kampas2020-11-041-0/+2
| | | | | | | | | | | | | | Task-number: QTIFW-1062 Change-Id: I3deb46cae74d1e5851d4ddd4b58c0ba19375ddbd Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@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>
* | Automatically uninstall unneeded virtual componentsMartin Kampas2020-11-045-2/+27
| | | | | | | | | | | | Change-Id: Ifbbfec4449a9f5b0a79269fc7ddfcc1780e762e5 Task-number: QTBUG-76210 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Add possibility to filter installed packages with regexpArttu Tarkiainen2020-11-041-0/+4
| | | | | | | | | | | | Task-number: QTIFW-1953 Change-Id: Ie291e8ae96d46082e342e9bcb152258862813afd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Replace obsolete qrand() with QRandomGeneratorKatja Marttila2020-11-042-2/+4
|/ | | | | Change-Id: Ie61b192bcf047cc70f728ea15370ff50e7a41769 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix segfault in 'void localSocket()' test functionArttu Tarkiainen2020-10-161-33/+31
| | | | | Change-Id: Iced229d7d364f68599bd6eec20db57838f36a671 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix packagemanagercore test in macosKatja Marttila2020-10-162-2/+6
| | | | | Change-Id: I67178a9df34e3ed4752452dca9a85709fdd4c620 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Repogen: Fix options to work with unite metadataKatja Marttila2020-10-1537-1/+690
| | | | | | | | | | | | | | Fixed regogen 'update' and 'repository' options to work with unite metadata. --update-new-components with unify metadata is prevented. Moved --update-new-components functionality from repogen.cpp to QInstallerTools so it can be accessed from tests. Created tests for repogen. Task-number: QTIFW-1943 Change-Id: I12389f4747154a0f6f51b4f34f630103c2cfef04 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>