summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2015-11-28allow arguments in hook Exec fieldsAndrew Gregory2-0/+23
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-28tap.py: replace newlines with escape sequenceAndrew Gregory1-1/+1
Newlines clutter tap output and can potentially confuse TAP parsers. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-28pmrule.py: add FILE_CONTENTS ruleAndrew Gregory2-0/+7
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18add hook testsAndrew Gregory10-0/+237
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18pactest: add hook/script supportAndrew Gregory2-6/+46
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18util.py: return the created pathAndrew Gregory3-5/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18pactest: use pacman --hookdir optionAndrew Gregory2-0/+5
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-19sortbydeps: skip local packages being updatedAndrew Gregory2-0/+33
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12makepkg-template: support multiple --template-dirsDominik Fischer12-4/+56
Especially when maintaining local templates in addition to the ones stored in /usr/share/makepkg-template, it can be useful to include templates stored in multiple different locations into one PKGBUILD. This patch makes this possible by allowing --template-dir to be specified multiple times. This also introduces a dedicated error message when a template cannot be found, in contrast to the already existing "Couldn't detect version for template '%s'". If a template of the same name is present in more than one of the given directories, the last one always takes precedence. Neither the default behaviour without the option given, nor the handling of a single template dir is changed. Signed-off-by: Dominik Fischer <d.f.fischer@web.de> Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03remove: use strcmp for files in skip_removeAndrew Gregory2-0/+20
Paths from noupgrade, the transaction skip_remove, and package backup lists were combined into a single list matched using fnmatch causing paths with glob characters to match unrelated files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-12Merge branch 'maint'Allan McRae3-22/+2
2015-02-12sync200.py.in: remove unused substitutionAndrew Gregory3-22/+2
LIBCURL was never set in the Makefile so XferCommand was always being set in the test file. This removes the only substitution in our test files which will prevent the TESTS file from being rebuilt every time configure is run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01Update copyright notices for 2015Allan McRae11-11/+11
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01pmenv.py: Fix typo in copyright assignmentAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-21remove support for .pacorig filesAndrew Gregory7-11/+2
Leave user files in place and save new config files with a .pacnew extension. This reduces the complexity of file extraction and respects the principle that pacman shouldn't modify files it didn't create. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-11test makepkg-template: Add update-version-with-newest-optionFlorian Pritz5-0/+50
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add template-without-versionFlorian Pritz3-0/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add name-charset-validFlorian Pritz3-0/+28
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add name-charset-invalidFlorian Pritz2-0/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add missing-template-symlinkFlorian Pritz3-0/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add missing-template-fileFlorian Pritz2-0/+21
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add keep-old-versionFlorian Pritz5-0/+58
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add invalid-template-line-unknown-markerFlorian Pritz2-0/+20
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add invalid-template-line-missing-nameFlorian Pritz2-0/+12
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11test makepkg-template: Add invalid-keyFlorian Pritz2-0/+12
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11Add testrunner for makepkg-templateFlorian Pritz3-0/+77
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-12-28add tap_ prefix to test helper functionsAndrew Gregory4-119/+119
Allows tap.sh to show the line number where the helper function was called on failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-28use tap.sh for bash testsAndrew Gregory5-145/+192
tap.sh is a reusable TAP library that handles test counting and provides useful diagnostic messages on test failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24add vim modeline to test filesAndrew Gregory4-0/+8
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18remove.c: honor inverted patterns in noupgradeAndrew Gregory2-0/+20
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-20pacsort: parse inputs up front into control structDave Reisner1-1/+10
This moves most of the parsing work out of the sorting path. The explode and splitfile functions now call input_new and append input_t structs to the list of sort candidates instead of raw strings. This lets us make smarter and easier decisions in the sorting callbacks, which are now also split into the version and file comparison methods for clarity. This fixes two bugs: 1) Incorrect ordering with filenames containing epoch in the pkgver 2) Incorrect ordering with package names which are substrings of each other (e.g. "systemd" and "systemd-sysvcompat"). Performance of the --files mode degrades slightly as a result of this change, but not unreasonably. Sorting with small inputs (5-10) doubles in runtime, but larger inputs (4000+) only increase by 20%. ref: https://bugs.archlinux.org/task/37631 Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04add pacman-db-upgrade-v9.py to check_SCRIPTSAndrew Gregory1-0/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04tests/pacman-db-upgrade-v9: set additional pathsAndrew Gregory1-1/+5
--config does not respect root, causing pacman-db-upgrade to read the local pacman.conf rather than the one in the test root. Also add a rule to ensure the ALPM_DB_VERSION file is actually being created. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04pmtest: make test paths easily available to testsAndrew Gregory1-4/+16
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13add pacman-db-upgrade testAndrew Gregory1-0/+21
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13pmtest: allow tests to specify test binaryAndrew Gregory4-18/+29
Adds a cmd property to tests (defaults to pacman) which is resolved using directories specified with --bindir (defaults to PATH). The ability to manually specify a particular binary is preserved in order to allow running individual tests with differently named binaries such as lt-pacman. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13pacman: add --confirm optionAndrew Gregory1-3/+3
--confirm cancels the effect of a previous --noconfirm. This makes it easier for scripts to default to --noconfirm but allow users to override it. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13pmtest: allow tests to specify db versionAndrew Gregory1-2/+3
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13pmrule: make backup file test more robustAndrew Gregory1-6/+4
This prevents an exception in the event backup entries are not in the correct format and brings the test in line with alpm's backup parsing which splits on the last tab rather than the first. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13pmdb: include directories in package file listsAndrew Gregory1-1/+1
Needed for checking directories with PKG_FILES. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-30Add --assume-installed optionFlorian Pritz4-0/+47
This allows to ignore specific dependencies. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-09-23Check the version of the local database during validationAllan McRae1-1/+1
When we check the database version directly, there is no longer a need to scan for depends files. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23Add version file to empty local databaseAllan McRae1-0/+3
If a user manually creates the local database directory, or has an empty local database for some other reason, we silently add a version file Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23Add version file when creating local database directoryAllan McRae1-0/+2
The version of the local pacman database is stored in its root in the file ALPM_DB_VERSION. The version is starting at 9, corresponding to the next libalpm library version. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04pactest: delay test object creationAndrew Gregory1-3/+3
The actual test object is only used to run the test. Storing test cases as strings limits the test object scope and allows it to be garbage collected, reducing memory usage when multiple tests are run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04pactest: only snapshot needed filesAndrew Gregory2-6/+17
Only a few of our tests need file snapshots at all and most of them only need a few files. Taking snapshots of the entire test environment for every single test is a massive waste. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03check_pkg_fast: check file typeAndrew Gregory1-2/+0
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03add test for file type check with -QkAndrew Gregory2-0/+15
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pactest: check for tests before environment setupAndrew Gregory1-5/+4
Setting up the temporary directory and environment is pointless if there are no tests to run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pactest: check for pacman binary before runningAndrew Gregory1-1/+5
Using fakeroot or fakechroot as the command with subprocess.call prevents the detection and reporting of a missing pacman binary. Some tests even pass when run with a non-existent binary. Checking manually allows us to provide a meaningful error message and prevent the false positives. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>