summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* 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>
* Fix trailing whitespace in whole codebaseDan McGee2011-08-17
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* build-sys: always use $(RM) instead of rm -fDave Reisner2011-08-15
| | | | | | | These are equivalent. Use the autoconf macro for consistency. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* add pactest for replacing a shared providerDave Reisner2011-08-15
| | | | | | | This is currently expected to fail. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest/sync200: check for curl instead of fetchDave Reisner2011-08-15
| | | | | | | | We can't just check for LIBS as curl won't be listed. Instead, look at the length of the LIBCURL var from the Makefile. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: -U --recursivePang Yan Han2011-08-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: add sync302 to test recursive syncfirstDave Reisner2011-08-11
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Parse replaces strings as dep strings with version specsDan McGee2011-08-09
| | | | | | | | 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>
* Add a slightly simpler versioned replace testDan McGee2011-08-09
| | | | | | | | | 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>
* pactest: improve speed of local DB dependent rulesDan McGee2011-08-09
| | | | | | | | | | | | | | We were doing some really silly stuff before and abusing the os.walk() call, having to walk the entire local database for every single PKG rule. We really only need top level directories, and we can cache any generated package since calls to db_read() are well-defined and only happen in one place. This speeds up the running of tests that may want to add 100 PKG_VERSION rules at once, where before we had to limit how many we used in order to not put a serious cramp in the speed of the test suite run. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a test harness for new pacsort commandDan McGee2011-08-08
| | | | | | | | Note that this is meant to exercise pacsort more than the underlying version comparsion; that is better left to the standalone vercmptest.sh test script. Signed-off-by: Dan McGee <dan@archlinux.org>
* Bash-ify test/util/vercmptest.shDan McGee2011-08-08
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Implement parsing of the new SigLevel directiveDan McGee2011-08-02
| | | | | | | | | | | | | | | | | | | | | | | | Add code to conf.c that parses the new SigLevel directive. An overwhelming number of options are presented, but most users will still be fine with the Never/Optional/Required trio. More advanced users can combine these or any of the other options on a 'SigLevel = ' line, which is parsed in a left-to-right fashion and flags turned on and off accordingly. For example, all three of these will net the same config: SigLevel = Required PackageOptional SigLevel = Optional DatabaseRequired SigLevel = DatabaseRequired PackageOptional Additionally, database-specific lines assume you wish to start with any global default that has been set. For example, if any of the above lines were in the [options] section, something such as: SigLevel = PackageRequired PackageAllowMarginal Would continue to enforce required database signatures. Inspiration-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>