summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2011-01-29pacman/sync: rewrite target handlingXavier Chantry1-1/+1
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>
2011-01-29Add interactive provider selectionXavier Chantry2-4/+0
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>
2011-01-29pactest: pass entire test to rule.check()Dan McGee2-12/+12
We were piecemeal passing fields from the test object in and it was getting out of hand, and future work would have added yet another argument. Instead, just pass the entire test object and entrust the rule to get what it needs. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22Add a few new provides testsDan McGee3-0/+66
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>
2011-01-22pactest: sort repos by alpha order in config fileDan McGee2-2/+6
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>
2011-01-22pactest: use new-style python classesDan McGee6-6/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: revamp modified logicDan McGee6-91/+18
Remove all logic dealing with PKG_MODIFIED as this rule no longer exists. This removes a bunch of unnecessary stat and checksum logic that most of the time we were never even using. Also update the file modified checks to mark every file created using mkfile() with an older time so any modified checks will just work without hacks. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22Modify all pactests to not use PKG_MODIFIEDDan McGee10-10/+14
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>
2011-01-22pactest: pylint changes for pmdbDan McGee1-35/+30
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for utilDan McGee1-29/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pmtestDan McGee3-40/+44
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pmpkgDan McGee1-13/+8
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pmruleDan McGee2-14/+12
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pmenvDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pactestDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: pylint changes for pmfileDan McGee1-14/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21Remove epoch as an independent fieldDan McGee12-61/+19
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>
2011-01-21Allow version comparison to contain epoch specifierDan McGee1-0/+19
Adapting from RPM, follow the [epoch:]version[-release] syntax. We can also borrow some of their parsing code for our purposes (thanks!). Add some new tests to our vercmp shell script tester for epoch comparisons, and then make the code work with these newfangled epoch specifiers. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21pactest: add more testing for epochDan McGee7-0/+48
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21pactest: Rename epoch pactestsDan McGee4-0/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21Add a pactest for the situation in FS#7524Dan McGee1-0/+38
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>
2011-01-11Add two pactests with non-trivial file countsDan McGee2-0/+30
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>
2011-01-11pactest: build the filelist using a set()Dan McGee1-6/+4
This will prevent duplicates, which we had plenty of once I made a few tests that had a list of files greater than the normal two. The previous logic was not working quite right. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-10pactest: correctly write epoch and force as necessaryDan McGee3-0/+9
We were missing this in a few places; also add the ability to check the outcome via a new rule type. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-05pactest: Use booleans where it makes senseDan McGee6-6/+6
No need to use 0/1 when we can use False/True for the force option. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-05pactest: remove dead functionDan McGee1-50/+0
Stopped being used after commit fa933df65b9. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-30Merge branch 'maint'Dan McGee1-2/+0
Conflicts: lib/libalpm/sync.c test/pacman/tests/ignore007.py
2010-12-30Respect Ignore{Pkg,Group} for group membersJakob Gruber1-2/+0
Fixes FS#19854. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-30Tests: Sync group which includes ignored pkgsJakob Gruber1-0/+23
* 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)
2010-12-21Add pactest to test long archive readsDan McGee1-0/+19
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>
2010-12-21pactest: allow testing of package descriptionDan McGee2-10/+7
And modify the code to not print the full rule string if it is more than 40 characters long; truncate it instead. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12Update pactest suite for change in db structureAllan McRae2-48/+18
Merging desc and depends files in sync and local db. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12alpm/remove.c : respect --dbonly during remove-upgradeXavier Chantry1-7/+1
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>
2010-10-18pactest: use valgrind.supp fileXavier Chantry1-1/+1
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18Tests: '-S repo/group' syntaxJakob Gruber1-0/+23
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>
2010-10-18Tests: Sync group which includes ignored pkgsJakob Gruber1-0/+23
* 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>
2010-10-13Add several pactests for epoch codeDan McGee4-0/+58
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Add epoch support to pactestDan McGee3-13/+14
This adds epoch support to pactest, while still producing packages and database entries the same way makepkg and repo-add currently do in a backward compatible fashion (still including the 'force' option). Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11CLI args: reorganize parsingJakob Gruber1-3/+0
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>
2010-10-11pactest: fix typo in ignore001Xavier Chantry1-1/+1
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11CLI args: add pactest with an invalid combinationJakob Gruber1-0/+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>
2010-10-11pactest: fix gensyncXavier Chantry3-22/+21
gensync generated a sync.db file with PKGINFO syntax, this is not quite what pacman expects. Also the file was only added to the Server path: root/var/pub/sync/sync.db but it was not available in the normal sync db path: root/var/lib/pacman/sync/sync.db Change gensync() to generate var/lib/pacman/sync/sync.db and then copy it to var/pub/sync/sync.db (this is used by sync200 -Sy test). Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11pactest: use simpler method to create tarXavier Chantry1-5/+2
Just like in 24fc623e1a8bf905cf0367f9bd40bc5bd6034378, apply to pmdb gensync as well. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-05Merge branch 'maint'Dan McGee1-8/+2
2010-10-05Make testsuite python-2.7 compatibleRémy Oudompheng1-8/+2
os.walk(".") adds a prefix of "./" to filenames in python-2.7 which causes libalpm not to like archives generated in the testsuite resulting in widespread failure. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27Merge branch 'maint'Dan McGee1-1/+4
2010-08-27pactest: add shell to fake root environmentJonathan Conder1-1/+4
Adds a shell to the fake root set up for pactests, which was not needed previously due to a bug (debian #582847) in fakechroot. Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
2010-07-27Merge branch 'maint'Dan McGee2-0/+54
2010-07-27Maintain a list of seen packages when installing a groupDan McGee1-2/+0
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>
2010-07-27Add two pactests for group and --needed interactionDan McGee2-0/+56
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>