summaryrefslogtreecommitdiffstats
path: root/test/pacman/tests
AgeCommit message (Collapse)AuthorFilesLines
2011-08-11pactest: add sync302 to test recursive syncfirstDave Reisner1-0/+49
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-09Parse replaces strings as dep strings with version specsDan McGee1-2/+0
This is done extremely crudely and is not very efficient, but it does push us down the path of being closer to right, as one additional test now passes. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-09Add a slightly simpler versioned replace testDan McGee3-26/+46
It turns out we have a few problems here which are best tackled independently. The first is simply parsing replacements as dep strings; the second will be dealing with replaces when the original package name still exists in the repository. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-02Don't trim whitespace when reading database entriesDan McGee2-0/+84
We don't write with extra or unknown whitespace, so there is little reason for us to trim it when reading either. This also fixes the hopefully never encountered "paths that start or end with spaces" issue, for which two pactests have been added. The tests also contain other evil characters that we have encountered before and handle just fine, but it doesn't hurt to ensure we don't break such support in the future. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18Add a new epoch pactestDan McGee1-0/+25
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18Handle removal of empty directories properlyDan McGee1-8/+16
This addresses FS#25141. We shouldn't remove every empty directory we come across during the removal process unless it is truly not known to any other package. This will prevent removal of essential directories such as '/var/lock/'. This is accomplished by first checking the empty/non-empty status of a directory, which was previously done implicitly by calling rmdir() and ignoring errors. We do this to avoid the next (new) check in most cases, which is to look at all local packages to see if the to-be-removed directory is present in another packages' filelist. If we do not find it anywhere, then we remove it, else we keep the file around. The pactest has been updated to test more cases, as well as finding a flaw in the original expected to fail case- we need separate DIR and FILE based EXIST rules. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-14Allow fileconflict if unowned file moving into backup arrayDan McGee4-1/+69
The bulk of this commit is adding new tests to ensure the new behavior works without disrupting old behavior. This is a relatively sane maneuver when a package adds a conf file (e.g. '/etc/mercurial/hgrc') that was not previously in the package, but it is placed in the backup array. In essence, we can treat the existing file as having always been a part of the package and do our normal compare/install as pacnew logic checks. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-03pactest: add a few more checks to fileconflict checksDan McGee2-2/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27Merge branch 'maint'Dan McGee1-0/+21
Conflicts: lib/libalpm/conflict.c
2011-06-27Ensure a file can be replaced by a directoryDan McGee1-0/+21
This addresses FS#24904. In a normal upgrade case, this replacement seems to work just fine. However, when doing a sync "replace" type upgrade, we weren't properly handling this edge case due to path comparison not ignoring trailing slashes. Fix this by pruning any trailing slashes past a certain point of file conflict resolution where we no longer need them, which allows us to safely detect cases such as now tested in the new pactest. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Add a 'valid' flag to the database objectDan McGee1-1/+1
Start by converting all of our flags to a 'status' bitmask (pkgcache status, grpcache status). Add a new 'valid' flag as well. This will let us keep track if the database itself has been marked valid in whatever fashion. For local databases at the moment we ensure there are no depends files; for sync databases we ensure the PGP signature is valid if required/requested. The loading of the pkgcache is prohibited if the database is invalid. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Do database signature checking at load timeDan McGee1-2/+2
This is the ideal place to do it as all clients should be checking the return value and ensuring there are no errors. This is similar to pkg_load(). We also add an additional step of validation after we download a new database; a subsequent '-y' operation can potentially invalidate the original check at registration time. Note that this implementation is still a bit naive; if a signature is invalid it is currently impossible to refresh and re-download the file without manually deleting it first. Similarly, if one downloads a database and the check fails, the database object is still there and can be used. These shortcomings will be addressed in a future commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20pactest: add retcode=0 to several testsDan McGee10-0/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-03Use standard errno codes in return from _alpm_archive_fgetsDan McGee1-7/+5
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>
2011-06-03Add two currently failing test cases from bug reportsDan McGee2-0/+52
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-20Merge branch 'maint'Dan McGee1-0/+43
Conflicts: lib/libalpm/trans.c src/pacman/query.c
2011-05-16Fix segfault when uninstalling broken backed-up symlinkDan McGee1-2/+0
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>
2011-05-16Add test for FS#24230, dead backup symlink removalDan McGee1-0/+45
This currently causes a segfault, which is bad news. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Added gpg verification options per repo to the config file.Xavier Chantry2-2/+2
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>
2011-03-23Add a pactest showing failed GPG verificationDan McGee1-0/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add a few pactests for PGP integrationDan McGee2-0/+20
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Fix handling of ignored packagesPang Yan Han1-1/+1
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>
2011-03-01pactest: use actual regexes in OUTPUT rulesDan McGee13-22/+22
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>
2011-02-27pactest for removing a required empty directoryAllan McRae1-0/+21
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25Add test case for util-linux/util-linux-ng name switch and depsDan McGee1-0/+45
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>
2011-02-25Continue resolving dependencies rather than bailing on first errorDan McGee1-0/+17
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>
2011-02-25Various small spelling fixes and small tweaksDan McGee1-1/+1
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>
2011-02-04Add a new removal smoke testDan McGee2-5/+23
Hint: this will really stress hash table removal. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31make -d less strict; add -dd optionFlorian Pritz6-14/+10
-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>
2011-01-31add pactests for -SddXavier Chantry6-0/+103
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31Allow both cleanmethod values to be specified at the same timeDan McGee2-0/+59
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>
2011-01-31Add three clean cache testsDan McGee3-0/+68
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>
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-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 McGee1-1/+2
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-22Modify all pactests to not use PKG_MODIFIEDDan McGee9-9/+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 pmtestDan McGee2-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22Remove epoch as an independent fieldDan McGee9-38/+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-22pactest: add more testing for epochDan McGee7-0/+48
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22pactest: 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-12Add 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-06pactest: Use booleans where it makes senseDan McGee4-4/+4
No need to use 0/1 when we can use False/True for the force option. 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-13alpm/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-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>