summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Update copyright notices for 2015Allan McRae2015-02-01
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* pmenv.py: Fix typo in copyright assignmentAllan McRae2015-02-01
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* remove support for .pacorig filesAndrew Gregory2015-01-21
| | | | | | | | 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>
* test makepkg-template: Add update-version-with-newest-optionFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add template-without-versionFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add name-charset-validFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add name-charset-invalidFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add missing-template-symlinkFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add missing-template-fileFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add keep-old-versionFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add invalid-template-line-unknown-markerFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add invalid-template-line-missing-nameFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* test makepkg-template: Add invalid-keyFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* Add testrunner for makepkg-templateFlorian Pritz2015-01-11
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* add tap_ prefix to test helper functionsAndrew Gregory2014-12-28
| | | | | | | | 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>
* use tap.sh for bash testsAndrew Gregory2014-12-28
| | | | | | | | 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>
* add vim modeline to test filesAndrew Gregory2014-12-24
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove.c: honor inverted patterns in noupgradeAndrew Gregory2014-12-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacsort: parse inputs up front into control structDave Reisner2014-11-20
| | | | | | | | | | | | | | | | | | | | | | 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>
* add pacman-db-upgrade-v9.py to check_SCRIPTSAndrew Gregory2014-11-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* tests/pacman-db-upgrade-v9: set additional pathsAndrew Gregory2014-11-04
| | | | | | | | | | | --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>
* pmtest: make test paths easily available to testsAndrew Gregory2014-11-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* add pacman-db-upgrade testAndrew Gregory2014-10-13
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: allow tests to specify test binaryAndrew Gregory2014-10-13
| | | | | | | | | | | 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>
* pacman: add --confirm optionAndrew Gregory2014-10-13
| | | | | | | | | --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>
* pmtest: allow tests to specify db versionAndrew Gregory2014-10-13
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmrule: make backup file test more robustAndrew Gregory2014-10-13
| | | | | | | | | 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>
* pmdb: include directories in package file listsAndrew Gregory2014-10-13
| | | | | | | 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>
* Add --assume-installed optionFlorian Pritz2014-09-30
| | | | | | This allows to ignore specific dependencies. Signed-off-by: Florian Pritz <bluewind@xinu.at>
* Check the version of the local database during validationAllan McRae2014-09-23
| | | | | | | 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>
* Add version file to empty local databaseAllan McRae2014-09-23
| | | | | | | 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>
* Add version file when creating local database directoryAllan McRae2014-09-23
| | | | | | | | 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>
* pactest: delay test object creationAndrew Gregory2014-08-04
| | | | | | | | | 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>
* pactest: only snapshot needed filesAndrew Gregory2014-08-04
| | | | | | | | | 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>
* check_pkg_fast: check file typeAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* add test for file type check with -QkAndrew Gregory2014-08-03
| | | | | | | | | | 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>
* pactest: check for tests before environment setupAndrew Gregory2014-08-03
| | | | | | | 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>
* pactest: check for pacman binary before runningAndrew Gregory2014-08-03
| | | | | | | | | | 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>
* pactest: parse options before environment setupAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* Add test case for the perl 5.20 dependency breakageFlorian Pritz2014-06-10
| | | | | | | This test currently fails. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove.c: downgrade TRANS_DUP_TARGET to warningAndrew Gregory2014-05-07
| | | | | | | Matches the behavior for sync packages. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: treat arguments as files instead of globsAndrew Gregory2014-05-04
| | | | | | | | | | glob() returns an empty list if input does not match any files, causing non-existent test files to be silently skipped. Treating arguments as files causes pactest to immediately bail out with an appropriate error message on non-existent files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmdb.py: change siglevel name to RequiredAndrew Gregory2014-05-04
| | | | | | | | | "Always" is not a valid siglevel. sign002.py was succeeding because pacman failed to parse the resulting config file rather than a failed signature check. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: add prefix to temporary directoryAndrew Gregory2014-03-03
| | | | | | | This makes cleaning up /tmp after several --keep-root runs much easier. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmpkg.py: remove unused importsAndrew Gregory2014-03-03
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: add memory check to tests with valgrindAndrew Gregory2014-02-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmrule: add FILE_EMPTY ruleAndrew Gregory2014-02-04
| | | | | | | Succeeds if the specified path is a file and is empty. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: use exit status 0 for --help and --versionAndrew Gregory2014-01-30
| | | | | | | The user requesting usage or version information is not an error. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: use valgrind --child-silent-after-forkAndrew Gregory2014-01-28
| | | | | | | Silences false warnings after alpm forks to run install scripts. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: use --gen-suppression=all with valgrindAndrew Gregory2014-01-28
| | | | | | | | | Let valgrind do the work of writing any suppression rules needed by the test suite. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>