summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* pactest: variant of package removal due to unmet dependenciesAllan McRae2012-12-14
| | | | | | | Duplicate of sync140.py but with the alphabetical ordering of the packages changed. Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: removal of packages with unmet dependenciesAllan McRae2012-12-14
| | | | | | | | Provide a package for removing packages with unmet dependencies. Currently pacman removes too many packages from the transaction (FS#30649). Signed-off-by: Allan McRae <allan@archlinux.org>
* Avoid upgrade conflict with unchanged effective pathAllan McRae2012-12-14
| | | | | | | | | | | | This applies to a case such as when /lib is a symlink to /usr/lib. If a package is installed which contains /lib/libfoo.so, pacman will complain if this package is then "fixed" to contain /usr/lib/libfoo.so. Since these have the same effective path and it exists within the same package, ignore the conflict. Fixes FS#30681. Signed-off-by: Allan McRae <allan@archlinux.org>
* Resolve file paths during inter-package conflict checkAllan McRae2012-12-14
| | | | | | | | File paths are resolved if necessary during inter-package conflict checks so that packages carrying the same effective file due to directory symlinks on the filesystem are flagged as conflicting. Signed-off-by: Allan McRae <allan@archlinux.org>
* Detect inter-package conflicts between files and directoriesAllan McRae2012-12-14
| | | | | | | | | | | | Detect a conflict between a file/symlink in one package and a directory in another when both are being installed at once. A side effect is the creation of conflicts between a directory symlink and a real directory (e.g lib -> usr/lib in pkg1 and /lib in pkg2). Given we can not guarantee pkg1 is installed before pkg2, this is a genuine conflict. Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: Provide a full filelist to the pactests that need itAllan McRae2012-12-14
| | | | | | | | | | It turns out when you set the filelist for a package to include "usr/lib/foo" in the pactest suite, it thinks there is only the file "usr/lib/foo" in there... No "usr/" or "usr/lib/" directory. This makes life difficult when testing code that scrolls through a filelist looking for directory entries. Signed-off-by: Allan McRae <allan@archlinux.org>
* Merge branch 'maint'Dan McGee2012-09-18
|\
| * pactest: allow running with valgrind from any directoryAllan McRae2012-09-18
| | | | | | | | | | | | | | | | | | | | | | | | When using the --valgrind flag with the pactest.py script, the path to the suppression file relies on the script being called from the source root directory. Construct the path from the scripts location to allow it to be called from directory. Dan: style cleanup. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | fixed typoBarbu Paul - Gheorghe2012-08-07
| | | | | | | | Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
* | pactest: avoid upgrade conflict with unchanged effective pathDave Reisner2012-08-02
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: Do not remove symlink to directory if a to be installed package uses itAllan McRae2012-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a pacakge has a directory symlink (e.g. /lib -> usr/lib), do not allow it to be removed if any other package is trying to install a file into that path (e.g. /lib/foo). This is because the local database can become invalidated if the symlink is removed after the package with file /lib/foo is installed (sync702.py). If the symlink is removed before the file is installed (sync701.py), the upgrade is actually a success, but we can not guarantee the ordering so both cases should fail. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: Do not remove symlink to directory if local package uses that pathAllan McRae2012-08-02
| | | | | | | | | | | | | | | | | | | | If we have a symlink to a directory (e.g. /lib -> usr/lib), then we can not remove it if a local package thinks it has files in the symlink directory (e.g. /lib/foo), because this will invalidate the local file database. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: conflict between files having same effective pathAllan McRae2012-08-02
| | | | | | | | | | | | | | | | Note failure to detect a conflict between files having the same effective path across packages due to a directory symlink. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: conflict between directory and a fileAllan McRae2012-08-02
| | | | | | | | | | | | | | | | | | Note failure to detect a conflict between a directory in one package and a file in the other when the directory is not currently on the filesystem. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add pactest for empty subdirectory conflictAllan McRae2012-08-02
| | | | | | | | | | | | | | | | The wrong test file was inadvertantly committed in 44e9fdd0. Add the correct test and tidy up the test which was committed. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-07-10
|\| | | | | | | | | Conflicts: etc/makepkg.conf.in
| * Check empty subdirectory ownershipAllan McRae2012-07-10
| | | | | | | | | | | | | | | | | | | | | | When checking if a package owns a directory, it is important to check not only that all the files in the directory are part of the package, but also if the directory is part of a package. This catches empty subdirectories during conflict checking for directory to file/symlink replacements. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add conflict for replacing owned empty directoryAllan McRae2012-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When two packages own an empty directory, pacman finds no conflict when one of those packages wants to replace the directory with a file or a symlink. When it comes to actually extracting the new file/symlink, pacman sees the directory is still there (we do not remove empty directories if they are owned by a package) and refuses to extract. Detect this potential conflict early and bail. Note that it is a _potential_ conflict and not a guaranteed one as the other package owning the directory could be updated or removed first which would remove the conflict. However, pacman currently can not sort package installation order to ensure this, so this conflict requires manual upgrade ordering. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Scripts testsuite output consistencyAllan McRae2012-06-25
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | scripts/library: add human_to_sizeDave Reisner2012-06-25
| | | | | | | | | | | | | | | | This is a bash wrapper around an awk function that parses human readable sizes and returns their representative values in bytes, as a string. A small test harness is added to validate the functionality. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | query: avoid false ownership matches for files in rootDave Reisner2012-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for an exact match when querying ownership of files in the root. Previously, our test was too simple and would match the the basename of package files against the query parameter, e.g. $ pacman -Qo config /config is owned by cower-git 20120614-1 Adds a new test to verify this behavior, query007.py. Fixes FS#30388. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | scripts/library: introduce parseoptsDave Reisner2012-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will replace our current options parser used in pacman-key, makepkg, and ideally elsewhere. It follows heuristics closer to that of GNU getopt long (and thus pacman itself), with the exception that it does not allow for options with optional arguments. Due to the way this parser will be used, this sort of functionality will not be needed. Instead of relying on eval+set, options are normalized into an array, OPTRET, which callers should expect to be populated after returning from parseopts. This avoids problems with quotes and spaces in arguments, assuming that the user quotes properly when passing into the application. A new test harness for parseopts is added in test/scripts. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | Remove SyncFirst optionDan McGee2012-04-12
| | | | | | | | | | | | | | | | | | | | | | This has outlived its usefulness and causes more problems than it solves. It has historically only ever been used to install pacman first. That should not be needed given we provide the vercmp utility (which has no library dependencies) and so calling pacman in install scripts is a sign of poor packaging. Work-duplicated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: make OPTDEPEND rule look at non-description onlyDan McGee2012-03-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Point python shebangs at python2Allan McRae2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | Python PEP-394 states that all python code should point at the python2 or python3 symlinks at maintain cross-distro compatibility. Note that this does not matter when calling these scripts using "make check" as they are explictly called using the detected python version. As this only affects manually calling these scripts, I have not had configure/make replace the shebangs. Signed-off-by: Allan McRae <allan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-02-20
|\| | | | | | | | | | | Conflicts: contrib/pacsysclean.in src/pacman/conf.h
| * Revert "Add -S --recursive operation"Dan McGee2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f3fa77bcf1d792971c314f8c0de255866e89f3f3 along with making other necessary changes to fully back this (mis)feature out until we can do it correctly. The quick summary here is this was not implemented correctly; provides are not fully taken into account in this logic, and making that happen exposes a lot of other flaws in this code that are covered up later on in the dependency resolving process by several other pieces of convoluted and conditional logic. Tests have been adjusted accordingly. Some test EXISTS conditions have been removed as we already know the package is installed locally, and we also are checking the VERSION condition anyway. With these two related revert commits, we do have some changes in test pass/fail results: * upgrade078.py: does not pass, this is due to --recursive getting removed for -U/-S operations after this commit. * sync302.py: the version checks have been disabled, so this test continues to pass but has been scaled back in scope. * sync303.py: now passes, was failing before. * sync304.py: still failing, was failing before. * sync305.py: now passes, was failing before. * sync306.py: still passes, was passing before. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Revert "Enable recursive/needed sync on SyncFirst"Dan McGee2012-02-15
| | | | | | | | | | | | | | | | | | | | This reverts commit 09034520325efcc2e684f05fa7a99c02bad1f5be. Tests affected by this revert have been adjusted; additionally a few EXIST tests have been removed where there is already a VERSION test doing the job for us. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-02-06
|\| | | | | | | | | Conflicts: lib/libalpm/alpm_list.c
| * pactest: check return code in some upgrade testsDan McGee2012-02-03
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-01-02
|\| | | | | | | | | Conflicts: doc/Makefile.am
| * add new pactest for syncfirst with recursive depsDave Reisner2012-01-02
| | | | | | | | | | | | | | | | | | | | | | | | Add 1 failing for the -Su case, and the same case using -S (and passing). This is based on a real (current) issue of upgrading staging chroots with the new pacman in staging for a libarchive build, and a new toolchain in testing. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use automake verbose helpers in custom make rulesDan McGee2011-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts our script generation to use the built-in AM_V_GEN macro, which honors the V= setting passed to make and allows one to see the full command if they truly desire. The AM_V_at macro is also used in place of an explicit @ so verbose-mode compiles show all commands being run. We can also use these two macros in doc generation to quiet it down to the level we expect. Other minor changes: * a pointless test call is removed in test/pacman/tests/ * sed is used instead of dos2unix as we depend on it anyway * consecutive chmod calls are reduced to a single call (e.g., '+x,a-x') Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-30
|\|
| * Add two new pactests for pacman upgrade behaviorDan McGee2011-11-30
| | | | | | | | | | | | | | | | | | | | Both currently marked as failing. * sync303.py encapsulates the broken behavior reported in FS#27214. * sync304.py shows how packages depending on a specific version of a package in SyncFirst can cause breakage of the dependency resolver. Signed-off-by: Dan McGee <dan@archlinux.org>
* | add fnmatch support for HoldPkgDave Reisner2011-11-13
| | | | | | | | | | | | Adds test remove031. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | add support for back end fnmatch'd optionsDave Reisner2011-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This is work originally provided by Sascha Kruse on FS#20360 with only minor adjustments to the implementation. It's been expanded to cover: NoUpgrade, NoExtract, IgnorePkg, IgnoreGroup. Adds tests ignore008, sync139, sync502, and sync503. Also satisfies FS#18988. Original-work-by: Sascha Kruse <knopwob@googlemail.com> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-11-01
|\|
| * Fix issues with replacing unowned symlinksDan McGee2011-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There aretwo seperate issues in the same block of file conflict checking code here: 1) If realpath errored, such as when a symlink was broken, we would call 'continue' rather than simply exit this particular method of resolution. This was likely just a copy-paste mistake as the previous resolving steps all use loops where continue makes sense. Refactor the check so we only proceed if realpath is successful, and continue with the rest of the checks either way. 2) The real problem this code was trying to solve was canonicalizing path component (e.g., directory) symlinks. The final component, if not a directory, should not be handled at all in this loop. Add a !S_ISLNK() condition to the loop so we only call this for real files. There are few other small cleanups to the debug messages that I made while debugging this problem- we don't need to keep printing the file name, and ensure every block that sets resolved_conflict to true prints a debug message so we know how it was resolved. This fixes the expected failures from symlink010.py and symlink011.py, while still ensuring the fix for fileconflict007.py works. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add some unowned symlink replacement testsDan McGee2011-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These should all prevent installation, and yet two of the three tests currently fail. Not good. The best way to see what is going on here is to diff the three new tests side by side- there is only a small difference between the three tests, and that is in the destination of the symlink in question that should never be overwritten. symlink010.py: myprogsuffix -> myprog symlink011.py: myprogsuffix -> broken symlink012.py: myprogsuffix -> otherprog Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove -f short option for --forceDan McGee2011-10-14
|/ | | | | | | | | This is not something that should be used on a frequent basis, and giving it a short option encourages use without making the drawbacks obvious. For the 1% of situations that require it, the 5 extra keystrokes are a fair price to pay. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: add a better descriptionDan McGee2011-10-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Format pacsort and vercmp testsuite outputAllan McRae2011-10-07
| | | | | | | | Make the output into a single block and add separators at the end so that they do not merge into each other. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a random pactestDan McGee2011-09-18
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* include ldconfig.stub in EXTRA_DISTDave Reisner2011-09-14
| | | | | | | | Since c51b9ca, ldconfig.stub is required by pactest so we need to include it as part of the dist tarball. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: remove PACMAN_OUTPUT from ldconfig testsDan McGee2011-09-01
| | | | | | | | | This removes the last usages of this rule that aren't explicitly looking at real output from pacman. Notably, these tests depended on one particular debug logger not ever being changed, which is too fragile, not to mention doesn't work at all with --nolog. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add pactest for overflowing date (year 2038 problem)Dan McGee2011-09-01
| | | | | | | | This will work fine on x86_64 (or any platform that has a 64 bit long), but currently fails on i686. This test also stresses the recent changes to accommodate package size values greater than a 32 bit UINT_MAX. Signed-off-by: Dan McGee <dan@archlinux.org>
* Rework scriptlet tests to not depend on pacman outputDan McGee2011-08-29
| | | | | | | This actually does something in a scriptlet we can check with our normal set of rules, rather than relying on pacman debug output. Signed-off-by: Dan McGee <dan@archlinux.org>
* vercmp: ensure 2.0a and 2.0.a do not compare equalDan McGee2011-08-23
| | | | | | | | | | | | | | | | We had this interesting set of facts conundrum, according to vercmp return values: 2.0a < 2.0 2.0 < 2.0.a 2.0a == 2.0.a This introduces a code change that ensures '2.0a < 2.0.a' as would be expected by the first two comparisons. Unfortunately this stays us a bit further from upstream RPM code, but those are the breaks (in RPM, the versions involving 'a' do in fact compare the same, but they are both greater than the bare '2.0'). Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix replacement of provider issueDan McGee2011-08-18
| | | | | | | | | When we switched to using alpm_depcmp() in resolving replacments, we had some interesting behavior with regard to providers and packages not found in repositories. Teach the replacement resolving code to not look at provisions at all to be slightly more sane. Signed-off-by: Dan McGee <dan@archlinux.org>