summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix replaced component uninstall4.3Katja Marttila2022-03-226-3/+91
| | | | | | | | | | Replaced component was uninstalled when installing other components although no update or install was requested to the component. Fixes also a bug when some components were uninstalled unvisible from user. Task-number: QTIFW-2577 Change-Id: I6a7e9ce4a56991dfbdea53eb376d782dfb5d050a Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix extracting entries with file paths that contain unicode charactersArttu Tarkiainen2022-02-171-5/+61
| | | | | | | | | | | | Libarchive stores most paths internally in a multistring that can contain a combination of a wide character string, multibyte string in current locale or unicode string encoded as UTF-8. Try to retrieve and set a variant of the string with the correct encoding when converting libarchive strings to/from Qt string classes. Task-number: QTIFW-2506 Change-Id: I7e7c1e3c5709b669df68b2f3918789ad4ebe4f13 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Remove extra linebreak from ConsumeOutput operationKatja Marttila2022-01-311-1/+1
| | | | | | | | | ConsumeOutput may be run to fetch a file path. Extra line break in the end will cause problems. Change-Id: I61133a66fb3d3a6961e9f79c11f783b5d103f046 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Update license headerKatja Marttila2022-01-247-13/+13
| | | | | | | Use https instead of http in www.qt.io/licensing Change-Id: I0a2e97afcda03d50fd823be8e11426c2399a3b8f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Make 'override' specifier usage consistentArttu Tarkiainen2022-01-211-4/+4
| | | | | | | | | Add where missing. Replace occurrences of Q_DECL_OVERRIDE macro, building IFW requires a C++11 compatible compiler so the language specifier is preferred. Change-Id: Idb75e2813d26b9da85e03891f0ae9537c6524c56 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* RemoteObject: Fix warning on calling QLocalSocket::waitForDisconnected()Arttu Tarkiainen2022-01-202-3/+57
| | | | | Change-Id: I1d5fdfedaee35c530b383951e6fc69b75bd67d64 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Make Updater -view checkbox selection fasterKatja Marttila2022-01-191-1/+1
| | | | | | | | | | If there are lot of components installed, querying core from component caused unnecessary performance hit. Also replaced the foreach keyword with the preferred C++ range-based loop Task-number: QTIFW-1021 Change-Id: I961439ba14f26fee21f201769a71319b4b98d14b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add <TreeName> value to 'list' and 'search' command outputsArttu Tarkiainen2022-01-171-11/+21
| | | | | | | | | | | | | Print both 'TreeName' element and 'moveChildren' attribute value with detailed verbosity mode. Also use QXmlStreamWriter to write the output documents with deterministic attribute order, QDomElement stores the attributes internally in a QMultiHash map, which is randomized. Task-number: QTIFW-2452 Change-Id: I8eec64d39394f4092f8505ec99869165c82d11da Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix executing tests when configured without libarchive supportArttu Tarkiainen2022-01-111-3/+3
| | | | | Change-Id: Iaac72aa3d856a10c830f018ceb5c6ad87f4f28a5 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* ArchiveFactory: register handlers for .qbsp file extensionArttu Tarkiainen2022-01-114-2/+5
| | | | | | | | | | | QBSP archives were missing a handler which caused UnzipArchiveTask to fail when fetching metadata. Also fix the resulted segfault in UnzipArchiveTask::doTask() when ArchiveFactory::create() returns nullptr for unknown file extension - it now handles the exception properly. Task-number: QTIFW-2475 Change-Id: I72624763a06d6e7495daebd69970a5f22a4fd6d3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix segfaults when failing to fetch compressed repositoriesArttu Tarkiainen2022-01-112-15/+15
| | | | | | | | | | | | | | | The ComponentModel object was not always reset in case we already got to the point of clearing the source data (deleted components owned by PackageManagerCore from previous fetch) and failed after that, leaving the model with dangling pointers to the deleted component objects. If we were already on ComponentSelectionPage, this would cause segmentation faults when the component tree view using the model would be shown again after fetch. Task-number: QTIFW-2441 Change-Id: Ie779de5ca0a3c4ae895ea507e6be4a2f7343501e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix Replace -element beviourKatja Marttila2022-01-1129-1/+489
| | | | | | | | | Replacable component was not correctly removed in install and update. Also added new tests for Replace element. Task-number: QTIFW-2454 Change-Id: Idce7fd1ef0ac2025ca5ca0952ab837e14516ac2b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Do not replace conflicting remote packages silently with localsArttu Tarkiainen2022-01-063-0/+120
| | | | | | | | | | | | | | | | On (tree)name conflicts with other than the same component in local and remote packages - instead of silently replacing the remote package with local, do one of the following: - Remote package A may have declared the same tree name as installed local package B. Catch the case and re-register package A as an unstable component with the original name, if possible. - Remote package A may have declared a tree name that conflicts with local package B's name. Do not register component A. Change-Id: I16ac583ea10bf203d8b8d0b19e6890f03cf0067a Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for moving child components with <TreeName>Arttu Tarkiainen2022-01-0641-3/+531
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new optional "moveChildren" attribute to <TreeName> element. Children of components declaring "moveChildren=true" attribute are calculated a value for an automatic tree name element. Multiple components in a single tree branch can declare a tree name, the order which the relocation happens is from leaf components to root components. Components may be moved under another tree name target. Components may be moved to an existing identifier part that does not have a component, for example in the following repository structure: rootA.childA rootB rootB.childB the "rootB" component can legally declare a "rootA" tree name. The tree names of components become static after installed. If a repository declares a new tree name for a component that is installed, it is only applied after updating in maintenance tool. Child components, which have an automatic tree name, are moved if the parent component is updated with a new tree name, however. Task-number: QTIFW-2380 Change-Id: I9c44a114d3c1248b7e2dd4f0b5cda0739af102f3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix replacing components with <TreeName> elementArttu Tarkiainen2022-01-062-0/+28
| | | | | | | | | | | The QHash dictionary used to store component objects before building the component tree may include keys that are either original names or overridden tree names of components. Only the former were handled when removing replaced components from the QHash. Task-number: QTIFW-2455 Change-Id: I340aa61c724da0da62d7e5a875a38b6ecc0eceb5 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not block installation when there are conflicting component namesArttu Tarkiainen2022-01-062-14/+17
| | | | | | | | | | | | - Components with conflicting original identifiers are not registered. - Components with conflicting tree names are registered with the original name, if installer is configured to allow unstable components. Otherwise they are not registered. - Unaffected components can be installed as usual. Task-number: QTIFW-2444 Change-Id: Ic1eaf3878f974185bc68202930134e5199dc0398 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Tests: Update clientserver blacklist linux versionKatja Marttila2021-12-311-1/+1
| | | | | Change-Id: Ie9e9b5659097d86d897995398ba29e0f8d7ba536 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Tests: fix leaking PackageManagerCore objectsArttu Tarkiainen2021-12-299-67/+70
| | | | | | | | | | | This left quite many temporary files from being properly released and could affect the test cases that followed, for example when temporary repository directories were not cleaned they hid problems in the clearing of downloaded archives resource mapping. Change-Id: Id8ba1837486264d35af0c297a0519e160eb99d60 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Tests: suppress "QTextStream: No device" warningsArttu Tarkiainen2021-12-291-0/+1
| | | | | | | | | | | | | | | QInstaller::init() registers the custom message handler used by installer, which formats and prints the messages and writes the installation log. We clear the buffer device used for the log contents before it gets written on disk when destructing the installer's PackageManagerCore object, but on tests there might be several core objects. Use a silent message handler instead. Change-Id: I6694bca1dfffaffd1389f8f619531f1b0052c090 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Tests: clear binary format engine before constructing new core objectArttu Tarkiainen2021-12-291-0/+3
| | | | | | | | | | | | | | | | | This fixes issues on auto-tests where we construct a new PackageManagerCore instance for each test case. Installer registers downloaded archives into internal resource collection mapping with a naming scheme that contains values such as: "installer://collectionName/resourceName". As the "BinaryFormatEngine Handler" singleton class retains the resource collection mappings between mock installer runs, we ran into situations where we would register different actual paths with the same mapped file names, or the old resources would not exist anymore on disk, causing failures at different points. Change-Id: Ic7ee30886a2c586fbe0efbe4bb4d19a24d9dba83 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix deprecation warnings from building with Qt 5.15.2Arttu Tarkiainen2021-12-216-7/+6
| | | | | | | | Also update build version requirements. Task-number: QTIFW-2388 Change-Id: Iae1949548dda7a3b8d448228e27060efb5abd8eb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Libarchive: enable support for uncompressed tar archivesArttu Tarkiainen2021-12-093-1/+3
| | | | | | | Task-number: QTIFW-2404 Change-Id: I4c62d283d54a1f180f9c3525da0728a1c75ef50e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Enable handling 7z archives with libarchiveArttu Tarkiainen2021-12-0911-91/+25
| | | | | | | | | | | | | | Make libarchive the default handler for 7z archives if the IFW tools were built with the 'libarchive' configuration feature. The LZMA SDK library is still built and can be used instead if the config feature is omitted. Also modify tests. Task-number: QTIFW-2375 Change-Id: I1091d5fa140cbd783cddecc595f35c6562639b07 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Libarchive: fix handling of glob pattern arguments when creating archiveArttu Tarkiainen2021-12-031-0/+32
| | | | | | | | | Arguments with wildcards were not working if archivegen was called from somewhere else than shell, like from within a Python script. Task-number: QTIFW-2423 Change-Id: Icf6d6c3c45ad9050a03c1a3dd7c4d9f10d1f3be6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add Extract operation tests for new archive formatsArttu Tarkiainen2021-11-267-1/+33
| | | | | | Change-Id: I63f80301f452d3d83384fb2c7b3039b43b9d61fe Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix resource path separators in test .pro filesArttu Tarkiainen2021-11-1823-23/+23
| | | | | | | | | Building with Qt 5.15.2, the qmlimportscanner will complain about "No such file or directory" for paths using backslash separators. Task-number: QTIFW-2388 Change-Id: I7e8b25c67505524edc83077ab52bb2c0ed03884a Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* 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>