summaryrefslogtreecommitdiff
path: root/test/pacman/tests
Commit message (Collapse)AuthorAge
* pactest: add retcode=0 to several testsDan McGee2011-06-20
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Use standard errno codes in return from _alpm_archive_fgetsDan McGee2011-06-03
| | | | | | | | | | | | | This allows us to not require the context (e.g. handle) when calling this function. Also beef up the checks in the two callers of this function to bail if the last return code is not ARCHIVE_EOF, which is the expected value. This requires a change to one of the pactest return codes and the overall result of the test, but results in a much safer operating condition whereby invalid database entries will stop the operation. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add two currently failing test cases from bug reportsDan McGee2011-06-02
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-05-19
|\ | | | | | | | | | | Conflicts: lib/libalpm/trans.c src/pacman/query.c
| * Fix segfault when uninstalling broken backed-up symlinkDan McGee2011-05-16
| | | | | | | | | | | | | | | | | | Issue FS#24230. If a symlink is broken and included in the removal process of a package, we blew up and segfaulted due to alpm_compute_md5sum() returning NULL and then performing a strcmp() operation. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add test for FS#24230, dead backup symlink removalDan McGee2011-05-16
| | | | | | | | | | | | This currently causes a segfault, which is bad news. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Added gpg verification options per repo to the config file.Xavier Chantry2011-03-23
| | | | | | | | | | | | | | | | | | | | | | Once we do this, add support for VerifySig to pactest. We just check if the repo name contains Always, Never or Optional to determine the value of VerifySig. The default is Never. pacman uses Always by default but this is not suitable for pactest. Original-work-by: shankar <jatheendra@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add a pactest showing failed GPG verificationDan McGee2011-03-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add a few pactests for PGP integrationDan McGee2011-03-23
|/ | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix handling of ignored packagesPang Yan Han2011-03-20
| | | | | | | | | | | | | | | | | | | Noted in FS#23342. When the user attempts to install an ignored package and answers no when asked whether to install it, pacman bails out with: "error: target not found: packagename" This is because satisfiers are not found for the package and execution continues to process_group(), where the package is treated as a group (which does not exist). In addition, test ignore006.py is updated with PACMAN_RETCODE=0 since saying no to installing an ignored package should not be considered an error. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: use actual regexes in OUTPUT rulesDan McGee2011-03-01
| | | | | | | | | I managed to just make deptest001.py fail by changing a DEBUG-level logger in commit b12be99c89. This should not be this fickle. Enhance the OUTPUT rule to use an actual Python re object when looking for matches, and make a lot of the rules use stronger patterns to match with. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest for removing a required empty directoryAllan McRae2011-02-27
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add test case for util-linux/util-linux-ng name switch and depsDan McGee2011-02-25
| | | | | | | | | | | This case currently fails, but highlights a failure in our install process I experienced the other day. Because we don't do replacement uninstalls inline with the rest of the upgrade uninstalls, we can have a time on our system where a critical package is not installed. I hope no one ever renames glibc. Signed-off-by: Dan McGee <dan@archlinux.org>
* Continue resolving dependencies rather than bailing on first errorDan McGee2011-02-25
| | | | | | | | | | | | | | | | | This allows error messages emitted by the frontend to be a bit more descriptive and not have the annoying "well why didn't you tell me that the first time" problem. If a package had multiple missing deps, we would bail on the first one before rather than finish processing all missing dependencies, and only print one error message. Instead, continue through this entire set of missing deps and append all eventual errors. The added pactest tests this case, as the to be installed package has two missing dependencies. However, pactest does not actually test or see the difference in output from before and after, so it passes in both cases, but it is clearly visible in the logs. Signed-off-by: Dan McGee <dan@archlinux.org>
* Various small spelling fixes and small tweaksDan McGee2011-02-25
| | | | | | | Nothing that changes behavior here. Spelling fixes and pushing a variable down to the scope it is used. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a new removal smoke testDan McGee2011-02-04
| | | | | | Hint: this will really stress hash table removal. Signed-off-by: Dan McGee <dan@archlinux.org>
* make -d less strict; add -dd optionFlorian Pritz2011-01-31
| | | | | | | | | | -d skips checking the version of a dependency. -dd skips the whole dependency check. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Florian Pritz <bluewind@server-speed.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* add pactests for -SddXavier Chantry2011-01-31
| | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow both cleanmethod values to be specified at the same timeDan McGee2011-01-31
| | | | | | | | No reason to disallow this- it allows keeping even more packages around in the cache. Test cases included for this case and to ensure the default behavior is preserved. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add three clean cache testsDan McGee2011-01-31
| | | | | | | | The first two are rather standard tests of our two available clean options, and the third is attempting to test a reported bug (and failing to make the given case fail). Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/sync: rewrite target handlingXavier Chantry2011-01-29
| | | | | | | | | | | | | | | | | | | | | | | | | This uses the new public functions to handle targets from the frontend, like it used to be : 1) alpm_find_dbs_satisfier to find (optionally versioned) package or provision 2) alpm_find_grp_pkgs to find members for a groups 3) alpm_add_pkg to finally add the pmpkg_t from 1 or 2 Of course, this adds more code to the frontend, but it completely deprecates sync_target and sync_dbtarget interfaces. This all-in-one interfaces felt wrong and left no control to the frontend. A good frontend should just use alpm_add_pkg, with pkg coming from alpm_db_get_pkg (for normal targets), alpm_find_dbs_satisfier (for versioned provisions) or alpm_find_grp_pkgs (for groups). This also opens the way to provide a better group handling in pacman without constraint from libalpm and callbacks. In ignore006, only the retcode changes, because no package was found to satisfy the target (the only possible package is ignored). Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* Add interactive provider selectionXavier Chantry2011-01-29
| | | | | | | | | | | | | | | | | | | | | | | | If there are multiple providers in one db, pacman used to just stop at the first one (both during dependency resolution or for pacman -S 'provision' which uses the same code). This adds a new conversation callback so that the user can choose which provider to install. By default (user press enter or --noconfirm), the first provider is still chosen, so for example the behavior of sync402 and 403 is preserved. But at least the user now has the possibility to make the right choice in a manual run. If one of the provider is already installed, it is picked for reinstall/upgrade, so that provision 002/003 pactest now pass. $ pacman -S community/smtp-server :: There are 3 providers available for smtp-server: 1) courier-mta 2) esmtp 3) exim Which one do you want to install? Enter a number (default=1): Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* Add a few new provides testsDan McGee2011-01-22
| | | | | | | | These deal with already-installed packages and how they should be the preferred provider in cases where provider selection now occurs. A few involve multiple sync repos. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: sort repos by alpha order in config fileDan McGee2011-01-22
| | | | | | | | The order was non-deterministic before, and just happened to work for sync023.py as it was written. Ensure there is some sort of predictable ordering. Signed-off-by: Dan McGee <dan@archlinux.org>
* Modify all pactests to not use PKG_MODIFIEDDan McGee2011-01-22
| | | | | | | | All conditions that this particular rule tested are better served by using a more specific rule, whether that be checking a package version or whether files inside the package have changed or still exist. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: pylint changes for pmtestDan McGee2011-01-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove epoch as an independent fieldDan McGee2011-01-21
| | | | | | | | | | | | | | Instead, go the same route we have always taken with version-release in libalpm and treat it all as one piece of information. Makepkg is the only script that knows about epoch as a distinct value; from there on out we will parse out the components as necessary. This makes the code a lot simpler as far as epoch handling goes. The downside here is that we are tossing some compatibility to the wind; packages using force will have to be rebuilt with an incremented epoch to keep their special status. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: add more testing for epochDan McGee2011-01-21
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: Rename epoch pactestsDan McGee2011-01-21
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a pactest for the situation in FS#7524Dan McGee2011-01-21
| | | | | | | Confirming the current behavior. And yes, the error message is still no better than it was when this was reported 3.5 years ago. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add two pactests with non-trivial file countsDan McGee2011-01-11
| | | | | | | These are probably useful anyway, but also exposed the double file list bug that will be fixed in a later commit. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: Use booleans where it makes senseDan McGee2011-01-05
| | | | | | No need to use 0/1 when we can use False/True for the force option. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2010-12-30
|\ | | | | | | | | | | Conflicts: lib/libalpm/sync.c test/pacman/tests/ignore007.py
| * Respect Ignore{Pkg,Group} for group membersJakob Gruber2010-12-30
| | | | | | | | | | | | Fixes FS#19854. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Tests: Sync group which includes ignored pkgsJakob Gruber2010-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * FS#19854 (--ignore is ignored with groups) * http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html (operation aborts when a package from a group is ignored/and user chooses not to install it) If a group member is ignored, we expect a) a question whether to install b) after saying 'no' to a), the ignored member not to be installed c) all other group members to be installed d) pacman to execute successfully Signed-off-by: Dan McGee <dan@archlinux.org> (cherry picked from commit 9d0b33fd3327ae6d2b15f50870c0885a2068d492)
* | Add pactest to test long archive readsDan McGee2010-12-21
| | | | | | | | | | | | | | | | | | This creates two packages with extremely long description lines (500KB and 600 KB), causing our archive read code to perform reallocation to store the whole contents. One of the packages will successfully read while the other will fail for the time being. Signed-off-by: Dan McGee <dan@archlinux.org>
* | alpm/remove.c : respect --dbonly during remove-upgradeXavier Chantry2010-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a -Sk or -Uk operation induced a removal of an existing local package, --dbonly was not in effect and the files were all removed. Fixing this behavior was already marked as TODO in database012 pactest ------------ TODO: I honestly think the above should NOT delete the original les, it hould upgrade the DB entry without touching anything on the file stem. E.g. this test should be the same as: pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz ------------ Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> [Dan: small coding style touchup] Signed-off-by: Dan McGee <dan@archlinux.org>
* | Tests: '-S repo/group' syntaxJakob Gruber2010-10-18
| | | | | | | | | | | | | | when calling '-S repo/group', only group members in <repo> should should be installed (group members in other repos are ignored) Signed-off-by: Dan McGee <dan@archlinux.org>
* | Tests: Sync group which includes ignored pkgsJakob Gruber2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * FS#19854 (--ignore is ignored with groups) * http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html (operation aborts when a package from a group is ignored/and user chooses not to install it) If a group member is ignored, we expect a) a question whether to install b) after saying 'no' to a), the ignored member not to be installed c) all other group members to be installed d) pacman to execute successfully Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add several pactests for epoch codeDan McGee2010-10-13
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | CLI args: reorganize parsingJakob Gruber2010-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split parsing of CLI arguments into separate functions: parsearg_op (operations) parsearg_global (global options) parsearg_{database,query,remove,sync,deptest,upgrade} Organization strictly follows the manpage (even where the manpage is incorrect) - these cases will be fixed in the following commits. Switch cases are copy/pasted and statements unrelated to chosen operation are deleted. Parsing logic adjusted as follows: 1) Parse operation 2) If we can bail out early (duplicate op, help/version requested) do so 3) Parse arguments again: foreach arg: if arg is operation: continue tryparse_args_specific_to_op if unsuccessful tryparse_args_global if unsuccessful print error message and exit Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: fix typo in ignore001Xavier Chantry2010-10-11
| | | | | | | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | CLI args: add pactest with an invalid combinationJakob Gruber2010-10-11
|/ | | | | | | | | Pacman should catch cases in which the passed arguments don't apply to the current operation (sync/query/...). Also see FS#20950. Signed-off-by: Dan McGee <dan@archlinux.org>
* Maintain a list of seen packages when installing a groupDan McGee2010-07-27
| | | | | | | | | | | | | | As reported in FS#20221, we don't always do the right thing when installing a group and using the --needed option. This was due to the code pulling packages based on what was already in the transaction's add list, but completely ignoring the fact that we may have already seen and skipped this same package in an earlier repository. Add a list to the private _alpm_sync_pkg() function that allows us to have this extra information so we don't mistakenly downgrade a package when using --needed. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add two pactests for group and --needed interactionDan McGee2010-07-27
| | | | | | | | The first step for resolving FS#20221. sync023 is the case from the bug report; sync022 is already working fine but we have no tests at all that test the --needed option in any form. Signed-off-by: Dan McGee <dan@archlinux.org>
* Handle sync target + ignore properlyDan McGee2010-06-20
| | | | | | | | | | | Rather than say we can't find the target after saying "No, I guess I don't want to install this", we should make sure the ignored status gets passed all the way through. This fixes FS#19866. Pactest is also included that failed before due to the fact that we normally treat an unfound package as a reason to exit with a non-zero status. Signed-off-by: Dan McGee <dan@archlinux.org>
* Move pacman test suiteAllan McRae2010-06-02
Move the test suite to test/pacman in order to make a logical location for a future makepkg test suite. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>